BookmarkSubscribeRSS Feed
BlueNose
Quartz | Level 8

Hello everyone,

I would like to ask for your advise regarding sample size calculations using SAS (either with the power and sample size module or directly with code).

It is very simple calculating a sample size using the well known "t-test" scenario, and both SAS and other packages support this calculation, which is straightforward even manually.

What I want to do, is to calculate the required sample size for a trial with random effects. For example, random effects can be a multi-center effect, a repeated measures effect, or any other random effect. A trial can even have more than one random effect. My intuition say, that the more variance components I add to my model, the more samples I will need. I tried looking online for a solution but so far failed. Can I use SAS to calculate sample size for trials which will be analyzed with a mixed model (either with mixed proc or glimmix proc) ?

(Let's assume for now that my response is continuous just to make it more simple)

Thank you very much !

5 REPLIES 5
SteveDenham
Jade | Level 19

It is not simple, but the only practical way that I can think of to do this is through simulation.  The hard part is correctly simulating data.  The random factors and covariance structure are going to be critical.  Once you generate a good dataset, then it is a matter of doing the analysis, and recording the type II error rate for a preselected number of simulations.  Then change the sample size, and repeat.  Repeat this process until you can get enough results to narrow in on the sample size needed to control type II error at a given type I error rate.

I would suggest a google search on simulating clinical data for calculation of sample size.  There are probably some macros out there that will help.  If you do not have IML licensed, I strongly recommend that you get it, as developing correctly specified datasets through data steps is exceedingly difficult.

Steve Denham

Rick_SAS
SAS Super FREQ

I agree with Steve: simulation is the way to go.  In my forthcoming book, Simulating Data with SAS, I have  examples of power and sample size analysis and simulation of mixed models and repeated measures. Unfortunately, the book is currently undergoing a copyedit and won't be published until Q2 of 2013.

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

Here is another example where the wonderful new book by Walter Stroup is essential -- Generalized Linear Mixed Models: Modern Concepts, Methods and Applications (CRC Press, 2012). Chapter 16 is all about power and sample sizes for mixed models (multiple random effects, etc.). There are too many things to cover here, but Stroup gives detailed instructions on how to do what you want. Although simulation is useful, of course, you can do several things without simulation by using GLIMMIX or MIXED (coupled with the PARMS statement and HOLD option). By the way, Stroup is one of the authors of the classic: SAS for Mixed Models, 2nd edition (SAS Publ.).

For immediate access, check out the 2011 SAS Global Forum article by Stroup:

http://support.sas.com/resources/papers/proceedings11/349-2011.pdf

He goes through a LITTLE of the sample size and power calculations for mixed models. As he correctly points out, not properly taking account of the random effects can lead to meaningless results.

SteveDenham
Jade | Level 19

Holy cat.  I had forgotten all about Walt's method (and had even used it a couple of times)..  The Litmus Test design in the paper really helps me with a problem analysis we have had--and makes me think hard about using R side covariance structures when G-side may be a better approach.

Steve Denham

BlueNose
Quartz | Level 8

Thank you all for replying quickly.

Simulation sounds like an interesting way...

Rick, I am looking forward for having your book, already singed up on the SAS website and will get a notice when it's up for sale.

I have heard about the book of Walter Stroup, and for some weeks now I am thinking of buying it. If the book actually present an easier way of evaluation sample size, then it's another reason to get this book on my shelf.

Thanks everyone, your comments are very helpful and very appreciated !

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 6391 views
  • 0 likes
  • 4 in conversation