Fluorite | Level 6

## Sample size calculation and count data/Poisson regression

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?

Best,

1 ACCEPTED SOLUTION

Accepted Solutions
Rhodochrosite | Level 12

## Re: Sample size calculation and count data/Poisson regression

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:

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.

6 REPLIES 6
SAS Super FREQ

## Re: Sample size calculation and count data/Poisson regression

Rhodochrosite | Level 12

## Re: Sample size calculation and count data/Poisson regression

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?

Fluorite | Level 6

## Re: Sample size calculation and count data/Poisson regression

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?

Best

Rhodochrosite | Level 12

## Re: Sample size calculation and count data/Poisson regression

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:

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.

SAS Super FREQ

## Re: Sample size calculation and count data/Poisson regression

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.

Obsidian | Level 7

## Re: Sample size calculation and count data/Poisson regression

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

Discussion stats
• 6 replies
• 25964 views
• 2 likes
• 4 in conversation