cor2psi {binarySimCLF} | R Documentation |
From Correlation To Pairwise Odds-Raio
Description
This function converts a correlation matrix associated with a mean
vector into a vector of pairwise odds ratio. This is done in the following
order. Let μ = (μ_1, μ_2, ..., μ_n). Then the odds ratio vector is of length
n choose 2 with elements psi_{12}, psi_{13}, ..., psi_{1n}, psi_{23}, ..., psi_{(n-1)n} .
Usage
cor2psi(r, mu)
Arguments
r |
Correlation matrix. |
mu |
Mean vector. |
Value
Returns a list with two components:
psi |
The pairwise odds ratio vector if the routine executes without error. |
error |
A logical; if TRUE then an error has occurred. This usually means that
division by zero has occured. |
See Also
var2psi
Examples
# Example
mu = c(0.2, 0.3, 0.25);
R = xch(3,0.30);
cor2psi(R,mu)
[Package
binarySimCLF version 1.0
Index]