mModels: Get Measurement Models for the questionnaire used

Description Usage Arguments Value Examples

View source: R/qscales.R

Description

Get Measurement Models for the questionnaire used

Usage

1
mModels(data, scales, run.models, ...)

Arguments

data

The data frame containing only the variables that are used for the analyses

scales

A character vector of scales used.

run.models

Logical. Should the models be run or should they be returnes as character output? Default is to FALSE, which returns only the definition of the measurement models in lavaan syntax.

...

If run.models = TRUE, a measurement model for each scale is fitted, using cfa. These ... arguments are passed on directly to this function.

Value

Depending on run.models, this function returns either a list of character vectors, each containint the measurement model in lavaan syntax or the fitted model.

Examples

1
2
3
4
5
6
7
scales <-  c("E = 1r, 6, 11R, 16",
             "A = 2r, 7, 12r, 17r",
             "C = 3, 8r, 13, 18",
             "N = 4, 9r, 14, 19",
             "O = 5, 10, 15, 20 21")
data <- bigfive[grep(x = names(bigfive), pattern = "BFI_")]
mModels(data, scales, run.models = FALSE, std.lv = TRUE)

kthorstmann/quest documentation built on May 20, 2019, 7:05 p.m.