prob_rank_givenEffect_emp: Emperical ranks probbaility of the test given the effect size

Description Usage Arguments Details Value Author(s) Examples

View source: R/prob_rank_givenEffect_emp.R

Description

Emperical comnputation of the ranks probability of a test being higher than any other test given the effect size from the external information.

Usage

1
2
prob_rank_givenEffect_emp(pvalue, filter, group = 5L, h_breaks = 100L,
  bin_idx = 1L, smooth = TRUE, effectType = c("continuous", "binary"))

Arguments

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")

Details

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

Value

ranksProb emperical probability of the rank of the test

Author(s)

Mohamad S. Hasan, mshasan@uga.edu

Examples

 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)")

mshasan/empOPW documentation built on March 1, 2021, 4:19 a.m.