probRel_CovVsTest_effect: Relationship between covariate and test effect sizes

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/probRel_CovVsTest_effect.R

Description

Compute the relationship between the covariate and test effect sizes in terms of the ranks probability of the covariate given the test effect sizes

Usage

1
probRel_CovVsTest_effect(r, rho, H0, ed, m0, m1, n_ey = 100)

Arguments

r

Integer, rank of the covariate

rho

Numeric, correlation between the covariate and the test efect sizes

H0

Binary 0 or 1, determine the null or the alternative hypotheisis; H0 = 0 if null and H0 = 1 if alternative

ed

Numeric, mean effect size of the test statistics

m0

Integer, number of true null hypothesis

m1

Integer, number of the true alternative hypothesis

n_ey

Integer, number of covariate-effects to be generated

Details

Compute the relationship between the covariate and the test effect sizes in terms of the ranks probability of the covariate given the test effect sizes. The weight identity is based on the test effect size; however, the ranks probability needs to compute from the covariate effects. Therefore, it is expected that there is a relationship between the covariate and test effect sizes.

Value

prob A numeric value of the ranks probability of the test given the mean test effect

Author(s)

Mohamad S. Hasan, shakilmohamad7@gmail.com

See Also

prob_rank_givenEffect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
ranks = 1:10
prob_test0 <- sapply(ranks, probRel_CovVsTest_effect, rho = .8,
                       H0 = 0, ed = 2, m0 = 9, m1 = 1)

# prob_test1 <- sapply(ranks, probRel_CovVsTest_effect, rho=.8,
#                       H0 = 1, ed = 2, m0 = 9, m1 = 1)

# prob0 <- sapply(ranks, prob_rank_givenEffect, et = 0, ey = 2,
#                                           m0 = 9, m1 = 1)

# prob1 <- sapply(ranks, prob_rank_givenEffect, et = 2, ey = 2,
#                                           m0 = 9, m1 = 1)

# matplot(1:10, cbind(prob_test0, prob_test1, prob0, prob1),
#                     type = "l", xlab = "ranks", ylab = "p(rank | effect)")
# legend("topright", legend = c("prob_test0", "prob_test1", "prob0", "prob1"),
#                       col = 1:4, lty = 1:4, lwd = 2)

mshasan/OPWpaper1 documentation built on Feb. 22, 2021, 10:22 a.m.