Learn R Programming

⚠️There's a newer version (2.1.1) of this package.Take me there.

semPower

semPower is an R-package that provides several functions to perform a-priori, post-hoc, and compromise power analyses for structural equation models (SEM).

Install semPower via CRAN or as follows:

install.packages("devtools")
library("devtools")
install_github("moshagen/semPower")

Manual

Read the manual by typing

vignette("semPower")

or view the manual online.

Quick Examples

Determine the required sample size to detect misspecifications of a model (involving df = 100 degrees of freedom) corresponding to RMSEA = .05 with a power of 80% on an alpha error of .05:

ap <- semPower.aPriori(effect = .05, effect.measure = 'RMSEA', alpha = .05, power = .80, df = 100)
summary(ap)

Determine the achieved power with a sample size of N = 1000 to detect misspecifications of a model (involving df = 100 degrees of freedom) corresponding to RMSEA = .05 on an alpha error of .05:

ph <- semPower.postHoc(effect = .05, effect.measure = 'RMSEA', alpha = .05, N = 1000, df = 100)
summary(ph)

Determine the critical chi-square such that the associated alpha and beta errors are equal, assuming sample size of N = 1000, a model involving df = 100 degrees of freedom, and misspecifications corresponding to RMSEA = .05:

cp <- semPower.compromise(effect = .05, effect.measure = 'RMSEA', abratio = 1, N = 1000, df = 100)
summary(cp)

Plot power as function of the sample size to detect misspecifications corresponding to RMSEA = .05 (assuming df = 100) on alpha = .05:

semPower.powerPlot.byN(effect = .05, effect.measure = 'RMSEA', alpha = .05, df = 100, power.min = .05, power.max = .99)

Plot power as function of the magnitude of effect (measured through the RMSEA assuming df = 100) at N = 500 on alpha = .05:

semPower.powerPlot.byEffect(effect.measure = 'RMSEA', alpha = .05, N = 500, df = 100, effect.min = .001, effect.max = .10)

For more details and for a description how to express the magnitude of effect in terms of model parameters, see the manual.

Citation

If you use semPower in publications, please cite the package as follows:

Moshagen, M., & Erdfelder, E. (2016). A new strategy for testing structural equation models.Structural Equation Modeling, 23, 54-60. doi: 10.1080/10705511.2014.950896

Copy Link

Version

Install

install.packages('semPower')

Monthly Downloads

865

Version

1.0.1

License

LGPL

Maintainer

Morten Moshagen

Last Published

May 17th, 2020

Functions in semPower (1.0.1)

getF.AGFI

getF.AGFI
getCFI.Sigma

getCFI.Sigma
getF.Sigma

getF.Sigma
getFormattedResults

getFormattedResults
getChiSquare.F

getChiSquare.F
getMc.F

getMc.F
getChiSquare.NCP

getChiSquare.NCP
getNCP

getNCP
getGFI.F

getGFI.F
getAGFI.F

getAGFI.F
checkPositiveDefinite

checkPositiveDefinite
getF.GFI

getF.GFI
getF.RMSEA

getF.RMSEA
getF

getF calculates minimum of the ML-fit-function from known fit indices
checkPositive

checkPositive
semPower.powerPlot.byN

sempower.powerPlot.byN
summary.semPower.postHoc

semPower.postHoc.summary
semPower.powerPlot.byEffect

sempower.powerPlot.byEffect
summary.semPower.compromise

summary.sempower.compromise
semPower.postHoc

semPower.postHoc
getF.Mc

getF.Mc
semPower.compromise

sempower.compromise
getIndices.F

getIndices.F
getRMSEA.F

getRMSEA.F
semPower.showPlot

semPower.showPlot
summary.semPower.aPriori

summary.semPower.aPriori
getSRMR.Sigma

getSRMR.Sigma
semPower.aPriori

semPower.aPriori
semPower

semPower: Power analyses for structural equation models (SEM).
validateInput

validateInput
getErrorDiff

getErrorDiff
getBetadiff

getBetadiff
checkBounded

checkBounded