Fits the LD Score regression of single-variant chi-square statistics on their LD scores, returning the intercept (the confounding-only inflation factor), the slope (polygenicity), and the confounding ratio, each with a chromosome block-jackknife standard error. The intercept is the principled calibration factor for calibrate_pvalues (method = "ldsc_intercept") and the GLOW M2 Z-scaling.

ldsc_regression(chi2, ld, chr, winsorize = 80, two_pass = TRUE)

Arguments

chi2

Numeric vector of single-variant chi-square statistics (\(Z^2\)).

ld

Numeric vector of LD scores (from compute_ld_scores), aligned to chi2.

chr

Vector (character/integer) of chromosomes, aligned to chi2; defines the jackknife blocks.

winsorize

Numeric cap applied to \(\chi^2\) inside the fit (default 80).

two_pass

Logical; if TRUE (default) use the heteroskedasticity- weighted second pass, else stop after pass 1.

Value

A one-row data.frame: n_variants, lambda_gc, mean_chi2, intercept, intercept_se, slope, slope_se, confounding_ratio, ratio_se. The intercept is the confounding-only inflation factor.

Details

The model (Bulik-Sullivan et al. 2015) is $$E[\chi^2_j] = 1 + N a + \frac{N h^2}{M}\,\ell_j,$$ where \(\ell_j\) is the LD score. The fitted intercept estimates \(1 + Na\) (here \(a\) is the model's confounding parameter – not the intercept itself); \((\mathrm{intercept} - 1)\) is the confounding contribution and the slope \(\propto h^2/M\) is polygenicity. The confounding ratio $$\mathrm{ratio} = \frac{\mathrm{intercept} - 1}{\overline{\chi^2} - 1}$$ is the fraction of the inflation due to confounding rather than polygenicity – a more robust read-out than \(\lambda_{\mathrm{GC}}\), which itself grows with \(N\) under pure polygenicity.

The fit is weighted two-pass least squares: pass 1 weights by \(1/\max(\ell, 1)\) (LD double-counting); pass 2 multiplies in a \((1 + \max(\widehat{\mathrm{slope}}, 0)\,\ell)^{-2}\) heteroskedasticity weight. Standard errors (intercept, slope, ratio) come from a chromosome block jackknife over unique(chr). \(\chi^2\) is winsorised at winsorize inside the fit for robustness; the reported lambda_gc uses the un-winsorised \(\chi^2\).

QC is the caller's responsibility. Pass already-QC'd, matched (chi2, ld, chr) (standard LDSC QC: common variants, e.g. \(\mathrm{MAF} \ge 0.01\); exclude the MHC; keys matched to the LD-score table). Non-finite (chi2, ld) pairs are dropped.

References

Bulik-Sullivan B. et al. (2015). LD Score regression distinguishes confounding from polygenicity in GWAS. Nat Genet 47:291.

Examples

set.seed(1)
ld  <- stats::rgamma(5000, shape = 2, scale = 30)            # LD scores
chr <- rep(1:22, length.out = 5000)
chi2 <- stats::rchisq(5000, df = 1, ncp = 0) + 0.08 + 5e-4 * ld  # intercept ~1.08
fit <- ldsc_regression(chi2, ld, chr)
fit$intercept            # ~1.08 (the confounding-only factor)
#> [1] 1.037515