◀ CONTENTSSTA503 · VOL.3EP.1 · Median testMISSIONS 0/2LV 10 XP
VOL.3 · EP.1 · §3.1

Median test

/StatsMadeFun/sta503/vol-3/median
SENSEI RANK
Yes. A and B are the counts above the grand median, C and D are the counts below. Then it becomes a chi-square test on that table.
Median test
Two mamak stalls, two teh tarik prices. Farah surveyed prices in Shah Alam and in Subang.
FARAH
FARAH
Harga median dua kawasan ni sama tak?
SENSEI RANK
SENSEI RANK
Pool both samples and find the grand median. If the two medians are equal, each sample should have about half its values above it.
キィン
KIIN
MIKEY
MIKEY
So kita buat 2×2 table: above or not, sample 1 or sample 2.
ゴゴゴ
GOGOGO
SENSEI RANK
SENSEI RANK
Yes. A and B are the counts above the grand median, C and D are the counts below. Then it becomes a chi-square test on that table.
READ THE NOTES

Use it when

Testing whether two independent populations have the same median. It only uses whether each value is above the grand median, so it is very robust and works with ordinal data.

Assumptions

  • Two independent random samples of sizes n₁ and n₂.
  • Measurement at least ordinal; variable continuous.
  • The populations have the same shape (if their medians are equal, each has the same probability p of exceeding the grand median).

Hypotheses

H₀: M₁ = M₂ vs H₁: M₁ ≠ M₂

Test statistic

Combine the samples and find the grand median. Count values above it in each sample.

Sample 1Sample 2Total
AboveABA + B
BelowCDC + D
Totaln₁n₂N
Exact: P(A, B) = C(n₁, A)·C(n₂, B) / C(N, A + B) (hypergeometric) Large sample: X² = N(AD − BC)² / [n₁ n₂ (A + B)(C + D)], df = 1

Decision rule

Reject H₀ if X² ≥ χ²₁,₁₋α (3.841 at α = 0.05).

Values equal to the grand median: the usual convention is to count them as "below" (that is, "not above"), which is what the missions here do.

START THE MISSIONS
MISSION 1 OF 2

Teh tarik prices

+30 XP
HOW TO PLAY

Work the procedure by hand on the data shown. Fill every box, then press CHECK. NEW DATA deals a fresh problem; SHOW SOLUTION gives the full working.

CLEARS WHENEvery box correct on one set of data.
Loading mission engine...

ALL MISSIONS IN THIS EPISODE