Skip to contents

This function calculates the correlation matrix (LD matrix) from individual level data.

Usage

get_cormat(X, intercepte = TRUE)

Arguments

X

A matrix of individual level data.

intercepte

A logical value indicating whether to include an intercept in the model. Default is FALSE.

Value

A correlation matrix (LD matrix).

See also

Examples

# colocboost example
set.seed(1)
N <- 1000
P <- 100
# Generate X with LD structure
sigma <- 0.9^abs(outer(1:P, 1:P, "-"))
X <- MASS::mvrnorm(N, rep(0, P), sigma)
cormat <- get_cormat(X)