Learn R Programming

colocboost (version 1.0.7)

get_cormat: A fast function to calculate correlation matrix (LD matrix) from individual level data

Description

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

Usage

get_cormat(X, intercepte = TRUE)

Value

A correlation matrix (LD matrix).

Arguments

X

A matrix of individual level data.

intercepte

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

See Also

Other colocboost_utilities: get_cos(), get_cos_purity(), get_cos_summary(), get_hierarchical_clusters(), get_ucos_summary()

Examples

Run this code
# 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)

Run the code above in your browser using DataLab