fitMultiMod: A function that scripts and fits a CFA model

Description Usage Arguments Examples

View source: R/fitMultiMod.R

Description

This function takes a named list of indicator variable names; if there is only one character vector, a unidimensional CFA is fit, but if there is more than one character vector, a multidimensional CFA is fit, whereby the latent variables are named after the elements of the list. Function by Steph Gauvin

Usage

1
fitMultiMod(df, vars, categ = FALSE)

Arguments

df

the data frame that includes the to-be analyzed indicators

vars

a named list of one or more character vectors of indicator names

categ

an optional logical (defaults to FALSE) for whether indicators are categorical (in which case, ordered ULSMVS estimation is used, otherwise "MLR" is used)

Examples

1
2
3
4
5
6
7
df <- psych::bfi

vars <- list(agree = c("A1","A2","A3","A4","A5"),
open = c("O1", "O2", "O3", "O4", "O5"),
neuro = c("N1", "N2", "N3", "N4", "N5"))

mod <- fitMultiMod(df, vars)

jsakaluk/psyscores documentation built on Dec. 16, 2021, 6:50 p.m.