Learn R Programming

LMest (version 3.1.2)

est_lm_cov_manifest: Estimate LM model with covariates in the measurement model

Description

Main function for estimating LM model with covariates in the measurement model based on a global logit parameterization.

The function is no longer maintained. Please look at lmest function.

Usage

est_lm_cov_manifest(S, X, yv = rep(1,nrow(S)), k, q = NULL, mod = c("LM", "FM"),
                    tol = 10^-8, maxit = 1000, start = 0, mu = NULL, al = NULL,
                    be = NULL, si = NULL, rho = NULL, la = NULL, PI = NULL,
                    output = FALSE, out_se = FALSE)

Value

mu

vector of cutpoints

al

support points for the latent states

be

estimate of the vector of regression parameters

si

sigma of the AR(1) process (mod = "FM")

rho

parameter vector for AR(1) process (mod = "FM")

la

vector of initial probabilities

PI

transition matrix

lk

maximum log-likelihood

np

number of parameters

aic

value of AIC index

bic

value of BIC index

PRED0

prediction of latent state

PRED1

prediction of the overall latent effect

sebe

standard errors for the regression parameters be

selrho

standard errors for logit type transformation of rho

J1

information matrix

call

command used to call the function

Arguments

S

array of available configurations (n x TT) with categories starting from 0

X

array (n x TT x nc) of covariates with eventually includes lagged response (nc = number of covariates)

yv

vector of frequencies of the available configurations

k

number of latent states

q

number of support points for the AR(1) process

mod

model ("LM" = Latent Markov with stationary transition, "FM" = finite mixture)

tol

tolerance for the convergence (optional) and tolerance of conditional probability if tol>1 then return

maxit

maximum number of iterations of the algorithm

start

type of starting values (0 = deterministic, 1 = random, 2 = initial values in input)

mu

starting value for mu (optional)

al

starting value for al (optional)

be

starting value for be (optional)

si

starting value for si when mod="FM" (optional)

rho

starting value for rho when mod="FM" (optional)

la

starting value for la (optional)

PI

starting value for PI (optional)

output

to return additional output (PRED0, PRED1)

out_se

TRUE for computing information matrix and standard errors

Author

Francesco Bartolucci, Silvia Pandolfi - University of Perugia (IT)

References

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

Bartolucci, F., Bacci, S. and Pennoni, F. (2014) Longitudinal analysis of the self-reported health status by mixture latent autoregressive models, Journal of the Royal Statistical Society - series C, 63, pp. 267-288

Examples

Run this code

if (FALSE) {
# Example based on self-rated health status (SRHS) data

# load SRHS data
data(data_SRHS_long)
dataSRHS <- data_SRHS_long
head(dataSRHS)

res <- long2matrices(dataSRHS$id, X = cbind(dataSRHS$gender-1,
 dataSRHS$race == 2 | dataSRHS$race == 3, dataSRHS$education == 4,
dataSRHS$education == 5, dataSRHS$age-50, (dataSRHS$age-50)^2/100),
Y = dataSRHS$srhs)

X <- res$XX
S <- 5-res$YY

# *** fit stationary LM model
res0 <- vector("list", 10)
tol <- 10^-6;
for(k in 1:10){
  res0[[k]] <- est_lm_cov_manifest(S, X, k, 1, mod = "LM", tol)
   save.image("example_SRHS.RData")
}

# *** fit the mixture latent auto-regressive model
tol <- 0.005
res <- vector("list",4)
k <- 1
q <- 51
res[[k]] <- est_lm_cov_manifest(S, X, k, q, mod = "FM", tol, output = TRUE)
for(k in 2:4) res[[k]] <- est_lm_cov_manifest(S, X, k, q = 61, mod = "FM", tol, output = TRUE)
}

Run the code above in your browser using DataLab