Learn R Programming

LMest (version 3.1.2)

bootstrap_lm_cov_latent: Parametric bootstrap for LM models with individual covariates in the latent model

Description

Function that performs bootstrap parametric resampling to compute standard errors for the parameter estimates.

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

Usage

bootstrap_lm_cov_latent(X1, X2, param = "multilogit", Psi, Be, Ga, B = 100,
                        fort = TRUE)

Value

mPsi

average of bootstrap estimates of the conditional response probabilities

mBe

average of bootstrap estimates of the parameters affecting the logit for the initial probabilities

mGa

average of bootstrap estimates of the parameters affecting the logit for the transition probabilities

sePsi

standard errors for the conditional response probabilities

seBe

standard errors for the parameters in Be

seGa

standard errors for the parameters in Ga

Arguments

X1

matrix of covariates affecting the initial probabilities (n x nc1)

X2

array of covariates affecting the transition probabilities (n x TT-1 x nc2)

param

type of parametrization for the transition probabilities ("multilogit" = standard multinomial logit for every row of the transition matrix, "difflogit" = multinomial logit based on the difference between two sets of parameters)

Psi

array of conditional response probabilities (mb x k x r)

Be

parameters affecting the logit for the initial probabilities

Ga

parametes affecting the logit for the transition probabilities

B

number of bootstrap samples

fort

to use fortran routine when possible (FALSE for not use fortran)

Author

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

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

TT <- 8
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)

# matrix of responses (with ordered categories from 0 to 4)
S <- 5-res$YY

# matrix of covariates (for the first and the following occasions)
# colums are: gender,race,educational level (2 columns),age,age^2)
X1 <- res$XX[,1,]
X2 <- res$XX[,2:TT,]

# estimate the model
out1 <- est_lm_cov_latent(S, X1, X2, k = 2, output = TRUE, out_se = TRUE)

out2 <- bootstrap_lm_cov_latent(X1, X2, Psi = out1$Psi, Be = out1$Be, Ga = out1$Ga, B = 1000)
}

Run the code above in your browser using DataLab