# Power calculations for structural equation models

3 posts / 0 new
Offline
Joined: 07/31/2009 - 15:14
Power calculations for structural equation models

So a question was on SEMNET the other day, as to whether there were any free SEM packages that do power calculations. In essence, OpenMx does, given a bit of help from the R package pwr. Basically, one would fit the true model to the data, fix one or more parameters to predetermined values (usually to zero) and refit the model. Suppose that the difference in the -2lnL fit functions (as might be obtained from two mxRun commands

sat<-mxRun(saturated)
and
sub <-mxRun(submodel)

then the difference in the fit of these two models would be:

deltachi<-mxEval(objective,sub) - mxEval(objective,sat)

and the difference in the degrees of freedom would be (sorry this is crude but df is not healthy in OpenMx yet)

deltadf<-length(sat@output$estimate) - length(sub@output$estimate)

To compute the power to reject the null hypothesis at significance level alpha=.05, we could use:

require(stats)
alpha<-.05

This probably belongs in the documentation somewhere, for now it is just a convenient aide-memoire pour moi.

Offline
Joined: 07/31/2009 - 14:25

hi Mike,
Isn't power about detecting an effect when it is present in the data (for a given alpha and n)? So surely you'd need to inject that effect into (simulated?) data, and then see if you can set the modeled effect size to zero without (significant) loss of fit.

PS: where did pwr come into the routine you outlined (or did I miss something?)

detach("package:pwr")
deltachi =1.1
alpha = .05