{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $k \\ge 2$ and $n_1, \\dots, n_k \\ge 1$, with $N = n_1 + \\cdots + n_k \u003e k$.\nLet $y_{ij}$, for $i = 1, \\dots, k$ and $j = 1, \\dots, n_i$, be observations of $k$ groups.\nLet $\\bar y_i = \\frac{1}{n_i} \\sum_j y_{ij}$ be the mean of group $i$ and $\\bar y = \\frac{1}{N} \\sum_{i,j} y_{ij}$ the overall mean.\nThe *one-way analysis of variance* is the decomposition\n$$\\sum_{i=1}^k \\sum_{j=1}^{n_i} (y_{ij} - \\bar y)^2 = \\sum_{i=1}^k n_i (\\bar y_i - \\bar y)^2 + \\sum_{i=1}^k \\sum_{j=1}^{n_i} (y_{ij} - \\bar y_i)^2,$$\nwritten $SS_{\\mathrm{tot}} = SS_{\\mathrm{between}} + SS_{\\mathrm{within}}$, together with the statistic\n$$F = \\frac{SS_{\\mathrm{between}} / (k - 1)}{SS_{\\mathrm{within}} / (N - k)},$$\ndefined when $SS_{\\mathrm{within}} \u003e 0$.\nConsider the model $y_{ij} = \\mu_i + \\varepsilon_{ij}$ with independent errors $\\varepsilon_{ij} \\sim N(0, \\sigma^2)$.\nThe *ANOVA $F$-test* of level $\\alpha$ rejects the hypothesis $\\mu_1 = \\cdots = \\mu_k$ when $F$ is large.\nThe threshold is the upper $\\alpha$-quantile of the [[F-distribution|PBT8VRJADK]] with $k - 1$ and $N - k$ degrees of freedom.\n\n## Remarks\n\nThe decomposition holds because, inside each group, the deviations $y_{ij} - \\bar y_i$ sum to zero, so the cross term vanishes.\nUnder the hypothesis of equal means and [[normal|05AQE0QR0D]] errors, $F$ has the $F$-distribution with $k - 1$ and $N - k$ degrees of freedom.\n\nExample: groups $\\{1, 2, 3\\}$ and $\\{4, 5, 6\\}$, so $k = 2$, $N = 6$, $\\bar y_1 = 2$, $\\bar y_2 = 5$, $\\bar y = 3.5$.\nThen $SS_{\\mathrm{between}} = 3 \\cdot 1.5^2 + 3 \\cdot 1.5^2 = 13.5$ and $SS_{\\mathrm{within}} = 2 + 2 = 4$.\nTheir sum $17.5$ equals $\\sum (y - 3.5)^2 = 2(6.25 + 2.25 + 0.25)$.\nSo $F = 13.5 / (4/4) = 13.5$ on $1$ and $4$ degrees of freedom.\n\nNon-example: if the groups have very different error variances, the hypothesis of a common $\\sigma^2$ fails.\nThen $F$ no longer has the $F$-distribution under equal means, and Welch's test is used instead.\n\nThe same idea extends to several factors, with one sum of squares for each main effect and interaction.\nAll these fixed-effects analyses are special cases of the [[general linear model|A06SGFCSCE]].\nWith $k = 2$, the $F$ statistic is the square of the two-sample $t$ statistic with pooled variance.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "M9AQ5HKGP4",
    "kind": "definition",
    "msc": [
      "62J10"
    ],
    "name": "Analysis of variance",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Analysis_of_variance"
      }
    ],
    "tag": "GWGFT35TCZ",
    "uses": [
      "A06SGFCSCE",
      "8MTVCMAATD",
      "PBT8VRJADK",
      "05AQE0QR0D",
      "03Y6AQ2S0J"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/GWGFT35TCZ/",
  "links": [
    {
      "field": "defines",
      "target": "M9AQ5HKGP4"
    },
    {
      "field": "uses",
      "target": "A06SGFCSCE"
    },
    {
      "field": "uses",
      "target": "8MTVCMAATD"
    },
    {
      "field": "uses",
      "target": "PBT8VRJADK"
    },
    {
      "field": "uses",
      "target": "05AQE0QR0D"
    },
    {
      "field": "uses",
      "target": "03Y6AQ2S0J"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/GWGFT35TCZ.md",
  "msc": [
    "62J10"
  ],
  "name": "Analysis of variance",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/GWG/GWGFT35TCZ.md",
  "status": null,
  "tag": "GWGFT35TCZ",
  "uri": "m2://GWGFT35TCZ",
  "url": "https://tamnd.github.io/math2/wiki/analysis-of-variance-definition/",
  "writing": {
    "tag": "GWGFT35TCZ",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
