mipfp (version 3.2.1)

Corr2PairProbs: Converting correlation to pairwise probability

Description

For \(K\) binary (Bernoulli) random variables \(X_1\), ..., \(X_K\), this function transforms the correlation measure of association \(C_{ij}\) between every pair \((X_i, X_j)\) to the pairwise probability \(P(X_i = 1, X_j = 1)\), where \(C_{ij}\) is defined as $$ C_{ij} = \frac{cov(X_i, X_j)}{\sqrt(var(X_i) * var(X_j))}. $$

Usage

Corr2PairProbs(corr, marg.probs)

Arguments

corr

A \(K \times K\) matrix where the \(i\)-th row and the \(j\)-th column represents the correlation \(C_{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 corr containing the pairwise probabilities

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

Odds2PairProbs for converting odds ratio to pairwise probability.

Examples

Run this code
# NOT RUN {
# correlation matrix from Qaqish et al. (2012)
corr <- matrix(c( 1.000, -0.215, 0.144, 0.107,
                 -0.215,  1.000, 0.184, 0.144,
                  0.144,  0.184, 1.000, 0.156,
                  0.107,  0.144, 0.156, 1.000), 
                  nrow = 4, ncol = 4, byrow = TRUE)
rownames(corr) <- colnames(corr) <- c("Parent1", "Parent2", "Sibling1", 
                                      "Sibling2")

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

# getting the pairwise probabilities
pp <- Corr2PairProbs(cor = corr, marg.probs = p)
print(pp)
# }

Run the code above in your browser using DataLab