kaigu1990 / stabiot

Common Statistical Analysis for Clinical Trials in Biotech
GNU General Public License v3.0
2 stars 0 forks source link

MMRM R package for superiority or non-inferiority trial design #2

Closed kaigu1990 closed 5 months ago

kaigu1990 commented 7 months ago

How do I conduct the MMRM analysis in R for superiority or non-inferiority trial design?

A brief summary can be seen at https://www.bioinfo-scrounger.com/archives/mmrm_hypothesis/.

So maybe a summary function could be better when I want to get a summary result. So simply wrap several steps into one function.

Well, I'm imagining that the S3 structure is more suitable. In this case, I can use the custom tidy method tidy.mmrm for mmrm summary results. Besides, how about the tidymodels package?

And I also want to wrap the emmeans functions inside, such as confint(), test() to get the CI and hypothesis testing.

The preliminary idea is to create a function called summarize_lsmeans(), or other names like s_mmrm_lsmeans() or s_get_lsmeans(). Considering the lsmeans can be computed by different models, such as mmrm, ancova and others, so we'd better define this function with corresponding classes.

Afterwards, the summarized function should return a class like stabiot.lsmeans so that users can use the tidy() function to get a tibble table for downstream analysis if needed.

Thus the steps should be these: