ssize.F | R Documentation |
Calculates appropriate sample sizes for multi-sample microarray experiments for a desired power. Sample size calculations are performed at controlled false discovery rates and user-specified proportions of non-differentially expressed genes, design matrix, and standard deviation. A graph of power versus sample size is created.
ssize.F(X, beta, L = NULL, dn, sigma, fdr = 0.05, power = 0.8, pi0 = 0.95, maxN = 20, cex.title=1.15, cex.legend=1)
X |
design matrix of experiment |
beta |
parameter vector |
L |
coefficient matrix or vector for linear contrasts of interest |
dn |
a function of the degrees of freedom based on the design of the experiment |
sigma |
the standard deviation for all genes |
fdr |
the false discovery rate to be controlled |
power |
the desired power to be achieved |
pi0 |
a vector (or scalar) of proportions of non-differentially expressed genes |
maxN |
the maximum sample size used for power calculations |
cex.title |
controls size of chart titles |
cex.legend |
controls size of chart legend |
Standard deviations are assumed to be identical for all genes.
See the function ssize.Fvary
for sample size
calculations with varying standard deviations among genes.
If a vector is input for pi0
, sample size calculations
are performed for each proportion.
ssize |
sample sizes (for each treatment) at which desired power is first reached |
power |
power calculations with corresponding sample sizes |
crit.vals |
critical value calculations with corresponding sample sizes |
Powers calculated to be 0 may be negligibly conservative.
Critical values calculated as ‘NA’ are values >100.
Megan Orr megan.orr@ndsu.edu, Peng Liu pliu@iastate.edu
Liu, Peng and J. T. Gene Hwang. 2007. Quick calculation for sample size while controlling false discovery rate with application to microarray analysis. Bioinformatics 23(6): 739-746.
ssize.twoSampVary
, ssize.oneSamp
,
ssize.oneSampVary
, ssize.F
,
ssize.Fvary
##Sample size calculation for three-treatment loop design microarray experiment ##See Figure S2 of Liu & Hwang (2007) des<-matrix(c(1,-1,0,0,1,-1),ncol=2,byrow=FALSE) ##design matrix of loop design experiment b<-c(1,-0.5) ##difference between first two treatments is 1 and #second and third treatments is -0.5 df<-function(n){3*n-2} ##degrees of freedom for this design is 3n-2 s<-1 ##standard deviation a<-0.05 ##false discovery rate to be controlled pwr1<-0.8 ##desired power p0<-c(0.5,0.9,0.95,0.995) ##proportions of non-differentially expressed genes N1<-20 ##maximum sample size for calculations ft<-ssize.F(X=des,beta=b,dn=df,sigma=s,fdr=a,power=pwr1,pi0=p0,maxN=N1) ft$ssize ##first sample sizes to reach desired power for each proportion of #non-differentially expressed genes ft$power ##power for each sample size ft$crit.vals ##critical value for each sample size
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.