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 
#> 25.82690609 -0.29555556 -0.06897195 -0.56256826 25.54663250  3.66723857 
#>    varcov 3      stderr 
#>  1.05475121 -0.99729910