R_ldsc: Calculate matrix of error correlations using LD-score...

View source: R/estimate_R.R

R_ldscR Documentation

Calculate matrix of error correlations using LD-score regression.

Description

Calculate matrix of error correlations using LD-score regression.

Usage

R_ldsc(
  Z_hat,
  ldscores,
  ld_size,
  N,
  return_gencov = FALSE,
  make_well_conditioned = TRUE,
  cond_num = 1e+05 - 1,
  blocks = NULL,
  ncores = 1
)

Arguments

Z_hat

matrix of z-scores

ldscores

vector of ldscores

ld_size

Number of variants used to compute ldscores

N

vector of sample sizes, length equal to number of columns of Z_hat

return_gencov

If TRUE, the function will return genetic covariance in addition to residual covariance/correlation.

make_well_conditioned

If TRUE, residual covariance will be projected to the nearest positive definite matrix with condition number at least cond_num

cond_num

Condition number used if make_well_conditioned = TRUE

blocks

If not NULL, use jackknife to estimate the standard error of estimates.

ncores

Number of cores to use for jackknifing

Value

A list with some or all of the following elements. Se: Estimate of residual covariance Ve: Variance of Se. Sg: genetic covariance Vg: Variance fo Sg. Rg: Genetic correlation, VRg: Variance of Rg.


jean997/sumstatFactors documentation built on Jan. 24, 2025, 4:42 a.m.