R: Percentage of variance explained by the (latent class) linear...
VarExpl
R Documentation
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
## S3 method for class 'hlme'
VarExpl(x,values)
## S3 method for class 'lcmm'
VarExpl(x,values)
## S3 method for class 'Jointlcmm'
VarExpl(x,values)
## S3 method for class 'multlcmm'
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.