Onesided tests
Ho: δ_j = 0
Ha: δ_j > 0
1  OneSide.varyEffect(s1, s2, m, m1, delta, a1, r1, fdr)

s1 
We use bisection method to find the sample size, which let the equation h(n)=0. Here s1 and s2 are the initial value, 0<s1<s2. h(s1) should be smaller than 0. 
s2 
s2 is also the initial value, which is larger than s1 and h(s2) should be larger than 0. 
m 
m is the total number of multiple tests 
m1 
m1 = m  m0. m0 is the number of tests which the null hypotheses are true ; m1 is the number of tests which the alternative hypotheses are true. (or m1 is the number of prognostic genes) 
delta 
δ_j is the constant effect size for jth test. δ_j=(E(Xj)E(Yj))/σ_j. X_{ij}(Y_{ij}) denote the expression level of gene j for subject i in group 1( and group 2, respectively) with common variance σ_{j}^{2}. We assume δ_j=0,~ j~ in~ M0 and δ_j >0, ~j~ in~ M1=effect size for prognostic genes. 
a1 
a1 is the allocation proportion for group 1. a2=1a1. 
r1 
r1 is the number of true rejection 
fdr 
fdr is the FDR level. 
alpha_star=r1*fdr/((mm1)*(1fdr)), which is the marginal type I error level for r1 true rejection with the FDR controlled at f.
beta_star=1r1/m1, which is equal to 1power.
Chow SC, Shao J, Wang H. Sample Size Calculation in Clinical Research. New York: Marcel Dekker, 2003
1 2 3 4 5  delta=c(rep(1,40/2),rep(1/2,40/2));
Example.12.2.2 < OneSide.varyEffect(100,150,4000,40,delta,0.5,24,0.01)
Example.12.2.2
# n=148 s1<n<s2, h(s1)<0,h(s2)<0

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.