Can anyone suggest a procedure or sas Macro that can calculate the power of mixed model (with random effect)? I am not sure if proc glmpower can handle the random effect or not? Thanks.
This has come up before. Do some searching of this website. You should read chapter 12 in SAS for Mixed Models (2006) by Littell et al. and chapter 16 in Generalized Linear Mixed Models (2012) by Walter Stroup.
You should not use GLMPOWER or POWER procedures when there are random effects.
Thank you for your help. I actually took a look at chapter 12 of Littell's book. The second part (power analysis of pilot study) is very helpful. But my problem is that I do not have data from a pilot study. I only have means and standard deviation for each cell. I tried to randomly generate a number for each cell using means and standard deviation (assuming normal), and tabulate the data. Use this data set as pilot data. I am no sure if this is a right way to do. But when I ran the mixed model on the tabulated data, it shows warning 'final hessian is not positive definite". Do you think this is something wrong with the model that I specified or the way I tabulated the data as pilot data? Thank you.
Most likely the model is overspecified, so that the Hessian is not PD. If you could share the code for your model--especially anything regarding random or repeated factors--I think we can address the issue.
Steve Denham
the data set has 8 centers and 2 treatments. Each center has unbalanced number of patients with treatment 0 and treatment 1.
I only have the mean and std for each treatment in each center, so I randomly generate an outcome measure using the given mean and std (assuming normal) for each cell.
after I have the data set, i ran the code:
proc mixed;
class center treatment;
model outcome=treatment / solution ddfm=kr;
random center;
ods output tests3=t3;
run;
data power;
set t3;
noncen=NumDF*FValue;
alpha=0.05;
Fcri=finv(1-alpha,NumDF, DebDF, noncen);
power=1-probf(Fcri, NumDF, DenDF, noncen);
run;
What is the dependent variable and what do the means and SDs for the centers look like? Is there obvious heterogeneity of the SDs by either treatment or center? It's obviously a data situation, as your model is pretty simple.
Steve Denham
los is dependent variable:
the mean and sd are:
center #_patients los_mean los_sd percent_treatment1
a1 70 95.8 53.7 5
a2 74 88 41.5 2
a3 115 86 43.3 14
a4 108 73.9 42.9 24
a5 78 77.5 39.6 28
a6 174 72.1 41.9 24
a7 87 93.9 46.6 32
a8 91 89.8 31.1 18
a9 45 77.5 45.7 15
a10 149 92.6 76.4 7
a11 144 86.7 48.1 10
a12 103 88.3 45.1 68
a13 40 86.7 63.4 96
a14 95 87.1 56.3 7
a15 109 78.5 43.9 10
a16 18 102.8 71.5 9
a17 57 95.2 61.1 38
a18 26 79.6 47.2 26
The data you presented only has one mean for each center, but you had two treatments? You earlier said "I only have the mean and std for each treatment in each center"
I would have expected 2 means/sd, one for each treatment in each centre.
You could still use the above data to separate out the centre-centre and patient-patient variability by fitting a model to your simulated data with just the intercept.
Carl.
I would suggest that you reread those chapters mentioned earlier as you haven't extracted the proper elements for a power analysis. You simply can't use the observed data to do a power analysis on the observed effects -- this is a retrospective power analysis and there are many paper showing that this is nonsense.
Visit SFU Statistics - Power computations in complex experiments for some SAS examples, e.g. the power analysis of the split-plot design.
What you need to do, once you have generated the random data with the corresponding means and std from each combination of center and treatment, is estimate the two variance components. Your experiment is an example of a Generalized RCB design. Centers are blocks, each treatment occurs in all centers, and you have multiple replicates of each treatment in each centre (unlike a classic RCB where there is one replicate of each treatment in each block). There are several papers describing the analysis of a GRCB -- try
Addelman, S. (1969). The Generalized Randomized Block Design. American Statistician, 23, 35-36. http://dx.doi.org/10.2307/2681737 .
YOur model is missing one variance component representing the centre*treatment interaction, and needs to be refit.
Proc Mixed on the simulated data, with an appropriate model, should give you these. THen you use the variance components and proposed sample sizes to estimate the power etc as shown in Stroup's original paper or the SAS for Mixed Models book.
Carl Schwarz
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.