View source: R/pool-residuals.R
lavResiduals.mi | R Documentation |
This function calculates residuals for sample moments (e.g., means and (co)variances, means) from a lavaan model fitted to multiple imputed data sets, along with summary and inferential statistics about the residuals.
## S4 method for signature 'lavaan.mi'
residuals(object, type = "raw", omit.imps = c("no.conv", "no.se"), ...)
## S4 method for signature 'lavaan.mi'
resid(object, type = "raw", omit.imps = c("no.conv", "no.se"), ...)
lavResiduals.mi(object, omit.imps = c("no.conv", "no.se"), ...)
object |
An object of class |
type |
|
omit.imps |
|
... |
Arguments passed to |
A list
of residuals and other information (see lavaan::lavResiduals()
).
The standard residuals()
(and resid()
alias) method simply calls
lavResiduals.mi(..., zstat=FALSE, summary=FALSE)
.
Terrence D. Jorgensen (University of Amsterdam; TJorgensen314@gmail.com)
lavaan::lavResiduals()
for details about other arguments.
data(HS20imps) # import a list of 20 imputed data sets
## specify CFA model from lavaan's ?cfa help page
HS.model <- '
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
'
## fit model to 20 imputed data sets
fit <- cfa.mi(HS.model, data = HS20imps)
## default type = "cor.bentler" (standardized covariance residuals)
lavResiduals.mi(fit, zstat = FALSE)
## SRMR is in the $summary
## correlation residuals
lavResiduals.mi(fit, zstat = FALSE, type = "cor")
## CRMR is in the $summary
## raw covariance residuals
lavResiduals.mi(fit, type = "raw") # zstat=TRUE by default
## RMR is in the $summary
## "normalized" residuals are in $cov.z
## The standard resid() and residuals() method simply call lavResiduals.mi()
## with arguments to display only the residuals ("raw" by default).
resid(fit)
residuals(fit, type = "cor.bollen") # same as type = "cor"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.