efast: Estimate an EFAST model

View source: R/efast.R

efastR Documentation

Estimate an EFAST model

Description

This function estimates efa models with residual covariance.

Usage

efast(
  data,
  M,
  rstruct,
  sample.nobs = NULL,
  auto.fix.first = FALSE,
  auto.var = TRUE,
  auto.efa = TRUE,
  information = "observed",
  std.ov = TRUE,
  ...
)

Arguments

data

<data.frame> the dataset or <matrix> covariance matrix

M

<numeric> How many factors, minimum 2

rstruct

<list> residual structure (see details)

sample.nobs

<numeric> sample size (if data = covmat, see lavaan)

auto.fix.first

<bool> see lavaan

auto.var

<bool> see lavaan

auto.efa

<bool> see lavaan

information

<character> see lavaan

std.ov

<bool> see lavaan

...

other arguments passed to lavaan

Details

Residual structure (in the form of residual covariances) can be added to the EFA through a list of pairs of variable names. See the example for more information.

Examples

## Not run: 
# Use a lavaan test dataset
test_data <- lavaan::HolzingerSwineford1939[,7:15]

# create an EFA model
test_efa <- efast(test_data, 3)

# create a (simple) residual structure
res_struct <- list(
  c("x4", "x7"),
  c("x5", "x9")
)

# create an efast model
test_efast <- efast(test_data, 3, res_struct)

compare the models
lavaan::lavTestLRT(test_efa, test_efast)

## End(Not run)


vankesteren/efast documentation built on March 5, 2024, 9:41 p.m.