Title: | Control of the Median of the FDP |
---|---|
Description: | Methods for controlling the median of the false discovery proportion (mFDP). Depending on the method, simultaneous or non-simultaneous inference is provided. The methods take a vector of p-values or test statistics as input. |
Authors: | Jesse Hemerik [aut, cre] |
Maintainer: | Jesse Hemerik <[email protected]> |
License: | GNU General Public License |
Version: | 0.2.1 |
Built: | 2025-02-21 07:04:09 UTC |
Source: | CRAN |
For a p-value rejection threshold t
, compute the 50 percent confidence upper bound for the number of false positives. The bounds are simultaneous over t
.
get.bound(t,c,kappa.max)
get.bound(t,c,kappa.max)
t |
The p-value threshold |
c |
The tuning parameter, which influences the intercept and slope of the enveloppe. Should be numeric. |
kappa.max |
This value needs to be computes based on the p-values. Together with |
A non-negative integer, which is a median unbiased (or upward biased) estimate of the number false positives.
#Suppose the envelope that has been computed is defined by c=0.002 and kappa.max=0.001. #We can then evaluate the envelope at several thresholds t as below. #This is equivalent to simply entering the formula floor((t+c)/kappa.max). #50 percent confidence upper bound for nr of false positives, if p-value threshold of 0.01 is used: get.bound(t=0.01,c=0.002,kappa.max=0.001) #12 #50 percent confidence upper bound for nr of false positives, if p-value threshold of 0.02 is used: get.bound(t=0.02,c=0.002,kappa.max=0.001) #22 #50 percent confidence upper bound for nr of false positives, if p-value threshold of 0.03 is used: get.bound(t=0.03,c=0.002,kappa.max=0.001) #32
#Suppose the envelope that has been computed is defined by c=0.002 and kappa.max=0.001. #We can then evaluate the envelope at several thresholds t as below. #This is equivalent to simply entering the formula floor((t+c)/kappa.max). #50 percent confidence upper bound for nr of false positives, if p-value threshold of 0.01 is used: get.bound(t=0.01,c=0.002,kappa.max=0.001) #12 #50 percent confidence upper bound for nr of false positives, if p-value threshold of 0.02 is used: get.bound(t=0.02,c=0.002,kappa.max=0.001) #22 #50 percent confidence upper bound for nr of false positives, if p-value threshold of 0.03 is used: get.bound(t=0.03,c=0.002,kappa.max=0.001) #32
kappa.max
, which defines the mFDP envelopeBased on a vector of unadjusted(!) p-values, compute kappa.max
, which together with c
defines the mFDP envelope
get.kappa.max(P, c="1/(2m)", s1=0, s2=0.1)
get.kappa.max(P, c="1/(2m)", s1=0, s2=0.1)
P |
A vector of p-values. |
c |
The tuning parameter, which influences the intercept and slope of the enveloppe. Should either be numeric or |
s1 |
The smallest p-value threshold of interest. Non-negative. |
s2 |
The largest p-value threshold of interest. Should be larger than |
kappa.max
, which together with c
defines the mFDP envelope.
set.seed(5193) ### Make some p-values m=500 #the nr of hypotheses nrfalse=100 #the nr of false hypotheses tstats = rnorm(n=m) #m test statistics tstats[1:nrfalse] = tstats[1:nrfalse] + 3 #add some signal P = 1 - pnorm(tstats) #compute p-values ### Compute kappa.max. (Taking c to be the default value 1/(2m).) kappa.max = get.kappa.max(P=P) kappa.max
set.seed(5193) ### Make some p-values m=500 #the nr of hypotheses nrfalse=100 #the nr of false hypotheses tstats = rnorm(n=m) #m test statistics tstats[1:nrfalse] = tstats[1:nrfalse] + 3 #add some signal P = 1 - pnorm(tstats) #compute p-values ### Compute kappa.max. (Taking c to be the default value 1/(2m).) kappa.max = get.kappa.max(P=P) kappa.max
Provides mFDP-adjusted p-values, given a vector of p-values.
mFDP.adjust(P, c="1/(2m)", s1=0, s2=0.1)
mFDP.adjust(P, c="1/(2m)", s1=0, s2=0.1)
P |
A vector of (raw, i.e. unadjusted) p-values. |
c |
The tuning parameter, which influences the intercept and slope of the envelope. Should either be numeric or |
s1 |
The smallest p-value threshold of interest. |
s2 |
The largest p-value threshold of interest. |
A vector of mFDP-adjusted p-values. Some can be infinity - which can be interpreted as 1.
set.seed(5193) ### make some p-values m=500 #the nr of hypotheses nrfalse=100 #the nr of false hypotheses tstats = rnorm(n=m) #m test statistics tstats[1:nrfalse] = tstats[1:nrfalse] + 3 #add some signal P = 1 - pnorm(tstats) #compute p-values P.adjusted = mFDP.adjust(P=P) #mFDP-adjusted p-values. Be careful with interpretation. min(P.adjusted) #0.0208
set.seed(5193) ### make some p-values m=500 #the nr of hypotheses nrfalse=100 #the nr of false hypotheses tstats = rnorm(n=m) #m test statistics tstats[1:nrfalse] = tstats[1:nrfalse] + 3 #add some signal P = 1 - pnorm(tstats) #compute p-values P.adjusted = mFDP.adjust(P=P) #mFDP-adjusted p-values. Be careful with interpretation. min(P.adjusted) #0.0208
Controls the median of the FDP, given a vector of test statistics.
mFDP.direc(Ts, delta=0, gamma=0.05)
mFDP.direc(Ts, delta=0, gamma=0.05)
Ts |
A vector containing the test statistics T_1,...,T_m |
delta |
Determines the null hypotheses H_1,...,H_m. For every j, H_j is the hypothesis that T_j has mean at most delta. |
gamma |
Desired upper bound for the mFDP |
The indices of the rejected hypotheses
set.seed(123) tstats = rnorm(n=200)+1.5 #make some test statistics mFDP.direc(Ts = tstats) #indices of rejected hypotheses
set.seed(123) tstats = rnorm(n=200)+1.5 #make some test statistics mFDP.direc(Ts = tstats) #indices of rejected hypotheses
Controls the median of the FDP, given a vector of test statistics.
mFDP.equiv(Ts, delta, gamma=0.05)
mFDP.equiv(Ts, delta, gamma=0.05)
Ts |
A vector containing the test statistics T_1,...,T_m |
delta |
Determines the null hypotheses H_1,...,H_m. Should be >0. For every j, H_j is the null hypothesis that |T_j| has mean at least delta. The alternative hypothesis is that |T_j| has mean smaller than delta |
gamma |
Desired upper bound for the mFDP |
The indices of the rejected hypotheses
set.seed(123) tstats = rnorm(n=200) #make some test statistics mFDP.equiv(Ts = tstats,delta=2) #indices of rejected hypotheses
set.seed(123) tstats = rnorm(n=200) #make some test statistics mFDP.equiv(Ts = tstats,delta=2) #indices of rejected hypotheses