if (FALSE) {
data(data_SRHS_long)
dataSRHS <- data_SRHS_long
data_SRHS_long$srhs <- 5 - data_SRHS_long$srhs
est <- lmest(responsesFormula = srhs ~ NULL,
latentFormula = ~
I(gender - 1) +
I( 0 + (race == 2) + (race == 3)) +
I(0 + (education == 4)) +
I(0 + (education == 5)) +
I(age - 50) + I((age-50)^2/100),
index = c("id","t"),
data = data_SRHS_long,
k = 2,
paramLatent = "multilogit",
start = 0)
out <- drawLMlatent(est = est,format = "matrices",seed = 4321)
out1 <- drawLMlatent(Psi = est$Psi,Be = est$Be,Ga = est$Ga,
data = data_SRHS_long, index = c("id","t"),
latentFormula = ~
I(gender - 1) +
I( 0 + (race == 2) + (race == 3)) +
I(0 + (education == 4)) +
I(0 + (education == 5)) +
I(age - 50) + I((age-50)^2/100),
paramLatent = "multilogit", format = "matrice",
seed = 4321)
}
Run the code above in your browser using DataLab