# 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
#h<-function(lambda.eta){
# lambda.eta[2]
#}
#hgrad<-function(lambda.eta){
# c(0, 1, 0)
#}
##We assume the rate in the control group to be exp(lambda[1]) = exp(0) and an
##effect of lambda[2] = -0.3. The \code{size} is assumed to be 1 and the correlation
##coefficient \code{\rho} 0.5. At the end of the study, we would like to test
##the treatment effect specified in lambda[2], and therefore define function
##\code{h} and value \code{h0} accordingly.
#estimate<-n.nb.gf(lambda=c(0,-0.3), size=1, rho=1, tp=6, k=1, h=h, hgrad=hgrad,
# h0=0.2, trend="constant", approx=20)
#summary(estimate)
##Example for exponential trend
#h<-function(lambda.eta){
# lambda.eta[3]
#}
#hgrad<-function(lambda.eta){
# c(0, 0, 1, 0)
#}
#estimate<-n.nb.gf(lambda=c(0, 0, -0.3/6), size=1, rho=0.5, tp=7, k=1, h=h, hgrad=hgrad,
# h0=0, trend="exponential", approx=20)
#summary(estimate)
# }
Run the code above in your browser using DataLab