Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

SSpower

Power for model parameters


Description

Apply Satorra & Saris (1985) method for chi-squared power analysis.

Usage

SSpower(powerModel, n, nparam, popModel, mu, Sigma, fun = "cfa",
  alpha = 0.05, ...)

Arguments

powerModel

lavaan model.syntax for the model to be analyzed. This syntax should constrain at least one nonzero parameter to 0 (or another number).

n

integer. Sample size used in power calculation, or a vector of sample sizes if analyzing a multigroup model. If length(n) < length(Sigma) when Sigma is a list, n will be recycled.

nparam

integer. Number of invalid constraints in powerModel.

popModel

lavaan model.syntax specifying the data-generating model. This syntax should specify values for all nonzero paramters in the model. If length(n) > 1, the same population values will be used for each group. Different population values per group can only be specified by utilizing Sigma (and mu).

mu

numeric or list. For a single-group model, a vector of population means. For a multigroup model, a list of vectors (one per group). If mu and popModel are missing, mean structure will be excluded from the analysis.

Sigma

matrix or list. For a single-group model, a population covariance matrix. For a multigroup model, a list of matrices (one per group). If missing, popModel will be used to generate a model-implied Sigma.

fun

character. Name of lavaan function used to fit powerModel (i.e., "cfa", "sem", "growth", or "lavaan").

alpha

Type I error rate used to set a criterion for rejecting H0.

...

additional arguments to pass to lavaan.

Details

Specify all non-zero parameters in a population model, either by using lavaan syntax (popModel) or by submitting a population covariance matrix (Sigma) and optional mean vector (mu) implied by the population model. Then specify an analysis model that constrains at least one nonzero parameter to an incorrect value. Note the number in the nparam argument.

Author(s)

Alexander M. Schoemann (East Carolina University; schoemanna@ecu.edu)

Terrence D. Jorgensen (University of Amsterdam; TJorgensen314@gmail.com)

References

Satorra, A., & Saris, W. E. (1985). Power of the likelihood ratio test in covariance structure analysis. Psychometrika, 50, 83–90. doi: 10.1007/BF02294150

Examples

## Specify population values. Note every paramter has a fixed value.
modelP <- '
  f1 =~ .7*V1 + .7*V2 + .7*V3 + .7*V4
  f2 =~ .7*V5 + .7*V6 + .7*V7 + .7*V8
  f1 ~~ .3*f2
  f1 ~~ 1*f1
  f2 ~~ 1*f2
  V1 ~~ .51*V1
  V2 ~~ .51*V2
  V3 ~~ .51*V3
  V4 ~~ .51*V4
  V5 ~~ .51*V5
  V6 ~~ .51*V6
  V7 ~~ .51*V7
  V8 ~~ .51*V8
'
## Specify analysis model. Note parameter of interest f1~~f2 is fixed to 0.
modelA <- '
  f1 =~ V1 + V2 + V3 + V4
  f2 =~ V5 + V6 + V7 + V8
  f1 ~~ 0*f2
'
## Calculate power
SSpower(powerModel = modelA, popModel = modelP, n = 150, nparam = 1,
        std.lv = TRUE)

## Get power for a range of sample sizes

Ns <- seq(100, 500, 40)
Power <- rep(NA, length(Ns))
for(i in 1:length(Ns)) {
  Power[i] <- SSpower(powerModel = modelA, popModel = modelP,
                      n = Ns[i], nparam = 1, std.lv = TRUE)
}
plot(x = Ns, y = Power, type = "l", xlab = "Sample Size")

## Specify second population to calculate power for multigroup model

popMoments1 <- fitted(cfa(modelP))
modelP2 <- '
  f1 =~ .7*V1 + .7*V2 + .7*V3 + .7*V4
  f2 =~ .7*V5 + .7*V6 + .7*V7 + .7*V8
  f1 ~~ .5*f2     ## higher correlation in Group 2
  f1 ~~ 1*f1
  f2 ~~ 1*f2
  V1 ~~ .51*V1
  V2 ~~ .51*V2
  V3 ~~ .51*V3
  V4 ~~ .51*V4
  V5 ~~ .51*V5
  V6 ~~ .51*V6
  V7 ~~ .51*V7
  V8 ~~ .51*V8
'
popMoments2 <- fitted(cfa(modelP2))
modelA2 <- '
  f1 =~ V1 + V2 + V3 + V4
  f2 =~ V5 + V6 + V7 + V8
  f1 ~~ c(0, 0)*f2
'
mu <- list(popMoments1$mean, popMoments2$mean) # ignored if NULL
Sigma <- list(popMoments1$cov, popMoments2$cov)
SSpower(powerModel = modelA2, mu = mu, Sigma = Sigma,
        n = c(60, 65), nparam = 2)

semTools

Useful Tools for Structural Equation Modeling

v0.5-4
GPL (>= 2)
Authors
Terrence D. Jorgensen [aut, cre] (<https://orcid.org/0000-0001-5111-6773>), Sunthud Pornprasertmanit [aut], Alexander M. Schoemann [aut] (<https://orcid.org/0000-0002-8479-8798>), Yves Rosseel [aut] (<https://orcid.org/0000-0002-4129-4477>), Patrick Miller [ctb], Corbin Quick [ctb], Mauricio Garnier-Villarreal [ctb] (<https://orcid.org/0000-0002-2951-6647>), James Selig [ctb], Aaron Boulton [ctb], Kristopher Preacher [ctb], Donna Coffman [ctb], Mijke Rhemtulla [ctb] (<https://orcid.org/0000-0003-2572-2424>), Alexander Robitzsch [ctb] (<https://orcid.org/0000-0002-8226-3132>), Craig Enders [ctb], Ruben Arslan [ctb] (<https://orcid.org/0000-0002-6670-5658>), Bell Clinton [ctb], Pavel Panko [ctb], Edgar Merkle [ctb] (<https://orcid.org/0000-0001-7158-0653>), Steven Chesnut [ctb], Jarrett Byrnes [ctb], Jason D. Rights [ctb], Ylenio Longo [ctb], Maxwell Mansolf [ctb] (<https://orcid.org/0000-0001-6861-8657>), Mattan S. Ben-Shachar [ctb] (<https://orcid.org/0000-0002-4287-4801>), Mikko Rönkkö [ctb] (<https://orcid.org/0000-0001-7988-7609>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.