The following are the input parameters for the sample size calculation

Alpha level = 0.04, target power= 90%, event rate for reference group (r0)= mu0<-0.8/52*48,

Rate ratio (rr) under ha = mu1/mu0 where mu1<-mu0*0.6, average exposure time= 48 week, sample size allocation ratio =1 so each group has equal sample size ;n1=n0), and dispersion parameter (k=0.4).

Thank you for your suggestions!

Code:

```
library(MASS)
n<- 400 sample size
alpha<-0.04
int<-1000
k<- 1/0.4 #shape
mu0<-0.8/52*50 #control exacerbation rate
mu1<-mu0*0.4 # exacerbation rate for trt1
mu2<-mu1 #exacerbation rate for trt2
t0<-rep(0,n)
t1<-rep(1,n)
ta1<-c(t0,t1)
ta2<-c(t0,t1)
c1<-NULL
c2<-c1
test1<-c1
test2<-c1
for (i in 1:int){
pbo<-rnegbin(n,theta=k, mu=mu0)
d1<-rnegbin(n, theta=k, mu=mu1)
d2<-rnegbin(n, theta=k, mu=mu2)
r1<-c(pbo,d1)
r2<-c(pbo,d2)
x1<-cbind(ta1,r1)
x2<-cbind(ta2,r2)
dt1<-as.data.frame(x1)
dt2<-as.data.frame(x2)
fm1 <- glm.nb(r1 ~ ta1, data = dt1)
fm2 <- glm.nb(r2 ~ ta2, data = dt2)
test1<-c(test1,summary(fm1)$coef[2,4])
test2<-c(test2,summary(fm2)$coef[2,4])
c1<-c(c1,summary(fm1)$coef[2,3])
c2<-c(c2,summary(fm2)$coef[2,3])
}
#power
result<-(sum((test1<alpha)&(test2<alpha))/int)
```