getOmega: A function that scripts and fits a CFA model and returns...

Description Usage Arguments Examples

View source: R/getOmega.R

Description

This function takes a named list of indicator variable names and uses fitMultiMod to either script and fit a unidimensional or multidimensional CFA model. It then runs and returns output from semTools::reliability() focusing on omega reliability. Function by Steph Gauvin

Usage

1
getOmega(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"))

relout <- getOmega(df, vars)

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