DDDFI | R Documentation |
This function generates DFI cutoffs for any single group covariance structure model with
a saturated or absent mean structure. It supports (a) any estimator supported by lavaan (e.g.
ML, MLR, WLSMV, ULSMV), (b) missing data, and (c) multiple response scales (normal, non-normal continuous,
categorical). The default argument is a singular argument: a lavaan
object.The function
can also accommodate manual entry of the model statement and sample size. Some features require an original
dataset to be provided (e.g., missing data, categorical data). The app-based version of
this function can be found at dynamicfit.app.
DDDFI(
model,
data = NULL,
scale = "normal",
manual = FALSE,
reps = 250,
n = NULL,
estimator = NULL,
MAD = c(0.038, 0.05, 0.06),
plot.dfi = FALSE,
plot.dist = FALSE,
plot.discrepancy = FALSE
)
## S3 method for class 'DDDFI'
print(x, ...)
model |
This can either be a |
data |
The original data to which the model was applied. Not required if scale="normal". Otherwise, data is required. |
scale |
Determines how data are simulated. Options are "normal", "nonnormal", or "categorical". "normal" assumes multivariate normality across all variables. "nonnormal" recreates distributions in an empirical dataset (to be provided by the user), assuming variables are continuous. "categorical" simulates discrete data with the same proportions as an empirical dataset (to be provided by the user). With "categorical", mixed formats are also supported and any variable with more than 9 categories is simulated from a normal distribution.Only "normal" can be used without provided an original dataset. |
manual |
If you entered a |
reps |
The number of replications used in the simulations. This is set to 250 by default |
n |
If you entered a |
estimator |
Which estimator to use within the simulations (enter in quotes). The default depends on the scale option ("ML" for "normal", "MLR" for "nonnormal", and "WLSMV" for categorical) |
MAD |
Mean Absolute Discrepancies to test in the simulation. Default is c(.038, .05, .06) to recreate traditional "Close", "Fair", "Mediocre" benchmarks |
plot.dfi |
Displays simulated distributions of fit indices used to derive cutoffs for each MAD value. |
plot.dist |
Displays distributions of simulated data (and empirical data, if provided) to assess fidelity of simulated data to empirical data |
plot.discrepancy |
Displays distributions of simulated MAD values |
x |
DDDFI object |
... |
other print parameters |
Direct Discrepancy Dynamic fit index (DFI) cutoffs for CFI, RMSEA, and RMSEA 90
Daniel McNeish & Melissa G Wolf
Maintainer: Daniel McNeish <dmcneish@asu.edu>
#Example using a lavaan object as input (manual=FALSE)
lavmod <- "F1 =~ x1 + x2 + x3
F2 =~ x4 + x5 + x6
F3 =~ x7 + x8 + x9"
fit <- lavaan::cfa(lavmod,data=Holzinger)
DDDFI(fit)
#Manual entry example (manual=TRUE)
#Holzinger 3-factor model
lavmod <- "F1 =~ x1 + x2 + x3
F2 =~ x4 + x5 + x6
F3 =~ x7 + x8 + x9"
#fit the model,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(lavmod, data=Holzinger)
lavaan::standardizedsolution(fit)
#model statement with standardized estimates
manual_model <- "F1 =~ .772*x1 + .424*x2 + .581*x3
F2 =~ .852*x4 + .855*x5 + .838*x6
F3 =~ .570*x7 + .723*x8 + .665*x9
F1~~.459*F2
F1~~.471*F3
F2~~.283*F3"
DDDFI(model=manual_model,n=301,manual=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.