| fit_single_optimizer {mmrm} | R Documentation |
Fitting an MMRM with Single Optimizer
Description
This function helps to fit an MMRM using TMB with a single optimizer,
while capturing messages and warnings.
Usage
fit_single_optimizer(
formula,
data,
weights,
reml = TRUE,
covariance = NULL,
tmb_data,
formula_parts,
...,
control = mmrm_control(...)
)
Arguments
formula |
( |
data |
( |
weights |
( |
reml |
( |
covariance |
( |
tmb_data |
( |
formula_parts |
( |
... |
Additional arguments to pass to |
control |
( |
Details
fit_single_optimizer will fit the mmrm model using the control provided.
If there are multiple optimizers provided in control, only the first optimizer
will be used.
If tmb_data and formula_parts are both provided, formula, data, weights,
reml, and covariance are ignored.
Value
The mmrm_fit object, with additional attributes containing warnings,
messages, optimizer used and convergence status in addition to the
mmrm_tmb contents.
Examples
mod_fit <- fit_single_optimizer(
formula = FEV1 ~ RACE + SEX + ARMCD * AVISIT + us(AVISIT | USUBJID),
data = fev_data,
weights = rep(1, nrow(fev_data)),
optimizer = "nlminb"
)
attr(mod_fit, "converged")