na.satcor | R Documentation |
This function estimates a confirmatory factor analysis model (cfa.satcor
function), structural equation model (sem.satcor
function), growth curve
model (growth.satcor
function), or latent variable model (lavaan.satcor
function) in the R package lavaan using full information maximum likelihood
(FIML) method to handle missing data while automatically specifying a saturated
correlates model to incorporate auxiliary variables into a substantive model
without affecting the parameter estimates, the standard errors, or the estimates
of quality of fit (Graham, 2003).
na.satcor(model, data, aux, fun = c("cfa", "sem", "growth", "lavaan"),
check = TRUE, ...)
cfa.satcor(model, data, aux, check = TRUE, ...)
sem.satcor(model, data, aux, check = TRUE, ...)
growth.satcor(model, data, aux, check = TRUE, ...)
lavaan.satcor(model, data, aux, check = TRUE, ...)
model |
a character string indicating the lavaan model syntax without the
auxiliary variables specified in |
data |
a data frame containing the observed variables used in the lavaan
model syntax specified in |
aux |
a character vector indicating the names of the auxiliary variables
in the data frame specified in |
fun |
a character string indicating the name of a specific lavaan function
used to fit |
check |
logical: if |
... |
additional arguments passed to the lavaan function. |
An object of class lavaan, for which several methods are available in the R package lavaan, including a summary method.
This function is a modified copy of the auxiliary()
, cfa.auxiliary()
,
sem.auxiliary()
, growth.auxiliary()
, and lavaan.auxiliary()
functions in the semTools package by Terrence D. Jorgensen et al.
(2022).
Takuya Yanagida
Graham, J. W. (2003). Adding missing-data-relevant variables to FIML-based structural equation models. Structural Equation Modeling, 10(1), 80-100. https://doi.org/10.1207/S15328007SEM1001_4
Jorgensen, T. D., Pornprasertmanit, S., Schoemann, A. M., & Rosseel, Y. (2022). semTools: Useful tools for structural equation modeling. R package version 0.5-6. Retrieved from https://CRAN.R-project.org/package=semTools
## Not run:
# Load lavaan package
library(lavaan)
#----------------------------------------------------------------------------
# Example 1: Saturated correlates model for the sem function
# Model specification
model <- 'Ozone ~ Wind'
# Model estimation using the sem.satcor function
mod.fit <- sem.satcor(model, data = airquality, aux = c("Temp", "Month"))
# Model estimation using the na.satcor function
mod.fit <- na.satcor(model, data = airquality, fun = "sem", aux = c("Temp", "Month"),
estimator = "MLR")
# Result summary
summary(mod.fit)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.