Utility function to calculate the 1-2*alpha CI's given point estimate, CV and n for the various designs covered in this package.
CI.BE(alpha = 0.05, pe, CV, n, design = "2x2", robust = FALSE)
Type I error probability, significance level. Defaults to 0.05.
Point estimate (GMR).
Coefficient of variation of error variability as ratio.
Total number of subjects if a scalar is given. Number of subjects in (sequence) groups if given as vector.
Character string describing the study design.
See known.designs()
for designs covered in this package.
Defaults to FALSE.
Set to TRUE
will use the degrees of freedom according to the 'robust'
evaluation (aka Senn's basic estimator). These df are calculated as n-seq
.
See known.designs()$df2
for designs covered in this package.
Returns the 1-2*alpha confidence interval. Returns a vector with named elements lower, upper if arguments pe and CV are scalars, else a matrix with columns lower, upper is returned.
# NOT RUN {
# 90% confidence interval for the 2x2 crossover
# n(total) = 24
CI.BE(pe=0.95, CV=0.3, n=24)
# should give
# lower upper
#0.8213465 1.0988055
# same with number of subjects in sequence groups
CI.BE(pe=0.95, CV=0.3, n=c(12, 12))
# }
Run the code above in your browser using DataLab