tern.mmrm
provides an interface for mixed model repeated measures (MMRM) within the tern
framework to produce commonly used tables (using rtables
and graphs. It builds on the R-package mmrm
for the actual MMRM calculations.
If you would like to use the tern
framework for tabulation and graphs, then this package is ideal for your MMRM fits. However if you use another reporting framework then it will be better to directly use mmrm
and perform the tabulation and plots differently.
tern.mmrm
is available on CRAN and you can install the latest released version with:
install.packages("tern.mmrm")
or you can install the latest development version directly from GitHub by running the following:
# install.packages("pak") pak::pak("insightsengineering/tern.mmrm")
You can get started by trying out the example:
library(tern.mmrm) fit <- fit_mmrm( vars = list( response = "FEV1", covariates = c("RACE", "SEX"), id = "USUBJID", arm = "ARMCD", visit = "AVISIT" ), data = mmrm_test_data, cor_struct = "unstructured", weights_emmeans = "equal", averages_emmeans = list( "VIS1+2" = c("VIS1", "VIS2") ) )
This specifies an MMRM with the FEV1
outcome and the RACE
and SEX
covariates for subjects identified by USUBJID
and treatment arm ARMCD
observed over time points identified by AVISIT
in the mmrm_test_data
data set. An unstructured covariance matrix is assumed. Note that only restricted maximum likelihood (REML) can be used. The least square means assume equal weights for factor combinations, and in addition to the single visit specific results an average across visits VIS1
and VIS2
will be computed.
For a more detailed introduction to all of the features of this package, look at the introduction vignette:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4