semPower.getDf: semPower.getDf

View source: R/helperFunctions.R

semPower.getDfR Documentation

semPower.getDf

Description

Determines the degrees of freedom of a given model provided as lavaan model string. This only returns the regular df and does not account for approaches using scaled df. This requires the lavaan package.

Usage

semPower.getDf(lavModel, nGroups = NULL, group.equal = NULL)

Arguments

lavModel

the lavaan model string. Can also include (restrictions on) defined parameters.

nGroups

for multigroup models: the number of groups.

group.equal

for multigroup models: vector defining the type(s) of cross-group equality constraints following the lavaan conventions (loadings, intercepts, means, residuals, residual.covariances, lv.variances, lv.covariances, regressions).

Value

Returns the df of the model.

Examples

## Not run: 
lavModel <- '
f1 =~ x1 + x2 + x3 + x4
f2 =~ x5 + x6 + x7 + x8
f3 =~ y1 + y2 + y3
f3 ~ f1 + f2
'
semPower.getDf(lavModel)

# multigroup version
semPower.getDf(lavModel, nGroups = 3)  
semPower.getDf(lavModel, nGroups = 3, group.equal = c('loadings'))
semPower.getDf(lavModel, nGroups = 3, group.equal = c('loadings', 'intercepts'))

## End(Not run)

semPower documentation built on Sept. 30, 2024, 9:24 a.m.