# NOT RUN {
##The example is commented as it may take longer than 10 seconds to run.
##Please uncomment prior to execution.
##Example for constant rates
#set.seed(12)
#h<-function(lambda.eta){
# lambda.eta[2]
#}
#hgrad<-function(lambda.eta){
# c(0, 1, 0)
#}
##Calculate initial sample size
#estimate<-n.nb.gf(lambda=c(0,-0.3), size=1, rho=0.5, tp=6, k=1, h=h, hgrad=hgrad,
# h0=0, trend="constant", approx=20)
##Generate and permutate data with different nuisance parameters
#random<-get.groups(n=round(estimate$n/2), size=c(0.8, 0.8), lambda=c(0.5, -0.3),
# rho=c(0.4, 0.4), tp=6, trend="constant")
#random<-random[sample(1:nrow(random), nrow(random)), ]
##Recalculate sample size with data
#reestimate<-bssr.nb.gf(data=random, alpha=0.025, power=0.8, delta=-0.3, h0=0,
# tp=6, k=1, trend="constant", approx = 20)
#summary(reestimate)
# }
Run the code above in your browser using DataLab