The formula
typically looks like:
FEV1 ~ RACE + SEX + ARMCD * AVISIT + us(AVISIT | USUBJID)
so specifies response and covariates as usual, and exactly one special term
defines which covariance structure is used and what are the time point and
subject variables. The covariance structures in the formula can be
found in covariance_types
.
The time points have to be unique for each subject. That is,
there cannot be time points with multiple observations for any subject.
The rationale is that these observations would need to be correlated, but it
is not possible within the currently implemented covariance structure framework
to do that correctly. Moreover, for non-spatial covariance structures, the time
variable must be a factor variable.
When optimizer is not set, first the default optimizer
(L-BFGS-B
) is used to fit the model. If that converges, this is returned.
If not, the other available optimizers from h_get_optimizers()
,
including BFGS
, CG
and nlminb
are
tried (in parallel if n_cores
is set and not on Windows).
If none of the optimizers converge, then the function fails. Otherwise
the best fit is returned.
Note that fine-grained control specifications can either be passed directly
to the mmrm
function, or via the control
argument for bundling together
with the mmrm_control()
function. Both cannot be used together, since
this would delete the arguments passed via mmrm
.