Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/prob_rank_givenEffect_approx.R
A normal approximation to comnpute the probability of rank of a test being higher than any other test given the effect size from external information.
1 2 | prob_rank_givenEffect_approx(k, et, ey, nrep = 10000, m0, m1,
effectType = c("binary", "continuous"))
|
k |
Integer, rank of a test |
et |
Numeric, effect of the targeted test for importance sampling |
ey |
Numeric, mean/median filter efffect from external information |
nrep |
Integer, number of replications for importance sampling |
m0 |
Integer, number of true null hypothesis |
m1 |
Integer, number of true alternative hypothesis |
effectType |
Character ("continuous" or "binary"), type of effect sizes |
If one wants to test
H_0: epsilon_i=0 vs. H_a: epsilon_i > 0,
then ey
should be mean of the filter effect sizes,
This is called hypothesis testing for the continuous effect sizes.
If one wants to test
H_0: epsilon_i=0 vs. H_a: epsilon_i = epsilon,
then ey
should be median or any discrete value of the
filter effect sizes. This is called hypothesis testing for the Binary
effect sizes.
m1
and m0
can be estimated using qvalue
from
a bioconductor package qvalue
.
prob
Numeric, probability of the rank of a test
Mohamad S. Hasan, shakilmohamad7@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 | # compute the probability of the rank of a test being third if all tests are
# from the true null
prob <- prob_rank_givenEffect(k = 3, et = 0, ey = 0, nrep = 10000,
m0 = 50, m1 = 50)
# compute the probabilities of the ranks of a test being rank 1 to 100 if the
# targeted test effect is 2 and the overall mean filter effect is 1.
ranks <- 1:100
prob <- sapply(ranks, prob_rank_givenEffect, et = 2, ey = 1, nrep = 10000,
m0 = 50, m1 = 50)
# plot
plot(ranks,prob)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.