Odds2Corr {mipfp}R Documentation

Converting odds ratio to correlation

Description

For KK binary (Bernoulli) random variables X1X_1, ..., XKX_K, this function transforms the odds ratios measure of association OijO_{ij} between every pair (Xi,Xj)(X_i, X_j) to the correlation CijC_{ij} where

Cij=cov(Xi,Xj)var(Xi)var(Xj)C_{ij} = \frac{cov(X_i, X_j)}{\sqrt{var(X_i) * var(X_j)}}

and

Oij=P(Xi=1,Xj=1)P(Xi=0,Xj=0)P(Xi=1,Xj=0)P(Xi=0,Xj=1). O_{ij} = \frac{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

Odds2Corr(odds, marg.probs)

Arguments

odds

A K×KK \times K matrix where the ii-th row and the jj-th column represents the odds ratio OijO_{ij} between variables ii and jj.

marg.probs

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

Value

The function return a list with the correlations and the pairwise probabilities.

corr

A matrix of the same dimension as odds containing the correlations

pair.proba

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

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

Corr2Odds for converting correlation to odds ratio.

Examples

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

# converting odds ratio to correlation
corr <- Odds2Corr(odds = or, marg.probs = p)
print(corr)

[Package mipfp version 3.2.1 Index]