Skip to content

feat(moi): mmrm imputation models - #228

Merged
kkholst merged 40 commits into
mainfrom
feat/moi-mmrm
Oct 30, 2026
Merged

kkholst merged 40 commits into
mainfrom
feat/moi-mmrm

Conversation

@kkholst

@kkholst kkholst commented Sep 25, 2026

Copy link
Copy Markdown
Owner

No description provided.

@kkholst
kkholst marked this pull request as draft September 26, 2026 18:23
@kkholst kkholst changed the title added id argument to moi(), use of id argument en cate() i moi() feat(moi): mmrm imputation models Sep 26, 2026
@kkholst

kkholst commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner Author

@AndreasNordland, we need to discuss how to handle the id arguments in the most practical way...
Examples of the new mmrm methods can be found in inst/tinytest/test_mmrm.R

@kkholst
kkholst marked this pull request as ready for review October 6, 2026 20:28
@kkholst

kkholst commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner Author

@AndreasNordland, the following should now work:

set.seed(1)
dat <- targeted:::sim_cate(1e3) |>
  transform(z = rbinom(length(a), 1, 0.25),
            id = paste0("a", seq_along(a)))
rownames(dat) <- paste0("d", seq_len(nrow(dat)))
dat1 <- subset(dat, z==1)
g <- glm(u0 ~ w1 + a,
         data=dat1, family=binomial)
##
e1 <- estimate(g)
e <- c(
  'a=0'=expectation(predict, object=e1, data=transform(dat, a=0)),
  'a=1'=expectation(predict, object=e1, data=transform(dat, a=1))
)

id arguments can of course also be given directly to both the estimate and marginal functions (the above example automatically extracts ids from the row names of the data / model.frame.

@kkholst kkholst mentioned this pull request Oct 15, 2026
4 tasks done
@github-actions

Copy link
Copy Markdown

Github pages

Review the pkgdown webpage for the PR here

@kkholst
kkholst merged commit f681936 into main Oct 30, 2026
4 checks passed
@kkholst
kkholst deleted the feat/moi-mmrm branch October 30, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants