{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $y \\in \\R^n$, let $X_1$ be a real $n \\times p_1$ matrix and let $X_2$ be a real $n \\times p_2$ matrix.\nAssume that the block matrix $X = [X_1 \\; X_2]$ has [[rank|0ZC9YTXZRY]] $p_1 + p_2$.\nLet $\\hat\\beta_1, \\hat\\beta_2$ be the [[ordinary least squares|YM708KHV2W]] coefficients of the regression of $y$ on $X$, and let $e = y - X_1 \\hat\\beta_1 - X_2 \\hat\\beta_2$ be its residual vector.\nLet $M_1 = I_n - X_1 (X_1^T X_1)^{-1} X_1^T$, the [[orthogonal projection|0B8KZRT28M]] onto the orthogonal complement of the column space of $X_1$.\nThen:\n\n1. $\\hat\\beta_2 = (X_2^T M_1 X_2)^{-1} X_2^T M_1 y$, that is, $\\hat\\beta_2$ is the least squares coefficient of the regression of $M_1 y$ on $M_1 X_2$.\n2. The residual vector of that regression equals $e$.\n\n## Remarks\n\nMultiply $y = X_1 \\hat\\beta_1 + X_2 \\hat\\beta_2 + e$ by $M_1$.\nSince $M_1 X_1 = 0$ and $X_1^T e = 0$, this gives $M_1 y = M_1 X_2 \\hat\\beta_2 + e$.\nSince $X_2^T e = 0$ and $M_1 e = e$, the vector $e$ is orthogonal to the columns of $M_1 X_2$.\nSo the last equation is the least squares decomposition of $M_1 y$ on $M_1 X_2$.\nThe matrix $X_2^T M_1 X_2$ is invertible because $M_1$ is symmetric and [[idempotent|0KCE8CG86P]] and $M_1 X_2$ has rank $p_2$ by the rank hypothesis.\n\nExample: take $X_1$ the column of ones.\nThen $M_1$ subtracts the mean.\nThe theorem says that the slopes of a regression with intercept equal the slopes of the regression of the centred response on the centred regressors.\n\n## Explanations\n\n### L1 human\n\nIn a regression with many variables, the coefficient of one group of variables can be found in two steps.\nFirst remove from the response and from that group everything that the other variables explain.\nThen regress what is left of the response on what is left of the group.\nThe answer is the same coefficient as in the full regression.\n\n### L2 human\n\nThe theorem explains the phrase \"the effect of $X_2$ holding $X_1$ fixed\": a coefficient in a multiple regression is the slope after partialling out the other regressors.\nIt justifies centring data before a fit with intercept.\nIn econometrics it justifies removing fixed effects or trends before estimating the coefficients of interest.\nIt is a purely algebraic fact about projections, so it holds whatever the distribution of the errors.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "YM708KHV2W"
    ],
    "kind": "statement",
    "msc": [
      "62J05",
      "62P20"
    ],
    "name": "Frisch–Waugh–Lovell theorem",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q1059151",
      "wikipedia": "Frisch–Waugh–Lovell theorem"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Frisch–Waugh–Lovell_theorem"
      }
    ],
    "tag": "6C67F22FTD",
    "uses": [
      "YM708KHV2W",
      "0B8KZRT28M",
      "0KCE8CG86P",
      "0ZC9YTXZRY"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/6C67F22FTD/",
  "links": [
    {
      "field": "about",
      "target": "YM708KHV2W"
    },
    {
      "field": "uses",
      "target": "YM708KHV2W"
    },
    {
      "field": "uses",
      "target": "0B8KZRT28M"
    },
    {
      "field": "uses",
      "target": "0KCE8CG86P"
    },
    {
      "field": "uses",
      "target": "0ZC9YTXZRY"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/6C67F22FTD.md",
  "msc": [
    "62J05",
    "62P20"
  ],
  "name": "Frisch–Waugh–Lovell theorem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/6C6/6C67F22FTD.md",
  "status": null,
  "tag": "6C67F22FTD",
  "uri": "m2://6C67F22FTD",
  "url": "https://tamnd.github.io/math2/wiki/frisch-waugh-lovell-theorem/",
  "writing": {
    "tag": "6C67F22FTD",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
