catOne | R Documentation |
This function generates DFI cutoffs for one-factor CFA models that treat items as categorical.
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).
The app-based version of this function can be found at dynamicfit.app.
catOne(
model,
n = NULL,
plot = FALSE,
manual = FALSE,
reps = 250,
estimator = "WLSMV"
)
## S3 method for class 'catOne'
print(x, ...)
model |
This can either be a |
n |
If you entered a |
plot |
Displays distributions of fit indices for each level of misspecification. |
manual |
If you entered a |
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. |
estimator |
Which estimator to use within the simulations (enter in quotes). The default is WLSMV. Only limited-information estimators that produce fit indices are permitted (i.e., maximum likelihood is not available) |
x |
catOne 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)
#one-factor model
m1<-"F1=~X5+ X6 + X7 + X8 + X9"
#fit the model in lavaan, treating items are categorical
fit<-lavaan::cfa(m1, data=Example, ordered=TRUE)
catOne(fit)
#Manual entry example (manual=TRUE)
#one-factor model with correlated factors
m1<-"F1=~X5+ X6 + X7 + X8 + X9"
#fit the model, treating items are categorical
#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, ordered=TRUE)
lavaan::standardizedsolution(fit)
#thresholds go in model statement as
#(a)categorical item name
#(b) vertical pipe
#(c) estimate
#(d)times t+threshold number
manual_model <-"F1=~.550*X5 + .614*X6 + .726*X7 + .723*X8 + .236*X9
X5 |-0.274*t1
X5 | 0.305*t2
X5 | 0.765*t3
X5 | 1.259*t4
X6 |-0.279*t1
X6 | 0.353*t2
X6 | 0.779*t3
X6 | 1.175*t4
X7 |-0.269*t1
X7 | 0.385*t2
X7 | 0.871*t3
X7 | 1.329*t4
X8 |-0.274*t1
X8 | 0.358*t2
X8 | 0.779*t3
X8 | 1.237*t4
X9 |-0.269*t1
X9 | 0.342*t2
X9 | 0.745*t3
X9 | 1.248*t4"
catOne(model=manual_model,n=500,manual=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.