n.gee.1subgroup {spass} | R Documentation |
Sample Size estimation for longitudinal GEE models
Description
n.gee.1subgroup
calculates the required sample size for proving a desired alternative when testing a regression coefficients in a full and/or a subpopulation. See 'Details' for more information.
Usage
n.gee.1subgroup(
alpha,
tail = "both",
beta = NULL,
delta,
sigma,
tau = 0.5,
k = 1,
npow = NULL,
nmax = Inf
)
Arguments
alpha |
level (type I error) to which the hypothesis is tested. |
tail |
which type of test is used, e.g. which quartile und H0 is calculated. |
beta |
type II error (power=1-beta) to which an alternative should be proven. |
delta |
vector of estimated treatment effect in overall and sub population, c(overall population, only subpopulation). |
sigma |
vector of estimated standard deviations, c(full population, subpopulation). See 'Details'. |
tau |
subgroup prevalence. |
k |
sample size allocation factor between control and treatment: see 'Details'. |
npow |
calculates power of a test if |
nmax |
maximum total sample size. |
Details
This function performs a sample size estimation in a design with a nested subgroup within an overall population. To calculate the required sample only the value of tested regressor needs to inserted as delta
. sigma
is the variance of that regressor.
The power for the global null hypothesis is given by 1-beta
and alpha
specifies the false positve level for rejecting H_0: \Delta_F=\Delta_S=0
to level alpha
.
Here argument k
denotes the
sample size allocation factor between treatment groups, i.e. k = n_T/n_C
.
Value
n.gee.1subgroup
returns the required sample size within the control group and treatment group.
Source
n.gee.1subgroup
uses code contributed by Roland Gerard Gera.
See Also
bssr.1subgroup
for blinded sample size re-estimation within a running trial and sandwich
for estimating asymptotic covarianc mtrices in GEE models.
Examples
#Calculate required sample size to correctly reject Null with
#80% probability when testing global Nullhypothesis H_0: Delta_F=Delta_S = 0, while
#assuming the coefficient in and outside of the subgroup is Delta=c(0.1,0,1) with a
#subgroup-prevalence of tau=0.4.
#The variances of regressors in delta when variances are unequal sigma=c(0.8,0.4).
estimate<-n.gee.1subgroup(alpha=0.05,beta=0.2,delta=c(0.1,0.1),sigma=c(0.8,0.4),tau=0.4, k=1)
summary(estimate)
#Alternatively we can estimate the power our study would have
#if we know the effect in and outside our subgroup as
#well as the variance of the regressors. Here we
#estimate that only 300 Patiens total can be recruited and we are interested
#in the power that would give us.
n.gee.1subgroup(alpha=0.05,delta=c(0.1,0.1),sigma=c(0.8,0.4),tau=0.4, k=1, npow=300)