Title: | Measurement Model of Derivatives in 'OpenMx' |
---|---|
Description: | Provides a convenient interface in 'OpenMx' for building Estabrook's (2015) <doi:10.1037/a0034523> Measurement Model of Derivatives (MMOD). |
Authors: | Kyle D. Husmann [aut, cre], Timothy R. Brick [aut], Ryne Estabrook [aut] |
Maintainer: | Kyle D. Husmann <[email protected]> |
License: | Apache License 2.0 |
Version: | 1.1.0 |
Built: | 2024-10-31 04:21:02 UTC |
Source: | https://github.com/khusmann/mxmmod |
This function builds a Measurement Model of Derivatives (MMOD; Estabrook 2015) with a given factor structure.
mxMmodModel( data, modelName, idvar, timevar, structure, orthogonal = F, embed_dim = NULL, fiml = F )
mxMmodModel( data, modelName, idvar, timevar, structure, orthogonal = F, embed_dim = NULL, fiml = F )
data |
a data frame with measurements in long format |
modelName |
name for the resulting model |
idvar |
name of column for subject IDs |
timevar |
name of column for measurement occasion |
structure |
factor structure, see 'Details' |
orthogonal |
if true, fix correlations between factors to 0 (A factor and its derivatives will still intercorrelate) |
embed_dim |
time delay embedding dimension |
fiml |
if true, use raw data to fit model with FIML. Otherwise, fit using cov matrix (dropping missing values if necessary). |
The structure
argument is a list of latent factors and their mappings to manifest
variables. For example, a one factor structure would be:
list(F1 = c('m1', 'm2', 'm3', 'm4', 'm5', 'm6'))
And a two factor structure would be:
list(F1 = c('m1', 'm2', 'm3'), F2 = c('m4', 'm5', 'm6'))
an MMOD as an mxModel object
data(nlsy97depression) # Fit one factor MMOD structure <- list( F1 = c('nervous', 'down', 'depressed', 'calm', 'happy') ) mmod_model <- mxMmodModel(data=nlsy97depression, modelName='1 Factor MMOD', idvar='pid', timevar='occasion', structure=structure) mmod_fit <- OpenMx::mxRun(mmod_model) summary(mmod_fit)
data(nlsy97depression) # Fit one factor MMOD structure <- list( F1 = c('nervous', 'down', 'depressed', 'calm', 'happy') ) mmod_model <- mxMmodModel(data=nlsy97depression, modelName='1 Factor MMOD', idvar='pid', timevar='occasion', structure=structure) mmod_fit <- OpenMx::mxRun(mmod_model) summary(mmod_fit)
A 5-item depression scale used on the National Longitudinal Survey of Youth, 1997 sample (NLSY97). Individuals were assessed in 2000, 2002, and 2004. All items are assessed on a 4-point likert scale.
nlsy97depression
nlsy97depression
A data frame with 26952 rows and 7 variables:
Unique ID of participant
Sex of participant
Birth Month
Birth Year
Measurement occasion
How often participant felt 'like a nervous person'
How often participant felt 'calm and peaceful'
How often participant felt 'down or blue'
How often participant felt 'like a happy person'
How often participant felt 'depressed'
https://www.bls.gov/nls/nlsy97.htm