nnorHB: Dynamic fit index (DFI) cutoffs for continuous, non-normal...

View source: R/nnorHB.R

nnorHBR Documentation

Dynamic fit index (DFI) cutoffs for continuous, non-normal multi-factor CFA models with (possible) missing data

Description

This function generates DFI cutoffs for multi-factor CFA models that treats items as continuous and non-normal with possible missing data. This functions uses a modified Bollen-Stine bootstrap to accommodate non-normality and missingness rather than simulating from a particular distribution. 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). A primary difference in nnor DFI functions is that a dataset from which to bootstrap must also be provided in the 'data' argument.

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

Usage

nnorHB(
  model,
  data,
  n = NULL,
  plot = FALSE,
  manual = FALSE,
  estimator = "MLR",
  reps = 500
)

## S3 method for class 'nnorHB'
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 to which a modified Bollen-Stine bootstrap will be applied to create hypothetical misspecified data

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 distributions of the hypothetical data come to the original data.

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.

estimator

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

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.

x

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

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

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


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