n.1subgroup {spass} | R Documentation |
Sample Size Calculation for a One Subgroup Design
Description
n.1subgroup
calculates the required sample size for proving a desired alternative when testing for
an effect in the full or subpopulation. See 'Details' for more information.
Usage
n.1subgroup(
alpha,
beta,
delta,
sigma,
tau,
eps = 0.001,
approx = c("conservative.t", "liberal.t", "normal"),
k = 1,
nmax = 1000,
nmin = 0
)
Arguments
alpha |
level (type I error) to which the hypothesis is tested. |
beta |
type II error (power=1-beta) to which an alternative should be proven. |
delta |
vector of treatment effects to be proven, c(outside subgroup, inside subgroup). |
sigma |
vector of standard deviations, c(outside subgroup, inside subgroup). |
tau |
subgroup prevalence. |
eps |
precision parameter concerning the power calculation in the iterative sample size search algorithm. |
approx |
approximation method: Use a conservative multivariate t distribution ("conservative.t"), a liberal multivariate t distribution ("liberal.t") or a multivariate normal distribution ("normal") to approximate the joint distribution of the standardized teststatistics. |
k |
sample size allocation factor between groups: see 'Details'. |
nmax |
maximum total sample size. |
nmin |
minimum total sample size. |
Details
This function performs sample size estimation in a design with a subgroup within a full population where we want to test for treatment effects between a control and a treatment group. Since patients from the subgroup might potentially benefit from the treatment more than patients not included in that subgroup, one might prefer testing hypothesis cercerning the full population and the subpopulation at the same time. Here standardized test statistics are their joined distributions are used to calculate the
required sample size for the control and treatment group to prove an existing
alternative delta
with a specified power 1-beta
when testing the global null hypothesis H_0: \Delta_F=\Delta_S=0
to level alpha
.
For sample sizes n_C
and n_T
of the control and treatment group, respectively, the argument k
is the
sample size allocation factor, i.e. k = n_T/n_C
.
Value
n.1subgroup
returns the required sample size within the control group and treatment group.
Source
n.1subgroup
uses code contributed by Marius Placzek.
See Also
#' bssr.1subgroup
for blinded sample size reestimation within a running trial.
Examples
#Calculate required sample size to correctly reject with
#80% probability when testing the global Nullhypothesis H_0: Delta_F=Delta_S = 0
#assuming the true effect Delta_S=1 is in the subgroup (no effect outside of the subgroup)
#with subgroup prevalence tau=0.4.
#The variances in and outside of the subgroup are unequal, sigma=c(1,1.2).
estimate<-n.1subgroup(alpha=0.025,beta=0.1,delta=c(0,1),sigma=c(1,1.2),tau=0.4,eps=0.0001,
approx="conservative.t",k=2)
summary(estimate)