liveBook · Manning

Covariance

As explained in Causal Inference for Data Science

Covariance is a measure of the joint variation of two random variables.

Covariance measures how two random variables vary together. It links variance, correlation, and regression, while causal diagrams show that correlation can propagate along confounder, mediator, and collider structures differently from causal effects. section 6.2.2

Useful identities connect covariance to common statistical calculations:

  • Variance is self-covariance: var(X) = cov(X, X). section 6.2.2
  • Scaling gives var(aX) = a² var(X), while covariance distributes across linear combinations: cov(aX + bY, Z) = a cov(X, Z) + b cov(Y, Z). section 6.2.2
  • For a regression M ~ R, the slope is cov(M, R) / var(R). With standardized variables, covariance equals correlation. section 6.2.2 section 9.2.1

Covariance in instrumental variables

An instrumental-variable calculation uses cov(D, Z) / var(Z) for the regression D ~ Z and cov(Y, Z) / var(Z) for Y ~ Z. Dividing these coefficients cancels var(Z), producing the ratio cov(Y, Z) / cov(D, Z) for the causal-effect estimator described by the model. section 9.2.1

Table 6.12 Differences between causal paths (dashed lines) and correlation propagation (double-headed arrows)
Case
Causal paths
Correlation propagation
Confounder
sidebar figure
sidebar figure
Mediator
sidebar figure
sidebar figure
Collider
sidebar figure
sidebar figure

Compare confounder, mediator, and collider cases to see how causal paths differ from correlation propagation. section 6.2.2

How Causal Inference for Data Science covers it

How deep it goes
Defines algebraic identities and regression formulas, then applies them to causal graphs and instrumental variables without software implementation.
Examples
Uses confounder, mediator, and collider diagrams alongside regression calculations and an instrumental-variable covariance ratio.
What it assumes
Assumes familiarity with random variables and linear regression while reminding readers of variance, covariance, correlation, and standardization equations.
What you can do after
Evaluate/understand covariance identities, interpret standardized correlations, and follow covariance-based regression and instrumental-variable calculations.
How it connects
Relates covariance to variance, correlation, standardization, linear regression, causal paths, confounding, mediation, colliders, and instrumental variables.

Also explained in

Compare how 5 books explain covariance →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal Inference for Data Science. The section links point to the parts of the book it draws on.