fit_mmrm {mmrm} | R Documentation |
Low-Level Fitting Function for MMRM
Description
This is the low-level function to fit an MMRM. Note that this does not
try different optimizers or adds Jacobian information etc. in contrast to
mmrm()
.
Usage
fit_mmrm(
formula,
data,
weights,
reml = TRUE,
covariance = NULL,
tmb_data,
formula_parts,
control = mmrm_control()
)
Arguments
formula |
( |
data |
( |
weights |
( |
reml |
( |
covariance |
( |
tmb_data |
( |
formula_parts |
( |
control |
( |
Details
The formula
typically looks like:
FEV1 ~ RACE + SEX + ARMCD * AVISIT + us(AVISIT | USUBJID)
which specifies response and covariates as usual, and exactly one special term defines which covariance structure is used and what are the visit and subject variables.
Always use only the first optimizer if multiple optimizers are provided.
Value
List of class mmrm_tmb
, see h_mmrm_tmb_fit()
for details.
In addition, it contains elements call
and optimizer
.
Examples
formula <- FEV1 ~ RACE + SEX + ARMCD * AVISIT + us(AVISIT | USUBJID)
data <- fev_data
system.time(result <- fit_mmrm(formula, data, rep(1, nrow(fev_data))))