fitinfluence: Case influence on model fit.

fitinfluenceR Documentation

Case influence on model fit.

Description

This function evaluate the case's effect on a user-defined fit index.

Usage

fitinfluence(index, model, data, ...)

Arguments

index

A model fit index.

model

A description of the user-specified model using the lavaan model syntax. See lavaan for more information.

data

A data frame containing the observed variables used in the model. If any variables are declared as ordered factors, this function will treat them as ordinal variables.

...

Additional parameters for sem function.

Details

For each case evaluate the influence on one or more fit indices: the difference between the chosen fit index calculated for the SEM target model M and the same index computed for the SEM model M_{(i)} excluding case i.

Value

Returns a list:

Dind

a data.frame of case influence.

Oind

observed fit indices.

Note

If for observation i model does not converge or yelds a solution with negative estimated variances, the associated value of influence is set to NA.

Author(s)

Massimiliano Pastore

References

Pek, J., MacCallum, R.C. (2011). Sensitivity Analysis in Structural Equation Models: Cases and Their Influence. Multivariate Behavioral Research, 46, 202-228.

Examples

## not run: this example take several minutes
data("PDII")
model <- "
  F1 =~ y1+y2+y3+y4
"

# fit0 <- sem(model, data=PDII)
# FI <- fitinfluence("cfi",model,data=PDII)
# plot(FI$Dind,pch=19)

## not run: this example take several minutes
## an example in which the deletion of a case yelds a solution 
## with negative estimated variances
model <- "
  F1 =~ x1+x2+x3
  F2 =~ y1+y2+y3+y4
  F3 =~ y5+y6+y7+y8
"

# fit0 <- sem(model, data=PDII)
# FI <- fitinfluence(c("tli","rmsea"),model,PDII)
# explore.influence(FI$Dind$tli)
# explore.influence(FI$Dind$rmsea)

influence.SEM documentation built on May 11, 2022, 9:05 a.m.