catHB | R Documentation |
This function generates DFI cutoffs for multi-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.
catHB(
model,
n = NULL,
plot = FALSE,
manual = FALSE,
reps = 250,
estimator = "WLSMV"
)
## S3 method for class 'catHB'
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 |
catHB 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=~X1 + X2 +X3
F2=~X6 + X7 + X8 + X9
F1~~F2"
#fit the model in lavaan, treating items are categorical
fit<-lavaan::cfa(m1, data=Example, ordered=TRUE)
catHB(fit)
#Manual entry example (manual=TRUE)
#two-factor model with correlated factors
m1<-"
F1=~X1 + X2 +X3
F2=~X6 + X7 + X8 + X12
F1~~F2"
#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=~.448*X1 + .557*X2 + .770*X3
F2=~.612*X6 + .684*X7 + .736*X8 + .365*X12
F1~~.424*F2
X1 |-0.285*t1
X1 | 0.337*t2
X1 | 0.793*t3
X1 | 1.305*t4
X2 |-0.243*t1
X2 | 0.369*t2
X2 | 0.849*t3
X2 | 1.227*t4
X3 |-0.285*t1
X3 | 0.353*t2
X3 | 0.827*t3
X3 | 1.379*t4
X6 |-0.279*t1
X6 | 0.353*t2
X6 | 0.827*t3
X6 | 1.379*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
X12 |-0.248*t1
X12 | 0.440*t2
X12 | 0.900*t3
X12 | 1.392*t4"
catHB(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.