Computes the linkage disequilibrium (correlation) matrix from genotype data.
Usage
get_correlation(X, intercept = FALSE)
Arguments
- X
Genotype matrix (samples × SNPs).
- intercept
Logical; if FALSE (default), centers each variable before calculating correlations.
Value
A correlation matrix representing the LD structure.
Examples
G <- matrix(rbinom(1000, 2, 0.5), nrow = 100, ncol = 10)
LD <- get_correlation(G)