Skip to contents

This function provides a plot summarizing the results of different models fitted by hlme, lcmm, multlcmm, Jointlcmm, mpjlcmm or externVar.

Usage

summaryplot(
  m1,
  ...,
  which = c("BIC", "entropy", "ICL"),
  mfrow = c(1, length(which)),
  xaxis = "G"
)

Arguments

m1

an object of class hlme, lcmm, multlcmm, Jointlcmm, mpjlcmm, externVar or externVar.

...

further arguments, in particular other objects of class hlme, lcmm, multlcmm, Jointlcmm or mpjlcmm, and graphical parameters.

which

character vector indicating which results should be plotted. Possible values are "loglik", "conv", "npm", "AIC", "BIC", "SABIC", "entropy", "ICL", "ICL1", "ICL2".

mfrow

for multiple plots, number of rows and columns to split the graphical device. Default to one line and length(which) columns.

xaxis

the abscissa of the plot. Default to "G", the number of latent classes.

Details

Can be reported the usual criteria used to assess the fit and the clustering of the data: - maximum log-likelihood L (the higher the better) - number of parameters P, number of classes G, convergence criterion (1 = converged) - AIC (the lower the better) computed as -2L+2P - BIC (the lower the better) computed as -2L+ P log(N) where N is the number of subjects - SABIC (the lower the better) computed as -2L+ P log((N+2)/24) - Entropy (the closer to one the better) computed as 1+sum[pi_ig*log(pi_ig)]/(N*log(G)) where pi_ig is the posterior probability that subject i belongs to class g - ICL (the lower the better) computed in two ways : ICL1 = BIC - sum[pi_ig*log(pi_ig)] or ICL2 = BIC - 2*sum(log(max(pi_ig)), where the max is taken over the classes for each subject. - %class computed as the proportion of each class based on c_ig

See also

Author

Sasha Cuau, Viviane Philipps, Cecile Proust-Lima

Examples

# \dontrun{
library(NormPsy)
paquid$normMMSE <- normMMSE(paquid$MMSE)
paquid$age65 <- (paquid$age - 65)/10
m1 <- hlme(normMMSE~age65+I(age65^2)+CEP, random=~age65+I(age65^2), subject='ID', data=paquid)
m2 <- hlme(normMMSE~age65+I(age65^2)+CEP, random=~age65+I(age65^2), subject='ID', data=paquid,
ng = 2, mixture=~age65+I(age65^2), B=m1)
m3g <- gridsearch(hlme(normMMSE~age65+I(age65^2)+CEP, random=~age65+I(age65^2), subject='ID',
data=paquid, ng=3, mixture=~age65+I(age65^2)), rep=100, maxiter=30, minit=m1)
#>  Numerical problem by computing fn 
#>           value of function is : NaN 
summaryplot(m1, m2, m3g, which=c("BIC","entropy","ICL"),bty="l",pch=20,col=2)

# }