hlme(fixed, mixture, random, subject, classmb, ng = 1, idiag = FALSE,
nwg = FALSE, data, B, convB, convL, convG, prior,Maxiter)
~
and the covariates are separated by +
on the right of the ~
.
By default, an intercept is infixed
, the covariates with class-specific reg+
.
By default, an intercept is included. If no intercept, -1
should be the first term included.+
.
No intercept should be included in this formula.ng=1
no mixture
nor classmb
should be specified. If ng>1
, mixture
is required.FALSE
, a non structured matrix of variance-covariance is considered (by default).
If TRUE
a diagonal matrix of variance-covariance is considered.FALSE
the variance-covariance matrix is common over latent classes (by default).
If TRUE
a class-specific proportional parameter multiplies the varfixed
, mixture
, random
, classmb
and subject
.details
section.
If no vector is specified, a preliminary analysis involving the estimation of a standard lineB
and detailed in section details
Best
with exception for variance-covariance parameters of the random-effects for which V
contains the variance-covariance estimates of the Cholesky transformed parameters displayed in cholesky
plot.predict.hlme
B
or in the vector of maximum likelihood estimates best
are included in the following order:
(1) ng-1 parameters are required for intercepts in the latent class membership model, and if covariates are included in classmb
, ng-1 paramaters should be entered for each one;
(2) for all covariates in fixed
, one parameter is required if the covariate is not in mixture
, ng paramaters are required if the covariate is also in mixture
;
(3) the variance of each random-effect specified in random
(including the intercept)
if idiag=TRUE
and the inferior triangular variance-covariance matrix of all the random-effects if idiag=FALSE
;
(4) only if nwg=TRUE
, ng-1 parameters for class-specific proportional coefficients
for the variance covariance matrix of the random-effects;
(5) the variance of the residual error. Some caution should be made when using the program:
(1) As the log-likelihood of a latent class model can have multiple maxima, a careful choice of the initial values is crucial for ensuring convergence toward the global maximum.
The program can be run without entering the vector of initial values (see point 2).
However, we recommend to systematically enter initial values in B
and try different sets of initial values.
(2) The automatic choice of initial values we provide requires the estimation of a preliminary linear mixed model. The user should be aware that first, this preliminary analysis can take time for large datatsets and second,
that the generated initial values can be very not likely and even may converge slowly to a local maximum.
This is a reason why specification of initial values in B
should be preferred.
(4) Convergence criteria are very strict as they are based on derivatives of the log-likelihood in addition to the parameter and log-likelihood stability. In some cases, the program may not converge and reach the maximum number of iterations fixed at 70. In this case, the user should check that parameter estimates at the last iteration are not on the boundaries of the parameter space. If the parameters are on the boundaries of the parameter space, the identifiability of the model should be assessed. If not, the program should be run again with other initial values.
Muthen B and Shedden K (1999). Finite mixture modeling with mixture outcomes using the EM algorithm. Biometrics 55, 463-9
Proust C and Jacqmin-Gadda H (2005). Estimation of linear mixed models with a mixture of distribution for the random-effects. Computer Methods Programs Biomedicine 78, 165-73
postprob.hlme
,plot.postprob.hlme
,summary.hlme
,plot.predict.hlme
data(data_hlme)
### homogeneous linear mixed model (standard linear mixed model)
### with independent random-effects
m1<-hlme(Y~Time+X1+X1_time,random=~Time,subject=ID,ng=1,idiag=TRUE,data=data_hlme)
m1
### latent class linear mixed model with 2 classes
m2<-hlme(Y~Time+X1+X1_time,mixture=~Time,random=~Time,classmb=~X2+X3,subject=ID,ng=2,data=data_hlme)
m2
### same model as m2 with the vector if initial values specified
m3<-hlme(Y~Time+X1+X1_time,mixture=~Time,random=~Time,classmb=~X2+X3,subject=ID,ng=2,data=data_hlme,B=c(0,0,0,30,25,0,-1,0,0,5,0,1,1))
m3
Run the code above in your browser using DataLab