This package includes methods that allow mmrm
objects to be used
with the emmeans
package. emmeans
computes estimated marginal means
(also called least-square means) for the coefficients of the MMRM.
Examples
fit <- mmrm(
formula = FEV1 ~ RACE + SEX + ARMCD * AVISIT + us(AVISIT | USUBJID),
data = fev_data
)
if (require(emmeans)) {
emmeans(fit, ~ ARMCD | AVISIT)
}
#> Loading required package: emmeans
#> AVISIT = VIS1:
#> ARMCD emmean SE df lower.CL upper.CL
#> PBO 33.3 0.755 148 31.8 34.8
#> TRT 37.1 0.763 143 35.6 38.6
#>
#> AVISIT = VIS2:
#> ARMCD emmean SE df lower.CL upper.CL
#> PBO 38.2 0.612 147 37.0 39.4
#> TRT 41.9 0.602 143 40.7 43.1
#>
#> AVISIT = VIS3:
#> ARMCD emmean SE df lower.CL upper.CL
#> PBO 43.7 0.462 130 42.8 44.6
#> TRT 46.8 0.509 130 45.7 47.8
#>
#> AVISIT = VIS4:
#> ARMCD emmean SE df lower.CL upper.CL
#> PBO 48.4 1.189 134 46.0 50.7
#> TRT 52.8 1.188 133 50.4 55.1
#>
#> Results are averaged over the levels of: RACE, SEX
#> Confidence level used: 0.95