rpsychologist / powerlmm

powerlmm R package for power calculations for two- and three-level longitudinal multilevel/linear mixed models.
100 stars 12 forks source link

References #1

Closed Johnzav888 closed 6 years ago

Johnzav888 commented 6 years ago

Dear Mr Magnusson,

First of all congratulations for this package. It seems that you put a lot of effort on that!

I have some questions about it. I saw the references that you provided, but unfortunately i do not have access to the books. I read the articles and i realized that you use slightly different calculations than what i can find elswhere( i.e. "Effects of study Duration, Frequency of observation, and sample size on Power in Studies of group differences in Polynomial Change"). Especially i observed a difference in the standardized effect and in the variance ratio, which i saw being calculated by using the total variance in the denominator and not only the within variance. And by comparing the results from this package with the PASS software i observed a slight difference in the estimated sample sizes. Can you please provide me with some articles or anything that i can read and understand your calculations ?

Thank you very much for your time.

Kind regards, John Zavrakidis

rpsychologist commented 6 years ago

Hi,

As far as I know there's no article that describe exactly the same calculations. However, several articles use the general formulas of the generalized least squares estimator to get variance of the treatment effect. My calculations are described in the package's technical vignette:.

As you note, there exists several different definitions of both the variance ratio and the standardized effects. Tho, they make no difference for the actual calculations, but they do lead to different raw values. Currently, I use calculations that are more common in my field (clinical psychology). My plan is to add other definitions as well. I the mean time it should be possible to simply enter the corresponding variance components, and avoid using my standardizations. Though, this is not the best solution as you'd have to manually translate the treatment effect to the same units as my definition. The next release will, at least, include the possibility to use unstandardized value for the time:treatment-interaction, which will make custom definitions more easy. And I should probably make this more clear in the documentation.

I suspect the differences to PASS is either caused by the models not being exactly the same, or differences in the degrees of freedom / distribution used when doing the power analysis. Many other implementations simply use normal approximations, and avoid the issue of correct dfs.

Thanks for the feedback!