Learn R Programming

LMest (version 2.4.5)

LMest-package: Fit latent Markov models

Description

Set of functions to fit latent Markov models in the basic version and in the extended version with individual covariates.

Arguments

Details

Package: LMest
Type: Package
Version: 2.4.5
Date: 2019-04-06
License: Unlimited

The most important functions are est_lm_basic, est_lm_cov_manifest, and est_lm_cov_latent which estimate the basic LM model and its extensions including covariates

References

Bartolucci, F., Farcomeni, A. and Pennoni, F. (2013), Latent Markov Models for Longitudinal Data, Chapman and Hall/CRC press.

Bartolucci, F., Pandolfi, S. and Pennoni, F. (2017), LMest: An R Package for Latent Markov Models for Longitudinal Categorical Data, Journal of Statistical Software, 81, 1-38, doi:10.18637/jss.v081.i04.

Examples

Run this code
# NOT RUN {
# Example of drug consumption data
# load data
data(data_drug)
data_drug = as.matrix(data_drug)
S = data_drug[,1:5]-1
yv = data_drug[,6]
n = sum(yv)
# fit of the Basic LM model
k = 3
out1 = est_lm_basic(S,yv,k,mod=1,out_se=TRUE)
# }
# NOT RUN {
out2 = bootstrap_lm_basic(out1$piv,out1$Pi,out1$Psi,n,mod=1,B=1000)
# }

Run the code above in your browser using DataLab