catOne: Dynamic fit index (DFI) cutoffs for categorical one-factor...

View source: R/catOne.R

catOneR Documentation

Dynamic fit index (DFI) cutoffs for categorical one-factor CFA models

Description

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.

Usage

catOne(
  model,
  n = NULL,
  plot = FALSE,
  manual = FALSE,
  reps = 250,
  estimator = "WLSMV"
)

## S3 method for class 'catOne'
print(x, ...)

Arguments

model

This can either be a lavaan object from the cfa function, OR a model statement written in lavaan model.syntax with standardized loadings and thresholds.

n

If you entered a lavaan object for model, leave this blank. Otherwise, enter your sample size (numeric).

plot

Displays distributions of fit indices for each level of misspecification.

manual

If you entered a lavaan object, keep this set to FALSE. If you manually entered standardized loadings and sample size, set this to TRUE.

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

Value

Dynamic fit index (DFI) cutoffs for SRMR, RMSEA, and CFI.

Author(s)

Daniel McNeish & Melissa G Wolf

Maintainer: Daniel McNeish <dmcneish@asu.edu>

Examples

#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)


melissagwolf/dynamic documentation built on June 29, 2024, 6:24 p.m.