lst_models_es: Estimate latent state-trait models for experience sampling...

View source: R/lst_models_es.R

lst_models_esR Documentation

Estimate latent state-trait models for experience sampling data

Description

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().

Usage

lst_models_es(
  traitmodel,
  ntimepoints,
  data,
  nperiods = 1,
  equiv = "invar",
  ar = TRUE,
  manifest_thetacovariates = NULL,
  ...
)

Arguments

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

addsyntax

character string. Will be added to generated lavaan syntax.

Value

object of class lstmodel

Examples

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)

amayer2010/lsttheory documentation built on Nov. 3, 2023, 1:30 a.m.