I am trying to run a power simulation for a mixed effects model, however I do not have the data. I have the variances, difference in slope to detect, corr(Y_ij, Y_ik), and sample variance of time. The only examples I have found for power simulation are for t tests. How do I incorporate mixed effects model? I'm using SAS 9.4.
d=4
alpha=0.05
between variance = 5
within variance = 45
t=1, 2, 3, 4 (equally spaced)
n=100
There is a simulation of power example for linear regression in Simulating Data with SAS (p. 211-215). It is based on a similar simulation in Greene, W. H. (2000) Econometric Analysis, 4th ed, Chap 15, p. 617)
In general, the way to conduct a power simulation is
1. Figure out how to simulate data from the model
2. Figure out how to use PROC MIXED to run the test that you are studying (=the test that you are investigating with the power analysis)
3. To make sure you've done everything right, generate 1000 (or more) samples from the null distribution of the test. You should find that the empirical power is 1 - P(Type 2 error) = proportion of times that test rejected null hypothesis (when it shouldn't have). This should happen 5% of the time if you run the test at alpha=0.05 signif level.
4. Now that the program is working, generate data that has the assumed effect. Compute the power to detect the effect.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.