nnorHB | R Documentation |
This function generates DFI cutoffs for multi-factor CFA models that treats items as continuous and non-normal with
possible missing data. This functions uses a modified Bollen-Stine bootstrap to accommodate non-normality and missingness rather
than simulating from a particular distribution. The default argument is a singular argument: a lavaan
object from
the cfa
function. The function can also accommodate manual entry of the model statement and
sample size (including threshold estimates). A primary difference in nnor DFI functions is that a dataset from which to bootstrap
must also be provided in the 'data' argument.
The app-based version of this function can be found at dynamicfit.app.
nnorHB(
model,
data,
n = NULL,
plot = FALSE,
manual = FALSE,
estimator = "MLR",
reps = 500
)
## S3 method for class 'nnorHB'
print(x, ...)
model |
This can either be a |
data |
An empirical dataset to which a modified Bollen-Stine bootstrap will be applied to create hypothetical misspecified data |
n |
If you entered a |
plot |
Displays distributions of fit indices for each level of misspecification.This also includes plots to visualize how close the distributions of the hypothetical data come to the original data. |
manual |
If you entered a |
estimator |
Which estimator to use within the simulations (enter in quotes). The default is MLR |
reps |
The number of replications used in your simulation. This is set to 500 by default in both the R package and the corresponding Shiny App. |
x |
nnorHB object |
... |
other print parameters |
Dynamic fit index (DFI) cutoffs for SRMR, RMSEA, and CFI.
Daniel McNeish & Melissa G Wolf
Maintainer: Daniel McNeish <dmcneish@asu.edu>
#Example using a lavaan object as input (manual=FALSE)
#two-factor model with correlated factors
m1<-"
F1=~X2 + X3 + X4
F2=~X6 + X7 + X8
F1~~F2"
#fit the model in lavaan, treating items are continuous
fit<-lavaan::cfa(m1, data=Example)
nnorHB(fit, data=Example)
#Manual entry example (manual=TRUE)
#two-factor model with correlated factors
m1<-"
F1=~X2 + X3 + X4
F2=~X6 + X7 + X8
F1~~F2"
#fit the model, treating items are continuous
#lavaan is used here to shown where estimates come frOm
#but manual entry supports standardized estimates from models fit in any software
fit<-lavaan::cfa(m1, data=Example)
lavaan::standardizedsolution(fit)
manual_model <-"F1=~.554*X2 + .654*X3 + .733*X4
F2=~.537*X6 + .666*X7 + .723*X8
F1~~.339*F2"
nnorHB(model=manual_model,data=Example,n=500,manual=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.