if (FALSE) {
### Plot of basic LM model
data("data_SRHS_long")
SRHS <- data_SRHS_long[1:2400,]
# Categories rescaled to vary from 0 (“poor”) to 4 (“excellent”)
SRHS$srhs <- 5 - SRHS$srhs
out <- lmest(responsesFormula = srhs ~ NULL,
index = c("id","t"),
data = SRHS,
k = 1:3,
start = 1,
modBasic = 1,
seed = 123)
out
summary(out)
plot(out)
### Plot of basic LM model for continuous responses
data(data_long_cont)
out1 <- lmestCont(responsesFormula = Y1 + Y2 + Y3 ~ NULL,
index = c("id", "time"),
data = data_long_cont,
k = 1:5,
modBasic=1,
tol=10^-5)
plot(out1,what="modSel")
plot(out1,what="density")
plot(out1,what="density",components=c(1,3))
}
Run the code above in your browser using DataLab