likertHB: Dynamic fit index (DFI) cutoffs multi-factor CFA models with...

View source: R/likertHB.R

likertHBR Documentation

Dynamic fit index (DFI) cutoffs multi-factor CFA models with Likert-type items

Description

This function generates DFI cutoffs for multi-factor CFA models that treats Likert-type items as continuous. 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. A primary difference in likert DFI functions is that a dataset must also be provided in the 'data' argument in order to simulate data with the same number of response options and response frequencies as the original data. When Likert-type items are treated as continuous, this information cannot be obtained solely from model output.

The app-based version of this function can be found at dynamicfit.app.

Usage

likertHB(
  model,
  data,
  n = NULL,
  plot = FALSE,
  manual = FALSE,
  estimator = "ML",
  reps = 250
)

## S3 method for class 'likertHB'
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.

data

An empirical dataset used to determine the number of Likert responses and the response frequencies

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. This also includes plots to visualize how close the simulated data are to the original data.

manual

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

estimator

Which estimator to use within the simulations (enter in quotes). The default is ML

reps

The number of replications used in your simulation. This is set to 500 by default.

x

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

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

likertHB(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"

likertHB(model=manual_model,data=Example,n=500,manual=TRUE)


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