This function fits complex mixed effects model with a time and covariate dependent variance. We suppose that the variance of the residual error is time-dependent and subject-specific. Parameters are estimated simultaneously through a maximum likelihood method, using a Marquardt-Levenberg algorithm.
lsmm(
formFixed,
formRandom,
formGroup,
timeVar,
data.long,
variability_hetero = TRUE,
formFixedVar,
formRandomVar,
correlated_re = FALSE,
S1 = 1000,
S2 = 5000,
nproc = 1,
clustertype = "SOCK",
maxiter = 100,
print.info = FALSE,
file = NULL,
epsa = 0.001,
epsb = 0.001,
epsd = 0.001,
binit = NULL
)
A FlexVarJoint object which contains the following elements :
result
A marqLevAlg object with the results of the estimation.
table.res
The table of results : Estimation and SE
time.compute
Computation time
control
A list of control elements
A formula for the fixed effects of the longitudinal submodel
A formula for the random effects of the longitudinal submodel
A formula which indicates the group variable
The name of the column of time in data.long. This variable must appears in data.long
A dataframe with the longitudinal data
A logical to indicate if we suppose a subject_specific variability
A formula for the fixed effects of the variance predictor
A formula for the random effects of the variance predictor
A logical to indicate if the random effects of the marker and the variance predictors are correlated (By default there are supposed to be independent)
An integer : the number of QMC draws for the first step
An integer : the number of QMC draws for the second step
An integer : the number of processors for parallel computing
one of the supported types from makeCluster
function
optional maximum number of iterations for the marqLevAlg iterative algorithm.
logical indicating if the outputs of each iteration should be written
optional character giving the name of the file where the outputs of each iteration should be written (if print.info=TRUE)
optional threshold for the convergence criterion based on the parameter stability.
optional threshold for the convergence criterion based on the objective function stability.
optional threshold for the relative distance to maximum. This criterion has the nice interpretation of estimating the ratio of the approximation error over the statistical error, thus it can be used for stopping the iterative process whatever the problem.
optional initials parameters.
The model is defined by : #' \(\quad\left\{\begin{array}{ll} Y_{ij} = Y_{i}(t_{ij}) = \widetilde{Y}_i(t_{ij}) + \epsilon_{ij} = X_{ij}^{\top} \beta+Z_{ij}^{\top} b_{i}+\epsilon_{ij}, \\ \epsilon_{ij}(t_{ij}) \sim \mathcal{N}(0,\sigma_i^2(t_{ij})) \hspace{3mm} \text{with} \hspace{3mm} \log(\sigma_i(t_{ij})) = O_{ij}^{\top} \mu+M_{ij}^{\top} \tau_{i} \end{array} \right.\)
\(Y_{i}(t_{ij}) = \tilde{Y}_i(t_{ij}) + \epsilon_{ij} = X_{ij}^{\top} \beta+Z_{ij}^{\top} b_{i}+\epsilon_{ij}\)
with \(X_{ij}\) and \(Z_{ij}\) two covariate vectors for subject i at visit j, respectively associated with the vector of fixed effects \(\beta\) and the vector of subject-specific individual random effects \(b_i\). The vector \(b_i\) is assumed to be normally distributed and a specific-subject random effect on the variance of the measure error can be added: \(\epsilon_{ij} \sim \mathcal{N}(0,\sigma_i^2)\) and
\(\quad\left(\begin{array}{c} b_{i} \\ \log \sigma_{i} \end{array}\right) \sim \mathcal{N}\left(\left(\begin{array}{c} 0 \\ \mu_{\sigma} \end{array}\right),\left(\begin{array}{cc} \Sigma_{b} & 0 \\ 0 & \tau_{\sigma}^{2} \end{array}\right)\right)\)
# \donttest{
#fit a joint model with competing risks and subject-specific variability
example <- lsmm(formFixed = y~visit,
formRandom = ~ visit,
formGroup = ~ID,
timeVar = "visit",
data.long = Data_toy,
variability_hetero = TRUE,
formFixedVar =~visit,
formRandomVar =~visit,
correlated_re = TRUE,
S1 = 100,
S2 = 1000,
nproc = 1,
maxiter = 100
)
summary(example)
# }
Run the code above in your browser using DataLab