Learn R Programming

ssize.fdr (version 1.3)

ssize.twoSampVary: Sample Size Calculations for Two-Sample Microarray Experiments with Differing Mean Expressions and Standard Deviations Among Genes

Description

Calculates appropriate sample sizes for two-sample microarray experiments in which the differences between mean treatment expression levels (delta.g for gene g) as well as standard deviations vary among genes. Sample sizes are determined based on a desired power, a controlled false discovery rate, and user-specified proportions of non-differentially expressed genes. A graph of power versus sample size is created.

Usage

ssize.twoSampVary(deltaMean, deltaSE, a, b, fdr = 0.05, power = 0.8, pi0 = 0.95,
maxN = 35, side = "two-sided", cex.title=1.15, cex.legend=1)

Arguments

deltaMean

location (mean) parameter of normal distribution followed by each delta.g

deltaSE

scale (standard deviation) parameter of normal distribution followed by each delta.g

a

shape parameter of inverse gamma distribution followed by variances of genes

b

scale parameter of inverse gamma distribution followed by variances of 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

side

options are "two-sided", "upper", or "lower"

cex.title

controls size of chart titles

cex.legend

controls size of chart legend

Value

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

Details

Each delta.g is assumed to follow a Normal distribution with mean specified by deltaMean and standard deviation specified by deltaSE. The variances among genes are assumed to follow an Inverse Gamma distribution with shape parameter a and scale parameter b.

If a vector is input for pi0, sample size calculations are performed for each proportion.

References

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.

See Also

ssize.twoSampVary, ssize.oneSamp, ssize.oneSampVary, ssize.F, ssize.Fvary

Examples

Run this code
# NOT RUN {
 ##See Figure 3.(a) of Liu & Hwang (2007)
 dm<-2; ds<-1	##the delta.g's follow a Normal(2,1) distribution
 alph<-3; beta<-1	##the variances of genes follow an Inverse Gamma(a,b) distribution
 a2<-0.05	##false discovery rate to be controlled
 pwr2<-0.8	##desired power
 p0<-c(0.90,0.95,0.995)	##proportions of non-differentially expressed genes
 N1<-35		##maximum sample size to be used in calculations

 tsv<-ssize.twoSampVary(deltaMean=dm,deltaSE=ds,a=alph,b=beta,fdr=a2,power=pwr2,pi0=p0,
 maxN=N1,side="two-sided")
 tsv$ssize	##first sample size(s) to reach desired power
 tsv$power	##calculated power for each sample size
 tsv$crit.vals	##calculated critical value for each sample size

# }

Run the code above in your browser using DataLab