{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $X_1, \\dots, X_m$ be [[i.i.d.|0AJN7WHBJZ]] with continuous [[distribution function|0MXMS3AE13]] $F$, and let $Y_1, \\dots, Y_n$ be i.i.d. with continuous distribution function $G$, independent of the $X_i$.\nThe *Mann–Whitney statistic* is\n$$U = \\#\\set{(i, j) : 1 \\le i \\le m, \\ 1 \\le j \\le n, \\ X_i \u003e Y_j}.$$\nThe *Mann–Whitney U test* of $H_0 \\colon F = G$ rejects $H_0$ when $U$ is far from $mn/2$.\nFor a one-sided alternative it rejects only when $U$ is large, or only when $U$ is small.\nUnder $H_0$ the law of $U$ depends only on $m$ and $n$.\n\n## Remarks\n\nLet $R_X$ be the sum of the ranks of $X_1, \\dots, X_m$ in the pooled sample of size $m + n$.\nThen $U = R_X - m(m+1)/2$, so the test is the same as the Wilcoxon rank-sum test.\nUnder $H_0$, $E[U] = mn/2$ and $\\operatorname{Var}(U) = mn(m + n + 1)/12$, and $U$ is asymptotically normal.\nThe ratio $U/(mn)$ is an unbiased estimator of $P(X_1 \u003e Y_1)$, and $U$ is a two-sample [[U-statistic|NTVQB1DC56]].\nWith ties, each tied pair counts $1/2$.\n\nExample: $X = (3, 5)$ and $Y = (1, 4)$.\nThe pairs with $X_i \u003e Y_j$ are $(3, 1)$, $(5, 1)$ and $(5, 4)$, so $U = 3$.\nIn the pooled order $1, 3, 4, 5$ the $X$ values have ranks $2$ and $4$, and $R_X - 3 = 6 - 3 = 3$ agrees.\n\nNon-example: measurements of the same subjects before and after a treatment are not independent samples.\nThe clause on independence fails, and the [[Wilcoxon signed-rank test|38SETDT2HN]] on the differences is used instead.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "CKF9KDXBP7",
    "kind": "definition",
    "msc": [
      "62G10"
    ],
    "name": "Mann–Whitney U test",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test"
      }
    ],
    "tag": "8GWEWBZE9P",
    "uses": [
      "087P03NEND",
      "0AJN7WHBJZ",
      "0MXMS3AE13"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/8GWEWBZE9P/",
  "links": [
    {
      "field": "defines",
      "target": "CKF9KDXBP7"
    },
    {
      "field": "uses",
      "target": "087P03NEND"
    },
    {
      "field": "uses",
      "target": "0AJN7WHBJZ"
    },
    {
      "field": "uses",
      "target": "0MXMS3AE13"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/8GWEWBZE9P.md",
  "msc": [
    "62G10"
  ],
  "name": "Mann–Whitney U test",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/8GW/8GWEWBZE9P.md",
  "status": null,
  "tag": "8GWEWBZE9P",
  "uri": "m2://8GWEWBZE9P",
  "url": "https://tamnd.github.io/math2/wiki/mann-whitney-u-test-definition/",
  "writing": {
    "tag": "8GWEWBZE9P",
    "kind": "definition",
    "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
      }
    ]
  }
}
