Type: | Package |
Title: | Estimation of the Local False Discovery Rates by Type II Maximum Likelihood Estimation |
Version: | 1.0.1 |
Date: | 2015-07-30 |
Author: | Ye Yang, Marta Padilla, Alaa Ali, Kyle Leckett, Zhenyu Yang, Zuojing Li, Corey M. Yanofsky and David R. Bickel |
Maintainer: | M. Padilla <padilla.mpf@gmail.com> |
Description: | Suite of R functions for the estimation of the local false discovery rate (LFDR) using Type II maximum likelihood estimation (MLE). |
License: | GPL-3 |
Depends: | stats, methods |
URL: | http://www.cran.r-project.org, http://www.statomics.com |
Packaged: | 2019-10-02 15:47:36 UTC; hornik |
NeedsCompilation: | no |
Repository: | CRAN |
Date/Publication: | 2019-10-02 15:53:57 UTC |
Estimation of the Local False Discovery Rate using Type II Maximum Likelihood Estimation.
Description
Suite of R functions for the estimation of the local false discovery rate (LFDR) using Type II maximum likelihood estimation (MLE).
Details
Package: | LFDR.MLE |
Type: | Package |
Version: | 1.0 |
Date: | 2015-07-30 |
License: | GPL-3 |
Depends: | R (>= 2.14.0), stats, methods |
URL: | http://www.cran.r-project.org, http://www.statomics.com |
Author(s)
Code: Ye Yang, Marta Padilla, Zhenyu Yang, Zuojing Li, Corey M. Yanofsky
Documentation: Alaa Ali, Kyle Leckett, Marta Padilla
Maintainer: D. R. Bickel <dbickel@uOttawa.ca>
References
Yang, Y., & Bickel, D. R. (2010). Minimum description length and empirical Bayes methods of identifying SNPs associated with disease. Technical Report, Ottawa Institute of Systems Biology, COBRA Preprint Series, Article 74, available at biostats.bepress.com/cobra/ps/art74.
Bickel, D. R. (2010). Minimum description length methods of medium-scale simultaneous inference. arXiv preprint arXiv:1009.5981.
Padilla, M., & Bickel, D. R. (2012). Estimators of the local false discovery rate designed for small numbers of tests. Statistical Applications in Genetics and Molecular Biology, 11(5), art. 4.
Examples
dFUN<-dabsTd; dfx <- 4
n.alternative <- 3; n.null <- 4; true.ncp <- 7
#NOTE: arguments for dFUN are x, df, ncp. If dFUN has other arguments,
#please adapt them. For example:
#dFUN<-function(x,df,ncp){dnorm(x=x,mean=ncp,sd=df)};attr(dFUN,'name')<-'dnorm'
#In the examples, W is the result of the absolute value of the t.test statistics
#on the data
W<-abs(c(rt(n=n.alternative,ncp=true.ncp,df=dfx),rt(n=n.null,ncp=0,df=dfx)))
W[c(1,3,5)]<-NA
z1<-lfdr.mle(x=W,dFUN=dFUN, df=dfx)
z2<-lfdr.mle(x=W,dFUN=dFUN, df=dfx,fixed.p0=0.4,fixed.ncp=4)
z3<-lfdr.mdl(x=W,df=dfx,dFUN=dFUN)
z4<-lfdr.l1o(x=W,df=dfx,dFUN=dFUN)
z5<-lfdr.lho(x=W,df=dfx,dFUN=dFUN,fixed.ncp=5)
z6<-lfdr.lo(x=W,v=1/3,df=dfx,dFUN=dFUN)
z7<-lfdr.mdlo(x=W,v=1/3,df=dfx,dFUN=dFUN)
Density of the absolute Student t Distribution.
Description
Density of the absolute t distribution with df degrees of freedom and non-centrality parameter ncp.
Usage
dabsTd(x, df, ncp = 0, ...)
Arguments
x |
vector of quantiles. |
df |
degrees of freedom (>0). |
ncp |
noncentrality parameter. |
... |
arguments to pass to functions |
Value
numeric of length equal to the length of x.
Author(s)
Code: David R. Bickel,
Documentation: Alaa Ali, Kyle Leckett, Marta Padilla.
See Also
Function dt
from basic R.
Examples
z1<-dabsTd(x = c(1:4), df = 3, ncp = 3)
Internal Functions and Methods
Description
These functions are for internal use and/or for upcoming packages or not yet documented.
Usage
MakeNames(x, nmvar = c("X", "I"), ...)
are(object, class2)
are_null(object)
are_prob(object, ...)
assert.are(object, class2,
...)
assert.is(object, class2, text = "")
est2list(x)
get_groups(n.features, n.null, n.groups)
get_n.groups(n.features, n.null,
group.size)
get_null.groups(n.null, null.n.groups)
get_null.n.groups(n.null,
null_group.size)
get_simulated_W(n.features, true.p0, list.ncp1,
rFUN, df)
is_any(object, class2)
is_err(object)
is_error(object)
is_unk(object)
is_vide(object)
lfdr.hats(stat = NULL, lfdr.fun = "lfdr.mle",
dFUN = dabsTd, lower.ncp = 0.001, upper.ncp = 20, lower.p0 = 0,
upper.p0 = 1, fixed.p0 = NULL, fixed.ncp = NULL, d0 = 0, v = 1,
w = 1, ...)
make_labels(n, nmvar = c("X"), n.ini = 1)
new_est.lfdrmle(LFDR.hat,
p0.hat, ncp.hat, stat, method = NULL, info = list())
nsize(x)
rFUN_generator(base_rFUN, ...)
sameAsX_names(x = NULL, y = NULL)
simulated_W(n.features, n.null, rFUN = rFUN_generator(rchisq), true.ncp1, df,
N = (n.features - n.null), sided = ifelse(identical(rFUN,
rFUN_generator(rchisq)), 1, 2), logic = TRUE)
vect2string(x, sep = "", ...)
vectorized.dabsTd(ncp, ...)
ye.mle(W, df, dFUN = dabsTd, lower.ncp = 0.001,
upper.ncp = 20, lower.p0 = 0, upper.p0 = 1, d0 = 0, fixed.ncp = NULL,
fixed.p0 = NULL, ...)
Leave-one-out (L1O) and leave-half-out (LHO) method for LFDR estimation.
Description
Estimate the local false discovery rate using the leave-one-out method (L1O) or the leave-half-out method (LHO).
Usage
lfdr.l1o(x, dFUN = dabsTd, lower.ncp = 0.001, upper.ncp = 20, lower.p0 = 0,
upper.p0 = 1, fixed.p0 = NULL, fixed.ncp = NULL, d0 = 0, ...)
lfdr.lho(x, dFUN = dabsTd, lower.ncp = 0.001, upper.ncp = 20, lower.p0 = 0,
upper.p0 = 1, fixed.p0 = NULL, fixed.ncp = NULL, d0 = 0, ...)
lfdr.lo(x, dFUN = dabsTd, lower.ncp = 0.001, upper.ncp = 20, lower.p0 = 0,
upper.p0 = 1, fixed.p0 = NULL, fixed.ncp = NULL, v = 0, d0 = 0, ...)
Arguments
x |
Input numeric vector of statistics. |
dFUN |
Density function; default |
lower.ncp |
The lowerbound of the location parameter of |
upper.ncp |
The upperbound of the location parameter of |
lower.p0 |
The lowerbound of p0 (proportion of unaffected features (null hypothesis)); default value is 0 |
upper.p0 |
The upperbound of p0 (proportion of unaffected features (null hypothesis)); default value is 1 |
fixed.p0 |
A fixed value of p0 (proportion of unaffected features (null hypothesis)); default value is NULL |
fixed.ncp |
A fixed value of the location parameter of |
v |
v in [0,1], portion of one feature that is considered in turn to estimate the LFDR; default value is v=0 (for |
d0 |
the numeric value of the null hypothesis for |
... |
Other parameters to pass to |
Value
A list with:
LFDR.hat |
estimates of the LFDR |
p0.hat |
estimate of the proportion of unaffected features p0 (true null hypothesis). |
ncp.hat |
estimate of the location parameter of the distribution |
info |
method name and information about computation failure. |
Note
- Requires fixed.p0=NULL
.
- The probability density function (dFUN
) can be set to any other distribution, adapted so that the location parameter corresponds to ncp, other parameter to df and any other can be passed to dFUN
by the dots (see examples in lfdr.mle
).
- If computation fails for all features, p0.hat
is set to NA and so is LFDR.hat
, which is a vector of NA with lengh equal to the number of features. If it fails for a given feature, only the resulting LFDR for that feature is set to NA. Error messages are not suppressed.
Author(s)
Code: Marta Padilla
Documentation: Alaa Ali, Kyle Leckett, Marta Padilla.
References
Padilla, M., & Bickel, D. R. (2012). Estimators of the local false discovery rate designed for small numbers of tests. Statistical Applications in Genetics and Molecular Biology, 11(5), art. 4.
See Also
Examples
dfx <- 4;n.alt <- 1;n.null <- 4;true.ncp <- 7
#numeric imput data: statistics of the data with missing values (removed internally)
#(result of a absolute t.test statistics on the data)
W<-abs(c(rt(n=n.alt,ncp=true.ncp,df=dfx),rt(n=n.null,ncp=0,df=dfx)))
W[3]<-NA
z1<-lfdr.l1o(x=W,df=dfx)
z2<-lfdr.lho(x=W,df=dfx,fixed.ncp=10)
z3<-lfdr.lo(x=W,df=dfx,v=1/3,fixed.p0=0.3)
Minimum description length (MDL) method for estimation of LFDR.
Description
Estimate the local false discovery rate using the minimum description length (MDL) method.
Usage
lfdr.mdl(x, dFUN = dabsTd, lower.ncp = 0.001, upper.ncp = 20, lower.p0 = 0,
upper.p0 = 1, fixed.p0 = NULL, fixed.ncp = NULL, d0 = 0, ...)
lfdr.mdlo(x, v = 0, dFUN = dabsTd, lower.ncp = 0.001, upper.ncp = 20,
lower.p0 = 0, upper.p0 = 1, fixed.p0 = NULL, fixed.ncp = NULL,
d0 = 0, ...)
Arguments
x |
Input numeric vector of statistics. |
dFUN |
Density function; default |
v |
v in [0,1], portion of one feature that is considered in turn to estimate the LFDR; default value is v=0 (for |
lower.ncp |
The lowerbound of the location parameter of |
upper.ncp |
The upperbound of the location parameter of |
lower.p0 |
The lowerbound of p0 (proportion of unaffected features (null hypothesis)); default value is 0 |
upper.p0 |
The upperbound of p0 (proportion of unaffected features (null hypothesis)); default value is 1 |
fixed.p0 |
A fixed value of p0 (proportion of unaffected features (null hypothesis)); default value is NULL |
fixed.ncp |
A fixed value of the location parameter of |
d0 |
the numeric value of the null hypothesis for |
... |
Other parameters to pass to |
Value
A list with:
LFDR.hat |
estimates of the LFDR |
p0.hat |
estimate of the proportion of unaffected features p0 (true null hypothesis). |
ncp.hat |
estimate of the location parameter of the distribution |
info |
method name and information about computation failure. |
Note
- The probability density function (dFUN
) can be set to any other distribution, adapted so that the location parameter corresponds to ncp, other parameter to df and any other can be passed to dFUN
by the dots (see examples in lfdr.mle
).
- If computation fails for all features, p0.hat
is set to NA and so is LFDR.hat
, which is a vector of NA with lengh equal to the number of features. If it fails for a given feature, only the resulting LFDR for that feature is set to NA. Error messages are not suppressed.
Author(s)
Code: Marta Padilla
Documentation: Alaa Ali, Kyle Leckett, Marta Padilla.
References
Bickel, D. R. (2010). Minimum description length methods of medium-scale simultaneous inference. arXiv preprint arXiv:1009.5981.
Padilla, M., & Bickel, D. R. (2012). Estimators of the local false discovery rate designed for small numbers of tests. Statistical Applications in Genetics and Molecular Biology, 11(5), art. 4.
See Also
Examples
dfx <- 4;n.alt <- 1;n.null <- 4;true.ncp <- 7
#numeric imput data: statistics of the data with missing values (removed internally)
#(result of a absolute t.test statistics on the data)
W<-abs(c(rt(n=n.alt,ncp=true.ncp,df=dfx),rt(n=n.null,ncp=0,df=dfx)))
W[3]<-NA
z1<-lfdr.mdl(x=W,df=dfx)
z2<-lfdr.mdl(x=W,df=dfx,fixed.ncp=10)
z3<-lfdr.mdlo(x=W,df=dfx,v=1/3,fixed.p0=0.3)
Type II Maximum likelihood estimate of LFDR (LFDR-MLE).
Description
Estimates the local false discovery rate by the Type II maximum likelihood estimates (MLE).
Usage
lfdr.mle(x, dFUN = dabsTd, lower.ncp = 0.001, upper.ncp = 20,lower.p0 = 0, upper.p0 = 1,
fixed.p0 = NULL, fixed.ncp = NULL, d0 = 0, ...)
Arguments
x |
Input numeric vector of statistics. |
dFUN |
Density function; default |
lower.ncp |
The lowerbound of the location parameter of |
upper.ncp |
The upperbound of the location parameter of |
lower.p0 |
The lowerbound of p0 (proportion of unaffected features (null hypothesis)); default value is 0 |
upper.p0 |
The upperbound of p0 (proportion of unaffected features (null hypothesis)); default value is 1 |
fixed.p0 |
A fixed value of p0 (proportion of unaffected features (null hypothesis)); default value is NULL |
fixed.ncp |
A fixed value of the location parameter of |
d0 |
the numeric value of the null hypothesis for |
... |
Other parameters to pass to |
Value
A list with:
LFDR.hat |
estimates of the LFDR |
p0.hat |
estimate of the proportion of unaffected features p0 (true null hypothesis). |
ncp.hat |
estimate of the location parameter of the distribution |
info |
method name and information about computation failure. |
Note
- The probability density function (dFUN
) can be set to any other distribution, adapted so that the location parameter corresponds to ncp, other parameter to df and any other can be passed to dFUN
by the dots (see examples in lfdr.mle
).
- If computation fails for all features, p0.hat
is set to NA and so is LFDR.hat
, which is a vector of NA with lengh equal to the number of features. If it fails for a given feature, only the resulting LFDR for that feature is set to NA. Error messages are not suppressed.
Author(s)
Code: Ye Yang, Marta Padilla, Zhenyu Yang, Zuojing Li, Corey M. Yanofsky
Documentation: Alaa Ali, Kyle Leckett, Marta Padilla.
References
Yang, Y., & Bickel, D. R. (2010). Minimum description length and empirical Bayes methods of identifying SNPs associated with disease. Technical Report, Ottawa Institute of Systems Biology, COBRA Preprint Series, Article 74, available at biostats.bepress.com/cobra/ps/art74.
Bickel, D. R. (2010). Minimum description length methods of medium-scale simultaneous inference. arXiv preprint arXiv:1009.5981.
Padilla, M., & Bickel, D. R. (2012). Estimators of the local false discovery rate designed for small numbers of tests. Statistical Applications in Genetics and Molecular Biology, 11(5), art. 4.
See Also
Examples
#numeric imput data: statistics of the data with missing values (removed internally)
#(result of a absolute t.test statistics on the data)
dfx <- 4;n.alt <- 1;n.null <- 4;true.ncp <- 7
W<-abs(c(rt(n=n.alt,ncp=true.ncp,df=dfx),rt(n=n.null,ncp=0,df=dfx)))
W[3]<-NA
z1<-lfdr.mle(x=W,dFUN=dabsTd, df=dfx)
z2<-lfdr.mle(x=W,dFUN=dabsTd, df=dfx, fixed.p0=0.4, fixed.ncp=4)
#other dFUN -------
#NOTE: arguments for dFUN are x, df, ncp. If dFUN has other arguments,
#please adapt them. For example:
new.df<-function(x,df,ncp,...){df(x=x,ncp=ncp,df1=df,...)}
z3<-lfdr.mle(x=W,df=dfx,dFUN=new.df,df2=5)