Type: | Package |
Title: | Measurement Model of Derivatives in 'OpenMx' |
Version: | 1.1.0 |
Description: | Provides a convenient interface in 'OpenMx' for building Estabrook's (2015) <doi:10.1037/a0034523> Measurement Model of Derivatives (MMOD). |
License: | Apache License 2.0 |
Encoding: | UTF-8 |
LazyData: | true |
Imports: | OpenMx |
Suggests: | knitr, rmarkdown, testthat, tidyverse |
VignetteBuilder: | knitr |
RoxygenNote: | 7.1.1 |
Depends: | R (≥ 2.10) |
NeedsCompilation: | no |
Packaged: | 2021-05-18 15:24:22 UTC; khusmann |
Author: | Kyle D. Husmann [aut, cre], Timothy R. Brick [aut], Ryne Estabrook [aut] |
Maintainer: | Kyle D. Husmann <kdh38@psu.edu> |
Repository: | CRAN |
Date/Publication: | 2021-05-18 15:40:02 UTC |
Generate GOLD contrasts
Description
Code from Deboeck (2010)
Usage
ContrastsGOLD(T, max)
Arguments
T |
timeseries |
max |
max derivatives |
Create an MMOD
Description
This function builds a Measurement Model of Derivatives (MMOD; Estabrook 2015) with a given factor structure.
Usage
mxMmodModel(
data,
modelName,
idvar,
timevar,
structure,
orthogonal = F,
embed_dim = NULL,
fiml = F
)
Arguments
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). |
Details
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'))
Value
an MMOD as an mxModel object
Examples
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)
NLSY97 Longitudinal Depression Scale Data
Description
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.
Usage
nlsy97depression
Format
A data frame with 26952 rows and 7 variables:
- pid
Unique ID of participant
- sex
Sex of participant
- birth_m
Birth Month
- birth_y
Birth Year
- occasion
Measurement occasion
- nervous
How often participant felt 'like a nervous person'
- calm
How often participant felt 'calm and peaceful'
- down
How often participant felt 'down or blue'
- happy
How often participant felt 'like a happy person'
- depressed
How often participant felt 'depressed'
Source
https://www.bls.gov/nls/nlsy97.htm
Generate Time Delay Embeddings
Description
Generate Time Delay Embeddings
Usage
time_delay_embed(data, idvar, timevar, n_embed)
Arguments
data |
a data frame with measurements in long format |
idvar |
name of column for subject IDs |
timevar |
name of column for measurement occasion |
n_embed |
embedding dimension |