Description Usage Arguments Details Value Author(s) Examples
View source: R/prob_rank_givenEffect_emp.R
Emperical comnputation of the ranks probability of a test being higher than any other test given the effect size from the external information.
1 2  | 
pvalue | 
 vector of test pvalues  | 
filter | 
 vector of filter statistics  | 
group | 
 number of groups, should be at least four  | 
h_breaks | 
 number of breaks for the histogram  | 
bin_idx | 
 Integer, bin number of the histogram. Almost alwyas it is one, becasue we are interested to obtain the ranks probability of the alternative tests  | 
smooth | 
 Character of ("TRUE" or "FALSE") to apply spline smoothing, default is TRUE  | 
effectType | 
 type of effect size c("binary","continuous")  | 
If one wants to test
H_0: \epsilion_i=0 vs. H_a: \epsilion_i > 0,
then et  and ey should effect type continuous effect size and
if one wants to test 
H_0: \epsilion_i=0 vs. H_a: \epsilion_i = \epsilion,
one should the binary effect size
ranksProb emperical probability of the rank of the test
Mohamad S. Hasan, mshasan@uga.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14  | # generating data (known in practice)
set.seed(123)
X = runif(10000, min = 0, max = 2.5)         # covariate
H = rbinom(length(X), size = 1, prob = 0.1)   # hypothesis true or false
Z = rnorm(length(X), mean = H * X)            # Z-score
p = 1 - pnorm(Z)
# apply the function to compute the rank proabbility
grp = 10
ranksProb = prob_rank_givenEffect_emp(pvalue = p, filter = X, group = grp,
                               h_breaks = 71, effectType = "continuous")
# plot the probability
plot(1:grp, ranksProb, type="l", xlab = "ranks", ylab = "P(rank | effect)")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.