library("dplyr")
# Smoke data cov matrix, based on LISS data panel https://www.dataarchive.lissdata.nl
smoke <- structure(c(47.2361758611759, 43.5366809116809, 41.0057465682466,
43.5366809116809, 57.9789886039886, 47.6992521367521,
41.0057465682466,
47.6992521367521, 53.0669434731935), .Dim = c(3L, 3L),
.Dimnames = list(
c("smoke2008", "smoke2009", "smoke2010"), c("smoke2008",
"smoke2009", "smoke2010")))
# Design matrix:
design <- matrix(rownames(smoke),1,3)
# Form model:
mod <- latentgrowth(vars = design,
covs = smoke, nobs = 352
)
if (FALSE) {
# Run model:
mod <- mod %>% runmodel
# Evaluate fit:
mod %>% fit
# Look at parameters:
mod %>% parameters
}
Run the code above in your browser using DataLab