ranksProb_compare: Compare rank probabilities

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

View source: R/ranksProb_compare.R

Description

OPWeight package proposed a method to compute the ranks probabilities of the covariate given the test-effect sizes from three approaches: simualation, exact formula, and normal approximation. This funciton uses the methods to compare the ranks probabilities from the three approahes

Usage

1
2
ranksProb_compare(ey, e.one, m0, m1, sampleSize, effectType = c("continuous",
  "binary"))

Arguments

ey

Numerics, mean covariate-effect size

e.one

Numeric, one test effect which will vary across all tests

m0

Integer, number of true null tests

m1

Integer, number of true alternative tests

sampleSize

Integer, total number of sample generated (use sample size at least 100,000)

effectType

Character ("continuous" or "binary"), type of effect sizes

Details

The OPWeight package proposed methods to compute the ranks probabilitiesof the covariate given the test effect size. This funciton uses the methods to compare the rank probabilities from three approahes: 1) simulation, 2) exact formula, and 3) normal approximation

The lower rank may generate missing values because of the large effcet sizes. This is particularly true for the simulaiton approach. however, matplot function requires equal sized vectors. This procedure will replace the missing values by NA so that the vectors size become equal.

Value

Data A data frame containing the seven columns; the ranks and the corresponding ranks probability of the true null and the true alternative hypothesis of the three approaches.

Author(s)

Mohamad S. Hasan, shakilmohamad7@gmail.com

References

Hasan and Schliekelman (2017)

See Also

prob_rank_givenEffect_simu prob_rank_givenEffect_exact prob_rank_givenEffect_approx

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# use sample size at least 100,000 for better result
# This is just an example
sampleSize = 1000
probData <- ranksProb_compare(ey = 1, e.one = 2, m0 = 5, m1 = 5,
                         sampleSize = sampleSize, effectType = "binary")

# plots------------
# colnames(probData) <- c("ranks", "SH0","SH1","EH0","EH1","AH0","AH1")
# matplot(probData[, 1], probData[, 2:5], type = "l", lty = 1:6, col =1:6,
# lwd = 2, xlab = "ranks", ylab = "P(rank | effect)")
# legend("topright", legend = c("SH0","SH1","EH0","EH1","AH0","AH1"),
#               lty = 1:6, col =1:6, lwd = 2)

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