fdrtool               package:fdrtool               R Documentation

_E_s_t_i_m_a_t_e (_L_o_c_a_l) _F_a_l_s_e _D_i_s_c_o_v_e_r_y _R_a_t_e_s _F_o_r _D_i_v_e_r_s_e _T_e_s_t _S_t_a_t_i_s_t_i_c_s

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

     'fdrtool' takes a vector of z-scores (or of correlations,
     p-values, or t-statistics), and estimates for each case both the
     tail area-based Fdr as well as the density-based fdr (=q-value
     resp. local false discovery rate). The parameters of the null
     distribution are  estimated adaptively from the data (except for
     the case of p-values where this is not necessary).

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

     fdrtool(x, statistic=c("normal", "correlation", "pvalue", "studentt"),
       plot=TRUE, verbose=TRUE, cutoff.method=c("fndr", "pct0", "locfdr"),
       pct0=0.75)

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

       x: vector of the observed test statistics.

statistic: one of ""normal" (default), "correlation", "pvalue", 
          "studentt".  This species the null model.

    plot: plot a figure with estimated densities, distribution
          functions,  and (local) false discovery rates.

 verbose: print out status messages.

cutoff.method: one of "fndr" (default), "pct0", "locfdr".

    pct0: fraction of data used for fitting null model - only if
          'cutoff.method'="pct0"

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

     The algorithm implemented in this function proceeds as follows:

        1.  A suitable cutoff point is determined.  If 'cutoff.method'
           is "fndr" then first an approximate null model is fitted and
           subsequently a cutoff point is sought with false
           nondiscovery rate as small as possible (see 'fndr.cutoff'). 
           If 'cutoff.method' is "pct0" then a specified quantile
           (default value: 0.75) of the data is used as the cutoff
           point.  If 'cutoff.method' equals "locfdr" then the
           heuristic of the "locfdr" package (version 1-1.5) is
           employed to find the cutoff (z-scores only).

        2.  The parameters of the null model are estimated from the 
           data using 'censored.fit'. This results in estimates for
           scale parameters und and proportion of null values ('eta0'). 

        3.  Subsequently the corresponding p-values are computed, and a
           modified 'grenander' algorithm is employed to obtain the
           overall density and distribution function  (note that this
           respects the estimated 'eta0').

        4.  Finally, q-values and local fdr values are computed for
           each case.

     The assumed null models all have (except for p-values) one free
     scale parameter.  Note that the z-scores and the correlations are
     assumed to have zero mean.

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

     A list with the following components:

    pval: a vector with p-values for each case.

    qval: a vector with q-values (Fdr) for each case.

    lfdr: a vector with local fdr values for each case.

statistic: the specified type of null model.

   param: a vector containing the estimated parameters (the null 
          proportion 'eta0'  and the free parameter of the null model).

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

     Korbinian Strimmer (<URL: http://strimmerlab.org>).

_S_e_e _A_l_s_o:

     'pval.estimate.eta0', 'censored.fit'.

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

     # load "fdrtool" library and p-values
     library("fdrtool")
     data(pvalues)

     # estimate fdr and Fdr from p-values

     data(pvalues)
     fdr <- fdrtool(pvalues, statistic="pvalue")
     fdr$qval # estimated Fdr values 
     fdr$lfdr # estimated local fdr 

     # estimate fdr and Fdr from z-scores

     sd.true = 2.232
     n = 500
     z = rnorm(n, sd=sd.true)
     z = c(z, runif(30, 5, 10)) # add some contamination
     fdr <- fdrtool(z)

     # you may change some parameters of the underlying functions
     fdr <- fdrtool(z, cutoff.method="pct0", pct0=0.9) 

