For given desired power, controlled false discovery rate,
and user-specified proportions of non-differentially expressed genes,
`ssize.twoSampVaryDelta`

calculates appropriate sample sizes for
two-sample microarray experiments in which the differences between mean
treatment expression levels (*delta.g* for gene *g*)
vary among genes.
A plot of power versus sample size is generated.

1 2 3 | ```
ssize.twoSampVaryDelta(deltaMean, deltaSE, sigma, fdr = 0.05, power = 0.8,
pi0 = 0.95, maxN = 35, side = "two-sided", cex.title = 1.15,
cex.legend = 1)
``` |

`deltaMean` |
location (mean) parameter of normal distribution
followed by each |

`deltaSE` |
scale (standard deviation) parameter of normal distribution
followed by each |

`sigma` |
the common standard deviation of expressions 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. |

`side` |
options are "two-sided", "upper", or "lower". |

`cex.title` |
controls size of chart titles. |

`cex.legend` |
controls size of chart legend. |

Each *delta.g* is assumed to follow a Normal distribution
with mean `deltaMean`

and standard deviation `deltaSE`

.
The standard deviations of expressions are assumed identical for all 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. |

Ran Bi biran@iastate.edu, Peng Liu pliu@iastate.edu

Liu, P. and Hwang, J. T. G. (2007) Quick calculation for
sample size while controlling false discovery rate with application
to microarray analysis. *Bioinformatics* 23(6): 739-746.

Orr, M. and Liu, P. (2009) Sample size estimation while controlling
false discovery rate for microarray experiments using ssize.fdr package.
*The R Journal*, 1, 1, May 2009, 47-53.

`ssize.twoSamp`

, `ssize.twoSampVary`

,
`ssize.oneSamp`

, `ssize.oneSampVary`

,
`ssize.F`

, `ssize.Fvary`

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
dm <- 1.2; ds <- 0.1 ## the delta.g's follow a Normal(1.2, 0.1) distribution
s <- 1 ## common standard deviation
fdr <- 0.05 ## false discovery rate to be controlled
pwr <- 0.8 ## desired power
pi0 <- c(0.5, 0.8, 0.99) ## proportions of non-differentially expressed genes
N <- 35 ## maximum sample size for calculations
size <- ssize.twoSampVaryDelta(deltaMean = dm, deltaSE = ds, sigma = s,
fdr = fdr, power = pwr, pi0 = pi0,
maxN = N, side = "two-sided")
size$ssize ## first sample size(s) to reach desired power
size$power ## calculated power for each sample size
size$crit.vals ## calculated critical value for each sample size
``` |

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.