BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AnalytX
Fluorite | Level 6

Hi everybody,

I would like to perform a sample size calculation with count data (cumulative number of a particular event) as primary endpoint. Do you have any idea how to proceed in SAS?

Thanking you in advance for your answer.

Best,

1 ACCEPTED SOLUTION

Accepted Solutions
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

As far as I know, PROC POWER does not have a direct way of dealing with Poisson (others can correct me if I am wrong). However, one can use the approach advocated by Walt Stroup in the 2011 SAS Global Forum:

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

He was emphasizing GLMMs, but you don't have any random terms. The approach determines the power for different means and sample sizes. You have to try different sample sizes (variable: reps) until you obtain the desired power. I modified for Poisson. For reps=15 and your means (7 and 5.6 [a 20% drop]), power is only 0.33. Try reps=50 and you will see that power is about 0.8.

title 'Power analysis for Poisson, 2 treatments';

title2 '(based on Stroup, 2011, 2012)';

data power_poisson;

input trt $ mean;

reps=15;     *<--change to any number you want to test;

do obs=1 to reps;

output;

end;

datalines;

control 7

exper 5.6

;

run;

proc print data=power_poisson;run;

proc glimmix data=power_poisson;     *<--mostly ignore the output here, ODS tables are stored for manipulation below;

class trt;

model mean = trt / chisq link=log dist=poisson;

contrast 'control vs experimental' trt 1 -1 / chisq ;

ods output tests3=F_overall contrasts=F_contrasts;

run;

data power;                         *<--this data step takes relevant parts of above output to get power at given N and treatment means;

set F_overall F_contrasts;

  nc_parm=numdf*Fvalue;

  alpha=0.05;

  F_Crit=Cinv(1-alpha,numdf,0);

  Power=1-probchi(F_crit,numdf,nc_parm);

proc print data=power;          *<--this printout is the relevant part, look at far right for realized power;

run;

This approach is described in SAS for Mixed Models, 2nd Edition (2006) and in Stroup book (2012, chapter 16). I changes for Poisson. You can expand for any number of treatments, treatment means, and use different distributions. With random effects, you would need to to hold those variances constant. See the listed paper and these references for more details. If you use this approach, you should definitely cite Stroup.

View solution in original post

6 REPLIES 6
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

It would help to know more details. Are you trying to estimate one or more means with a fixed level of precision or are are trying to achieve a certain power for a contrast (such as the difference of two means)? Or something else? Do you have any random effects?

AnalytX
Fluorite | Level 6

Thanks Rick and LVM for your answers!

To be more precise:

We would like to determine the sample size for a study according to the primary study outcome which is a count variable. According to litterature, we know that the average number is 7 events in the population. We estimate a decrease of 20% in the treated group at the end of the study. With an expected rate of 7 events using a two-sided Poisson regression at the 5% alpha-level, what is the number of subjects needed to detect a 20% decrease with at least 80% power?

Thanking you in advance for your help!

Best

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

As far as I know, PROC POWER does not have a direct way of dealing with Poisson (others can correct me if I am wrong). However, one can use the approach advocated by Walt Stroup in the 2011 SAS Global Forum:

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

He was emphasizing GLMMs, but you don't have any random terms. The approach determines the power for different means and sample sizes. You have to try different sample sizes (variable: reps) until you obtain the desired power. I modified for Poisson. For reps=15 and your means (7 and 5.6 [a 20% drop]), power is only 0.33. Try reps=50 and you will see that power is about 0.8.

title 'Power analysis for Poisson, 2 treatments';

title2 '(based on Stroup, 2011, 2012)';

data power_poisson;

input trt $ mean;

reps=15;     *<--change to any number you want to test;

do obs=1 to reps;

output;

end;

datalines;

control 7

exper 5.6

;

run;

proc print data=power_poisson;run;

proc glimmix data=power_poisson;     *<--mostly ignore the output here, ODS tables are stored for manipulation below;

class trt;

model mean = trt / chisq link=log dist=poisson;

contrast 'control vs experimental' trt 1 -1 / chisq ;

ods output tests3=F_overall contrasts=F_contrasts;

run;

data power;                         *<--this data step takes relevant parts of above output to get power at given N and treatment means;

set F_overall F_contrasts;

  nc_parm=numdf*Fvalue;

  alpha=0.05;

  F_Crit=Cinv(1-alpha,numdf,0);

  Power=1-probchi(F_crit,numdf,nc_parm);

proc print data=power;          *<--this printout is the relevant part, look at far right for realized power;

run;

This approach is described in SAS for Mixed Models, 2nd Edition (2006) and in Stroup book (2012, chapter 16). I changes for Poisson. You can expand for any number of treatments, treatment means, and use different distributions. With random effects, you would need to to hold those variances constant. See the listed paper and these references for more details. If you use this approach, you should definitely cite Stroup.

Rick_SAS
SAS Super FREQ

As usual, lvm provides excellent code and citations. I'll only add a shameful self-serving advertisement:

In my book, Simulating Data with SAS, I provide several examples of using simulation to compute power and sample size (Ch 5 [p. 84-88], Ch 6 [p. 94-95], Ch 11 [p. 211-215]). My book is more elementary than Stroup's book and does not focus solely on regression models. However, if you ever need to simulate multiple correlated covariates for a more sophisticated model, my book might be helpful.

BarryDeCicco
Obsidian | Level 7

Thank you very much!  I'm using this now.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 25965 views
  • 2 likes
  • 4 in conversation