Skip to contents

Generates parameters from models estimated with hlme, lcmm, multlcmm, Jointlcmm or mpjlcmm functions. Parameters are randomly sampled from a Gaussian distribution using estimates and corresponding variances of a model.

Usage

sampleParameters(x, cholesky = FALSE)

Arguments

x

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

cholesky

optional logical indicating if cholesky parameters should be returned. Default to FALSE, the variance-covariance parameters of the random effects are returned.

Value

a named vector containing the sampled parameters.

Author

Viviane Philipps

Examples

m <- hlme(Y ~ Time * X1, random = ~ Time, subject = 'ID', data = data_hlme)

sampleParameters(m)
#>  intercept       Time         X1    Time:X1   varcov 1   varcov 2   varcov 3 
#> 24.8656602 -0.6286824  2.9315696 -0.1458861 24.3481687  3.7116515  1.3312429 
#>     stderr 
#> -0.9814923