Description Usage Arguments Details Value Source See Also Examples
View source: R/n.gee.1subgroup.r
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.
1 2 3 4 5 6 7 8 9 10 11 |
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. |
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: Δ_F=Δ_S=0 to level alpha.
Here argument k denotes the
sample size allocation factor between treatment groups, i.e. k = n_T/n_C.
n.gee.1subgroup returns the required sample size within the control group and treatment group.
n.gee.1subgroup uses code contributed by Roland Gerard Gera.
bssr.1subgroup for blinded sample size re-estimation within a running trial and sandwich for estimating asymptotic covarianc mtrices in GEE models.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.