Description Usage Arguments Details Value Source See Also Examples
View source: R/bssr.nb.inar1.r
bssr.nb.inar1
fits blinded observations and recalculates the sample size required for proving a desired alternative when testing for
a rate ratio between two groups unequal to one. See 'Details' for more information.
1 | bssr.nb.inar1(alpha, power, delta, x, n, k)
|
alpha |
level (type I error) to which the hypothesis is tested. |
power |
power (1 - type II error) to which an alternative should be proven. |
delta |
the rate ratio which is to be proven. |
x |
a matrix or data frame containing count data which is to be fitted. Columns correspond to time points, rows to observations. |
n |
a vector giving the sample size within the control group and the treatment group, respecitvely. |
k |
planned sample size allocation factor between groups: see 'Details'. |
When testing for differences between rates μ_C and μ_T of two groups, a control and a treatment group respectively, we usually test for the ratio between the two rates, i.e. μ_T/μ_C = 1. The ratio of the two rates is refered to as δ, i.e. δ = μ_T/μ_C.
bssr.nb.inar1
gives back the required sample size for the control and treatment group required to prove an existing
alternative theta
with a specified power power
when testing the null hypothesis H_0: μ_T/μ_C ≥ 1 to level alpha
.
Nuisance parameters are estimated through the blinded observations x
, thus not further required.
for sample sizes n_C and n_T of the control and treatment group, respectively, the argument k
is the desired
sample size allocation factor at the end of the study, i.e. k = n_T/n_C.
rnbinom.inar1
returns the required sample size within the control group and treatment group.
rnbinom.inar1
uses code contributed by Thomas Asendorf.
rnbinom.inar1
for information on the NB-INAR(1) model, n.nb.inar1
for calculating
initial sample size required when performing inference, fit.nb.inar1
for calculating
initial parameters required when performing sample size estimation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #Calculate required sample size to find significant difference with
#80% probability when testing the Nullhypothesis H_0: mu_T/mu_C >= 1
#assuming the true effect delta is 0.8 and rate, size and correlation
#parameter in the control group are 2, 1 and 0.5, respectively.
estimate<-n.nb.inar1(alpha=0.025, power=0.8, delta=0.8, muC=2, size=1, rho=0.5, tp=7, k=1)
#Simulate data
placebo<-rnbinom.inar1(n=50, size=1, mu=2, rho=0.5, tp=7)
treatment<-rnbinom.inar1(n=50, size=1, mu=1.6, rho=0.5, tp=7)
#Blinded sample size reestimation
blinded.data<-rbind(placebo, treatment)[sample(1:100),]
estimate<-bssr.nb.inar1(alpha=0.025, power=0.8, delta=0.8, x=blinded.data, n=c(50,50), k=1)
summary(estimate)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.