Power {SSPA}R Documentation

Estimates the average power of the pilot data

Description

The function Power estimates the average power of the pilot data at a given false discovery rate. The average power can be estimated for sample sizes other then the pilot data.

Usage

Power(x, threshold = 0, fdr = 0.1, samplesizes = NULL, 
       plot = FALSE, type = "l", ylim = c(0, 1), xlim = c(0, 1), xlab = "p-value", 
       ylab = "average power", main, sub, ...)

Arguments

x object of class SampleSize-class
threshold threshold for truncation of the density of effect-sizes. A small symmetrical region around zero can be defined that will be excluded from the density of effect sizes.
fdr numeric given the desired false discovery rate threshold, possibly a vector like: c(0.1, 0.05)
samplesizes numeric vector, giving the samplesizes for which the power will be estimated
plot logical if TRUE plots the power curve and intersection for the given fdr(default plot=FALSE).
type what type of plot should be drawn
ylim range of y values
xlim range of x values
xlab a title for the x axis
ylab a title for the y axis
main an overall title for the plot
sub a sub title for the plot
... additional arguments to plot or par

Details

Having estimated the proportion of non-differentially expressed genes and the density of effect-sizes an estimate of the average power is calculated at a given false discovery rate and sample size. Power and sample size analysis can be performed by estimating the average power for sample sizes other then the pilot data. Ferreira and Zwinderman (2006) show that the average power (the proportion of rejected hypothesis out of all alternative hypothesis) of the adaptive Benjamini-Hochberg procedure is estimated by the point where the CDF of p-values under the alternative hypothesis intersects the straight line with a slope determined by the given FDR and the estimated proportion of non-differentially expressed genes. Using plot=TRUE the CDF of p-values under the alternative hypothesis is shown with the intersecting lines for different FDRs and sample sizes. Don't use more than 2 FDRs and more than 3 different sample sizes because the plot will then be unclear.

Value

estimated average power, probabily a named matrix with on the rows different sample sizes and on the columns the different false discovery rates.

Author(s)

Maarten van Iterson

References

Ferreira, F.A., Zwinderman, A., (2006). Approximate Power and Sample Size Calculations with Microarray Data: An Illustration. Statistical Applications in Genetics and Molecular Biology 5, (1).

Examples

library(multtest)
data(golub)
teststat <- mt.teststat(golub, golub.cl)
table(golub.cl)
pd <- pilotData(name="golub", testStatistics=teststat, sampleSizeA=11, sampleSizeB=27)
hist(pd)
plot(pd)
ss <- sampleSize(pd)
plotEffectSize(ss)
Power(ss)

##creating a plot estimate power vs. sample size
pwr <- Power(ss, plot = FALSE, samplesizes = c(5, 10, 15, 20), fdr=0.01)
plot(c(5, 10, 15, 20), pwr, ylim = c(0, 1), type = "b", ylab = "Power", xlab = "Sample size per group")
legend("bottomright", colnames(pwr), col=c(1:ncol(pwr)), pch=1, lty=1)

##creating a plot estimate power vs. sample size for different false discovery rates
pwr <- Power(ss, plot = FALSE, samplesizes = c(5, 10, 15, 20), fdr=c(0.01, 0.05))
matplot(c(5, 10, 15, 20), pwr, ylim = c(0, 1), type = "b", pch=1, ylab = "Power", xlab = "Sample size per group")
legend("bottomright", colnames(pwr), col=c(1:ncol(pwr)), pch=1, lty=1)


[Package SSPA version 1.0.0 Index]