weight_byEffect_bin: Weight for the different effect sizes in a binary case

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

View source: R/weight_byEffect_bin.R

Description

Compute the weights from the ranks probability given the test-effect sizes when the effect sizes are binary.

Usage

1
2
weight_byEffect_bin(i, alpha, null, m, tail = 1L, delInterval,
  covariateEffectVec, datByNull)

Arguments

i

Integer, i-th effect size of a vector of effects

alpha

Numeric, a significance level of the hypothesis tests

null

Numeric, proportion of true true null tests

m

Integer, total number of hypotheis tests

tail

Integer (1 or 2), right-tailed or two-tailed hypothesis test.

delInterval

Numeric, interval between the delta values of a sequence. Note that, delta is a Langrangian multiplier, necessary to normalize the weight

covariateEffectVec

A numeric vector of covariate-effect sizes

datByNull

A numeric matrix of the ranks pobabilities in which each column corresponds to an effect size

Details

This function compute the weights when the effect sizes are binary by applying the ranks probabilities of the different effect sizes. It applies the function function weight_binary from the R package OPWeight to comute the weights from a probability matirx.

Value

A numeics matrix of weights in which each column corresponds to an effect size

Author(s)

Mohamad S. Hasan, shakilmohamad7@gmail.com

See Also

ranksProb_byEffect weight_binary

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# vector of effect sizes
covariateEffectVec <- c(1, 1.5, 2)

# compute probability matrix
ranksProb_byEffect <- sapply(1:length(covariateEffectVec), ranksProb_byEffect,
             null = .9, m = 100, covariateEffectVec = covariateEffectVec)

# compute weights
weightByEffect <- sapply(1:length(covariateEffectVec), weight_byEffect_bin,
                   alpha = .05, null = .9, m = 100, delInterval = .01,
                   covariateEffectVec = covariateEffectVec,
                   datByNull = ranksProb_byEffect)

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