mmrm_control {mmrm} | R Documentation |
Control Parameters for Fitting an MMRM
Description
Fine-grained specification of the MMRM fit details is possible using this control function.
Usage
mmrm_control(
n_cores = 1L,
method = c("Satterthwaite", "Kenward-Roger", "Residual", "Between-Within"),
vcov = NULL,
start = std_start,
accept_singular = TRUE,
drop_visit_levels = TRUE,
...,
optimizers = h_get_optimizers(...)
)
Arguments
n_cores |
( |
method |
( |
vcov |
( |
start |
( |
accept_singular |
( |
drop_visit_levels |
( |
... |
additional arguments passed to |
optimizers |
( |
Details
For example, if the data only has observations at visits VIS1
, VIS3
and VIS4
, by default
they are treated to be equally spaced, the distance from VIS1
to VIS3
, and from VIS3
to VIS4
,
are identical. However, you can manually convert this visit into a factor, with
levels = c("VIS1", "VIS2", "VIS3", "VIS4")
, and also use drop_visits_levels = FALSE
,
then the distance from VIS1
to VIS3
will be double, as VIS2
is a valid visit.
However, please be cautious because this can lead to convergence failure
when using an unstructured covariance matrix and there are no observations
at the missing visits.
The
method
andvcov
arguments specify the degrees of freedom and coefficients covariance matrix adjustment methods, respectively.Allowed
vcov
includes: "Asymptotic", "Kenward-Roger", "Kenward-Roger-Linear", "Empirical" (CR0), "Empirical-Jackknife" (CR3), and "Empirical-Bias-Reduced" (CR2).Allowed
method
includes: "Satterthwaite", "Kenward-Roger", "Between-Within" and "Residual".If
method
is "Kenward-Roger" then only "Kenward-Roger" or "Kenward-Roger-Linear" are allowed forvcov
.
The
vcov
argument can beNULL
to use the default covariance method depending on themethod
used for degrees of freedom, see the following table:method
Default vcov
Satterthwaite Asymptotic Kenward-Roger Kenward-Roger Residual Empirical Between-Within Asymptotic Please note that "Kenward-Roger" for "Unstructured" covariance gives different results compared to SAS; Use "Kenward-Roger-Linear" for
vcov
instead for better matching of the SAS results.The argument
start
is used to facilitate the choice of initial values for fitting the model. Iffunction
is provided, make sure its parameter is a valid element ofmmrm_tmb_data
ormmrm_tmb_formula_parts
and it returns a numeric vector. By default or ifNULL
is provided,std_start
will be used. Other implemented methods includeemp_start
.
Value
List of class mmrm_control
with the control parameters.
Examples
mmrm_control(
optimizer_fun = stats::optim,
optimizer_args = list(method = "L-BFGS-B")
)