Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

VarExpl

Percentage of variance explained by the (latent class) linear mixed model regression


Description

The function provides the percentage of variance explained by the (latent class) linear mixed regression in a model estimated with hlme, lcmm, multlcmm or Jointlcmm.

Usage

VarExpl(x, values)

Arguments

x

an object of class hlme, lcmm, multlcmm or Jointlcmm

values

a data frame with a unique row that contains the values of the variables in random and the time variable in the correlation process from which the percentage of variance should be calculated.

Value

For hlme, lcmm, and Jointlcmm objects, the function returns a matrix with 1 row and ng (ie the number of latent classes) columns containing (the class specific) percentages of variance explained by the linear mixed regression.

For multlcmm objects, the function returns a matrix containing (the class specific) percentages of variance explained by the linear mixed regression for each outcome. The resulting matrix is composed of as many rows as outcomes and as many columns as latent classes.

Author(s)

Cecile Proust-Lima, Viviane Philipps

See Also

Examples

## Not run: 
m1 <- multlcmm(Ydep1+Ydep2~1+Time*X2+contrast(X2),random=~1+Time,
subject="ID",randomY=TRUE,link=c("4-manual-splines","3-manual-splines"),
intnodes=c(8,12,25),data=data_lcmm, 
B=c(-1.071, -0.192,  0.106, -0.005, -0.193,  1.012,  0.870,  0.881,
  0.000,  0.000, -7.520,  1.401,  1.607 , 1.908,  1.431,  1.082,
 -7.528,  1.135 , 1.454 , 2.328, 1.052))

# variation percentages explained by linear mixed regression
VarExpl(m1,data.frame(Time=0))

## End(Not run)

lcmm

Extended Mixed Models Using Latent Classes and Latent Processes

v1.9.2
GPL (>= 2.0)
Authors
Cecile Proust-Lima, Viviane Philipps, Amadou Diakite and Benoit Liquet
Initial release
2020-07-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.