Power                  package:SSPA                  R Documentation

_E_s_t_i_m_a_t_e_s _t_h_e _a_v_e_r_a_g_e _p_o_w_e_r _o_f _t_h_e _p_i_l_o_t _d_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     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, ...)

_A_r_g_u_m_e_n_t_s:

       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'

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

     Maarten van Iterson

_R_e_f_e_r_e_n_c_e_s:

     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).

_E_x_a_m_p_l_e_s:

     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)

