cfa_groupwise {psycModel}R Documentation

Confirmatory Factor Analysis (groupwise)

Description

[Stable]
This function will run N number of CFA where N = length(group), and report the fit measures of CFA in each group. The function is intended to help you get a better understanding of which group has abnormal fit indicator

Usage

cfa_groupwise(data, ..., group, model = NULL, ordered = FALSE)

Arguments

data

data frame

...

CFA items. Support dplyr::select() syntax.

group

character. group variable. Support dplyr::select() syntax.

model

explicit lavaan model. Must be specify with model = lavaan_model_syntax. [Experimental]

ordered

logical. default is FALSE. If it is set to TRUE, lavaan will treat it as a ordinal variable and use DWLS instead of ML

Details

All argument must be explicitly specified. If not, all arguments will be treated as CFA items

Value

a data.frame with group-wise CFA result

Examples

# The example is used as the illustration of the function output only.
# It does not imply the data is appropriate for the analysis.
cfa_groupwise(
  data = lavaan::HolzingerSwineford1939,
  group = "school",
  x1:x3,
  x4:x6,
  x7:x9
)

[Package psycModel version 0.5.0 Index]