View source: R/lst_models_es.R
lst_models_es | R Documentation |
This function can be used to estimate various latent state-trait models (LST models) for experience sampling data. It is based on the revised version of the LST theory presented in Steyer, Mayer, Geiser & Cole (2015) and on Eid et al. (2017). The function is a wrapper for lst_models_es_common_trait() and lst_models_es_indicator_specific_trait().
lst_models_es(
traitmodel,
ntimepoints,
data,
nperiods = 1,
equiv = "invar",
ar = TRUE,
manifest_thetacovariates = NULL,
...
)
traitmodel |
character. Can be one of c("singletrait", "day-specific", "indicator-specific", "day-and-indicator-specific") |
ntimepoints |
integer. Number of measurement occasions |
data |
a data.frame. This data frame contains the observed variables, sorted by time t and then by indicator i, i.e., Y11, Y21, Y31, ... Y12, Y22, Y32 ... Y15, Y25, Y35 ... etc. |
nperiods |
integer. Number of periods (trait periods, zeta periods, and epsilon periods). |
equiv |
character. Equivalence assumption. Can be one of c("invar", "period.invar", "free") |
ar |
logical. Should autoregressive effects be included |
manifest_thetacovariates |
an optional vector with variable names of manifest covariates which further explain the latent traits. Must be assessed at a single occasion. |
... |
further arguments passed to lower level functions |
object of class lstmodel
m1 <- lst_models_es(traitmodel="singletrait", ntimepoints=9,
data=d_lst_es, nperiods=3, ar=FALSE, equiv="invar")
print(m1)
m2 <- lst_models_es(traitmodel="indicator-specific", ntimepoints=9,
data=d_lst_es, nperiods=3, ar=FALSE, equiv="invar")
print(m2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.