Odds2PairProbs: Converting odds ratio to pairwise probability

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

View source: R/binary.R

Description

For K binary (Bernoulli) random variables X_1, ..., X_K, this function transforms the odds ratios measure of association O_ij between every pair (X_i, X_j) to the pairwise probability P(X_i = 1, X_j = 1), where O_ij is defined as

O_ij = P(X_i = 1, X_j = 1) * P(X_i = 0, X_j = 0) / P(X_i = 1, X_j = 0) * P(X_i = 0, X_j = 1).

Usage

1
Odds2PairProbs(odds, marg.probs)

Arguments

odds

A K x K matrix where the i-th row and the j-th column represents the odds ratio O_ij between variables i and j.

marg.probs

A vector with K elements of marginal probabilities where the i-th entry refers to P(X_i = 1).

Value

A matrix of the same dimension as odds containing the pairwise probabilities

Note

If we denote P(X_i = 1, X_j = 1) by h_ij, and P(X_i = 1) by p_i, then it can be shown that

O_ij = h_ij * (1 - p_i - p_j + h_ij) / ((p_i - h_ij) * (p_j - h_ij).

Author(s)

Thomas Suesse.

Maintainer: Johan Barthelemy johan@uow.edu.au.

References

Lee, A.J. (1993). Generating Random Binary Deviates Having Fixed Marginal Distributions and Specified Degrees of Association The American Statistician 47 (3): 209-215.

Qaqish, B. F., Zink, R. C., and Preisser, J. S. (2012). Orthogonalized residuals for estimation of marginally specified association parameters in multivariate binary data. Scandinavian Journal of Statistics 39, 515-527.

See Also

Corr2PairProbs for converting the correlation to pairwise probability.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# from Qaqish et al. (2012)
or <- matrix(c(Inf, 0.281, 2.214, 2.214,
               0.281, Inf, 2.214, 2.214,
               2.214, 2.214, Inf, 2.185,
               2.214, 2.214, 2.185, Inf), nrow = 4, ncol = 4, byrow = TRUE)
rownames(or) <- colnames(or) <- c("Parent1", "Parent2", "Sibling1", "Sibling2")

# hypothetical marginal probabilities
p <- c(0.2, 0.4, 0.6, 0.8)

# getting the pairwise probabilities
pp <- Odds2PairProbs(odds = or, marg.probs = p)
print(pp)

mipfp documentation built on May 2, 2019, 6:01 a.m.