Skip to content

9709 · Unit 32 · Paper 6: Probability and Statistics 2

Hypothesis tests.

9709 · Unit 32 · Hypothesis tests
Revisionbyexamplicity

Hypotheses, tails and rejection regions

§6.5 · Hypothesis tests

A new filter is meant to cut stray pulses. A few quiet minutes could be luck. A hypothesis test asks: if nothing had changed, how unlikely would a result like this be? If it is unlikely enough, you have evidence of a change.

1Write H₀ and H₁ about a population parameter

H₀ (the null hypothesis) fixes the parameter at its old value. H₁ (the alternative) says which way it may have changed: the direction comes from the question, before you look at the data.
θ is the mean stray-pulse count per five minutes, with reference value 3. Three independent five-minute records, each Po(θ), give 0, 1 and 2 pulses.
Record 15 minutes0 pulsesRecord 25 minutes1 pulseRecord 35 minutes2 pulsesS = 0 + 1 + 2 = 3 pulsesThree independent counts; one aggregate statistic.Record 15 minutes0 pulsesRecord 25 minutes1 pulseRecord 35 minutes2 pulsesS = 0 + 1 + 2 = 3 pulsesThree independent counts; one aggregate statistic.
  1. The old mean per five-minute record
    H₀: θ=3
  2. Answer
    θ<3 under H₁The filter should reduce it.
H₀: θ=3The old mean per five-minute record.θ<3 under H₁The filter should reduce it.
QuantityWhat it is
θUnknown population mean per five minutes
S = Y₁ + Y₂ + Y₃Random total: the test statistic
s = 0 + 1 + 2 = 3The observed value of S
ParameterH₀H₁ for the question asked
Flag probability pp = 0.25p > 0.25: has it increased?
Mean reading μμ = 52μ > 52: has it increased?
Mean reading μμ = 52μ ≠ 52: has it changed at all?
Hypotheses are about the population. “H₀: S = 3” or “H₀: p = 8/16” fixes a sample result, not a parameter.

2Choose the tail and the rejection region

The rejection region (critical region) holds the results that lead you to reject H₀. It sits in the direction of H₁, and its probability is worked out assuming H₀ is true.
Lower: μ < μ₀density−2025%Upper: μ > μ₀density−2025%Two-sided: μ ≠ μ₀density−2022.5% in each tailLower: μ < μ₀density−2025%Upper: μ > μ₀density−2025%Two-sided: μ ≠ μ₀density−2022.5% + 2.5%
H₁ says the mean is5% rejection rule for Z ~ N(0, 1)Probability under H₀
lowerZ ≤ −1.6448540.05 in the lower tail
higherZ ≥ 1.6448540.05 in the upper tail
different (two-tailed)Z ≤ −1.96 or Z ≥ 1.96about 0.025 in each tail
  1. 1
    A critical value is the boundary of the region.
  2. 2
    The acceptance region is everything else: not enough evidence against H₀, which is not proof of H₀.
  3. 3
    For counts the region is whole numbers, and its probability may fall below 5% (page 2).

3Know what 5% means, then conclude in context

A 5% significance level means the rule rejects a true H₀ in about 5% of samples. It is not a 5% chance that H₀ is true, or that this decision is wrong.
ResultDecisionWrite, in context
In the rejection regionReject H₀There is evidence at the 5% level that the mean count is below 3.
Not in the regionDo not reject H₀There is insufficient evidence at the 5% level that the mean count is below 3.
Never write “H₀ is true” or “this proves H₁”. A test weighs evidence; it does not settle the truth.

4Try it

Your turn

1 A spinner is said to land red with probability 0.3. Ana thinks it lands red less often. Write H₀ and H₁.

2 Bags are labelled with mean mass 500 g. Test at 5% whether the mean has changed. Write H₀ and H₁ and the rejection rule for Z.

3 A one-tailed test of H₀: μ = 500 against H₁: μ > 500 at 5% gives z = 1.2. Write the conclusion.

  1. 1
    H₀: p = 0.3; H₁: p < 0.3
  2. 2
    H₀: μ = 500; H₁: μ ≠ 500; reject if Z ≤ −1.96 or Z ≥ 1.96
  3. 3
    1.2 < 1.645: do not reject H₀. There is insufficient evidence at the 5% level that the mean mass is above 500 g
Tick what you can do now
  • not yet? step 1
  • not yet? step 2
  • not yet? step 3
Practise with s26/61 Q2(a); s26/62 Q3(a), Q6(a); s26/65 Q6(b)(i); s26/62 Q3(b), Q3(c); s26/61 Q4(d); s26/65 Q5(a), Q6(b)(i)
1 / 6
9709 · Unit 32 · Hypothesis tests
Revisionbyexamplicity

Exact tests for a binomial or Poisson count

§6.5 · Hypothesis tests

With a count, you can add up exactly how likely a result this extreme would be if H₀ were true. If that tail probability is below the significance level, the result is in the rejection region.

1Binomial: add the upper tail from the observed count

Testing for an increase: find P(X ≥ observed) under H₀. Include the observed count and every larger one.
Worked example

A circuit returns a flag on each independent check, with constant probability p. Let X count flags in 16 checks; 8 are observed. Test H₀: p = 0.25 against H₁: p > 0.25 at the 5% level.

1010101010101010One observed sequence: 8 flags in 16 trials.
  1. Write the upper-tail probability
    X ~ Bin(16, 0.25)P(X ≥ 8)=P(8) + P(9) + … + P(16)
  2. Evaluate and compare with the level
    P(X ≥ 8)=0.0271 < 0.05

    ∴a count this high would be unlikely if p were 0.25

  3. Answer
    reject H₀: there is evidence at the 5% level that p is greater than 0.25
Under H₀: Bin(16, 0.25)probability00.10.2047812167.5 boundaryInclusive upper tail starts at the observed X = 8.
✓Check P(X ≥ 7) = 0.0796 is above 0.05, so 8 is the smallest count that rejects.
P(X = 8) alone leaves out larger counts that also point to an increase. And the test says p is above 0.25, not that p equals 8/16.

2Poisson: total the records, then add the lower tail

Several independent Poisson records add to one Poisson total. Testing for a reduction: find P(S ≤ observed) under H₀.
Worked example

A filter test records three independent five-minute counts, 0, 1 and 2 stray pulses, each Po(θ). Let S be their total. Test H₀: θ = 3 against H₁: θ < 3 at the 5% level.

  1. Find the distribution of the total
    s=0 + 1 + 2 = 3mean of S under H₀=3 × 3 = 9S ~ Po(9)
  2. Write the lower-tail probability
    P(S ≤ 3)=P(0) + P(1) + P(2) + P(3)=e⁻⁹(1 + 9 + 81/2 + 729/6)=0.0212
  3. Compare with the level
    0.0212 < 0.05

    ∴a total this low would be unlikely if θ were 3

  4. Answer
    reject H₀: there is evidence at the 5% level that the mean count per five minutes is below 3
Under H₀: S ~ Po(9)probability00.10.2034812163.5 boundaryObserved S = 3 belongs to the lower tail.
✓Check P(S ≤ 4) = 0.0550 is above 0.05, so 3 is the largest total that rejects.
The model needs independent records and one steady Poisson rate. If pulses cluster or the rate drifts, the null model needs rethinking.

3Find the critical count: check the next one

The critical region is the largest tail whose probability under H₀ is at most 0.05. Adding the next count adds a whole bar, so test that neighbour.
Null: S ~ Po(9)probability00.10.2034812163.5 boundaryBlue: S ≤ 3; outlined next count: 4Null: X ~ Bin(16, 0.25)probability00.10.2047812167.5 boundaryBlue: X ≥ 8; outlined next count: 7Null: S ~ Po(9)probability00.10.2034812163.5 boundaryBlue: S ≤ 3; outlined next count: 4Null: X ~ Bin(16, 0.25)probability00.10.2047812167.5 boundaryBlue: X ≥ 8; outlined next count: 7
  1. Po(9): within 5%
    P(S ≤ 3)≈0.021226
  2. The next bar
    P(S = 4)=e−9×944!
  3. 0.054964 > 0.05: 4 is out
    P(S ≤ 4)≈0.054964
  4. Answer
    Reject for S ≤ 3.The critical count is 3.
P(S ≤ 3)≈0.021226Po(9): within 5%.P(S = 4)=e−9×944!The next bar.P(S ≤ 4)≈0.0549640.054964 > 0.05: 4 is out.Reject for S ≤ 3.The critical count is 3.
  1. Bin(16, 0.25): within 5%
    P(X ≥ 8)≈0.027130
  2. The next bar
    P(X = 7)=(167)×(14)7×(34)9
  3. 0.079557 > 0.05: 7 is out
    P(X ≥ 7)≈0.079557
  4. Answer
    Reject for X ≥ 8.The critical count is 8.
P(X ≥ 8)≈0.027130Bin(16, 0.25): within 5%.P(X = 7)=(167)×(14)7×(34)9The next bar.P(X ≥ 7)≈0.0795570.079557 > 0.05: 7 is out.Reject for X ≥ 8.The critical count is 8.
TestNominal levelActual probability of rejecting a true H₀
Poisson reduction, S ≤ 35%0.021226… ≈ 2.12%
Binomial increase, X ≥ 85%0.027129… ≈ 2.71%
Check tails, not single bars. A small bar on its own does not make a rejection region.

4Try it

Your turn

1 X ~ Bin(10, p). Test H₀: p = 0.5 against H₁: p > 0.5 at 5%, when X = 9.

2 Calls arrive as Po(λ) per day. Two independent days give 1 and 2 calls in total 3. Test H₀: λ = 4 against H₁: λ < 4 at 5%.

3 X ~ Bin(20, 0.3) under H₀. Find the 5% critical region for H₁: p > 0.3, and its actual size.

  1. 1
    P(X ≥ 9) = 11/1024 ≈ 0.0107 < 0.05: reject H₀; evidence at the 5% level that p > 0.5
  2. 2
    S ~ Po(8); P(S ≤ 3) ≈ 0.0424 < 0.05: reject H₀; evidence at the 5% level that the mean is below 4 a day
  3. 3
    P(X ≥ 10) ≈ 0.0480 but P(X ≥ 9) ≈ 0.1133: reject for X ≥ 10; actual size 0.0480
Tick what you can do now
Practise with s26/61 Q2(a); s26/62 Q3(a), Q3(b) (related Poisson test practice); s26/62 Q3(c); s26/63 Q2(a) (related exact lower-tail practice); s26/65 Q5(a), Q5(b)
2 / 6
9709 · Unit 32 · Hypothesis tests
Revisionbyexamplicity

Normal approximations in count tests

§6.5 · Hypothesis tests

Adding forty exact binomial terms is slow. When the count is large, its bars follow a normal curve closely, so one normal tail does the job. The bars are whole numbers, so the boundary moves half a unit: the continuity correction.

1Binomial: use N(np, np(1 − p))

Use it when np and n(1 − p) are both above 5. X ≥ 40 covers the whole bar at 40, so it becomes Y > 39.5.
Worked example

A run has 80 independent checks, each flagged with probability p. Test H₀: p = 0.4 against H₁: p > 0.4 at the 5% level. The observed flag count is 40. Use a normal approximation.

  1. Find the null mean and variance
    X ~ Bin(80, 0.4)mean=80 × 0.4 = 32variance=80 × 0.4 × 0.6 = 19.2
  2. Apply the continuity correction
    X ≥ 40 becomes Y > 39.5
  3. Standardise and find the upper tail
    z=(39.5 − 32) ÷ √19.2=1.7116P(Y > 39.5)=1 − Φ(1.7116) = 0.0435

    ∴0.0435 < 0.05

  4. Answer
    reject H₀: there is evidence at the 5% level that p is above 0.4
Bin(80, 0.4) → N(32, 19.2)39.5Integer probability24324048Continuous density; aligned x scale
✓Check The exact tail P(X ≥ 40) = 0.0445: the same decision, but not the same value.
For the critical region, try the next count: X ≥ 39 uses 38.5, z = 1.4834, tail 0.068982 > 0.05. So the approximate rule is X ≥ 40, with estimated size about 4.35%.

2Poisson: use N(λ, λ) for a large mean

Use it when λ is above 15. Mean and variance are both λ, so the SD is √λ, not λ. X ≤ 15 covers the bar at 15, so it becomes Y < 15.5.
A busy channel has a reference mean of 24 pulses per ten minutes. Test H₀: λ = 24 against H₁: λ < 24 at 5%; one ten-minute count is 15.
Po(24) → N(24, 24)15.5Integer probability1216243240Continuous density; aligned x scale
  1. Steady, independent events; 24 > 15
    X ~ Po(24) under H₀ ≈ Y ~ N(24, 24)
  2. X ≤ 15 becomes Y < 15.5
    z=15.5−2424
  3. Lower tail
    z≈−1.7351
  4. Answer
    P(Y < 15.5)≈0.0413660.041366 < 0.05: reject H₀.
X ~ Po(24) under H₀ ≈ Y ~ N(24, 24)Steady, independent events; 24 > 15.z=15.5−2424X ≤ 15 becomes Y < 15.5.z≈−1.7351Lower tail.P(Y < 15.5)≈0.0413660.041366 < 0.05: reject H₀.
There is evidence at the 5% level that the mean count per ten minutes is below 24. The exact Poisson tail is 0.034400…: an approximation need not match the exact value.
  1. 1
    Next count: X ≤ 16 uses 16.5, z = −1.5309, tail 0.062893 > 0.05. The approximate region is X ≤ 15, size about 4.14%.
  2. 2
    Do not use 14.5 for X ≤ 15.

3Try it

Your turn

1 X ~ Bin(50, p). Test H₀: p = 0.5 against H₁: p > 0.5 at 5%, when X = 32, using a normal approximation.

2 X ~ Po(λ) per hour. Test H₀: λ = 30 against H₁: λ < 30 at 5%, when X = 21, using a normal approximation.

  1. 1
    N(25, 12.5); z = (31.5 − 25) ÷ √12.5 ≈ 1.838; 1 − Φ(1.838) ≈ 0.0330 < 0.05: reject H₀; evidence at the 5% level that p > 0.5
  2. 2
    N(30, 30); z = (21.5 − 30) ÷ √30 ≈ −1.552; Φ(−1.552) ≈ 0.0603 > 0.05: do not reject H₀; insufficient evidence at the 5% level that the mean is below 30 an hour
Tick what you can do now
Practise with s26/63 Q2(a) (related test decision); s26/61 Q4(d) (related normal comparison); s26/62 Q3(b) (related critical-count reasoning); s26/62 Q4(c) (related normal approximation)
3 / 6
9709 · Unit 32 · Hypothesis tests
Revisionbyexamplicity

Testing a population mean

§6.5 · Hypothesis tests

A new setting is meant to raise the mean reading. One sample mean of 54 against an old 52 looks higher, but sample means wobble. The test asks how many standard errors 54 sits above 52.

1Known σ: standardise x̄ with SE = σ/√n

Under H₀, X̄ ~ N(μ₀, σ²/n). Use z = (x̄ − μ₀) ÷ (σ/√n) and compare with the critical value. No continuity correction: readings are continuous.
Worked example

Calibration readings are independent observations from N(μ, 6²). Test H₀: μ = 52 against H₁: μ > 52 at the 5% level, using n = 36 readings with sample mean 54. The upper 5% point of N(0, 1) is about 1.645.

  1. Find the standard error
    SE=6 ÷ √36 = 1
  1. Standardise and compare
    z=(54 − 52) ÷ 1 = 2 > 1.645
  2. Answer
    reject H₀: there is evidence at the 5% level that the population mean reading is above 52
(b)

Find the critical value c for the sample mean.

  1. Use the upper 5% point
    c=52 + 1 × 1.645≈53.645
  1. Answer
    reject for x̄ > c ≈ 53.645; the observed 54 rejects
X̄ ~ N(52, 1) under H₀density485052565853.644854observed 54Mean scale: no continuity correction.X̄ ~ N(52, 1) under H₀density485052565853.644854observed 54Mean scale: no continuity correction.

2Two-tailed: split the 5% between the tails

For H₁: μ ≠ 52, put 2.5% in each tail: z = ±1.96. The mean boundaries are 52 − 1.96 = 50.04 and 52 + 1.96 = 53.96. The mean 54 also rejects.
X̄ ~ N(52, 1) under H₀density485052565850.0453.96observed 54Mean scale: no continuity correction.X̄ ~ N(52, 1) under H₀density485052565850.0453.96observed 54Mean scale: no continuity correction.

3Unknown variance: estimate it from a large sample

With a large random sample, the CLT makes X̄ approximately normal and s² can stand in for σ². The test is then approximate.
A separate sample of 64 readings has Σ(x − 50) = 64 and Σ(x − 50)² = 631. Test H₀: μ = 52 against H₁: μ < 52 at 5%.
  1. Add the coding back
    x̄=50+6464 = 51
  2. Correction 64²/64 = 64; divide by n − 1
    s²=631−6463 = 9
  3. SE ≈ 0.375
    estimated SE=964 = 38
  4. Null mean, estimated SE
    z=51−5238 ≈ −2.667
  5. Answer
    −2.667 < −1.645: reject H₀Lower 5% critical value.
x̄=50+6464 = 51Add the coding back.s²=631−6463 = 9Correction 64²/64 = 64; divide by n − 1.estimated SE=964 = 38SE ≈ 0.375.z=51−5238 ≈ −2.667Null mean, estimated SE.−2.667 < −1.645: reject H₀Lower 5% critical value.
Approximate X̄ under H₀: N(52, 9/64)density515253Observed 51 is below the lower critical boundary.
There is evidence at the 5% level that the population mean reading is less than 52. The conclusion is approximate: a small sample with unknown variance would not justify this test.

4Try it

Your turn

1 Readings are N(μ, 4²). A sample of 16 has x̄ = 101.8. Test H₀: μ = 100 against H₁: μ > 100 at 5%.

2 Repeat with H₁: μ ≠ 100.

3 A large sample of 100 has x̄ = 19.6 and s² = 4. Test H₀: μ = 20 against H₁: μ < 20 at 5%.

  1. 1
    SE = 1; z = 1.8 > 1.645: reject H₀; evidence at the 5% level that the mean is above 100
  2. 2
    1.8 < 1.96: do not reject H₀; insufficient evidence at the 5% level that the mean has changed
  3. 3
    SE ≈ √(4/100) = 0.2; z = −2 < −1.645: reject H₀; evidence at the 5% level that the mean is below 20
Tick what you can do now
Practise with s26/62 Q6(a), Q6(b); s26/65 Q6(b)(i), Q6(b)(ii); s26/61 Q4(d); s26/63 Q5(a), Q5(b)
4 / 6
9709 · Unit 32 · Hypothesis tests
Revisionbyexamplicity

Type I and Type II errors

§6.5 · Hypothesis tests

A test can go wrong two ways: cry wolf, or miss the wolf. A Type I error rejects H₀ when H₀ is true. A Type II error fails to reject H₀ when it is false. A fixed rule gives each a probability.

1Name the error from the truth and the decision

The data choose the row (your decision). The unknown truth chooses the column. You never see the column for certain.
Decision for the filter testIf θ = 3 is trueIf θ = 1.5 is true
S = 3: reject H₀Type I error: a reduction claimed that did not happenCorrect: the reduction is found
S = 5: do not reject H₀CorrectType II error: the reduction is missed
The observed total was 3, so H₀ was rejected. Only a Type I error is possible after rejecting; a Type II error needs a non-rejection. The same holds for 8 flags in 16 under the rule X ≥ 8.

2Type I: the rejection tail under H₀

P(Type I error) = P(result in the rejection region, given H₀ is true). For counts this is the actual size, often below the nominal 5%.
  1. The rule rejects 0, 1, 2 or 3
    α=P(S ≤ 3 when θ = 3)
  2. When θ = 3, the total of three records is Po(9)
    α=∑k=03(e−99kk!)
  3. Answer
    α≈0.021226About 2.12%.
α=P(S ≤ 3 when θ = 3)The rule rejects 0, 1, 2 or 3.α=∑k=03(e−99kk!)When θ = 3, the total of three records is Po(9).α≈0.021226About 2.12%.
Rule and null modelP(Type I error)
S ≤ 3 under Po(9) (H₀: θ = 3 against θ < 3)0.021226…, exact Poisson rule
X ≥ 8 under Bin(16, 0.25) (H₀: p = 0.25 against p > 0.25)0.027129…, exact binomial rule
X̄ ≥ 53.644854… under N(52, 1) (H₀: μ = 52 against μ > 52; σ = 6, n = 36)0.05, continuous rule
α is not the probability that H₀ is true: working it out starts by assuming H₀ is true.

3Type II for the Poisson rule: keep the rule, change the distribution

Take a stated true value, keep reject for S ≤ 3, and find the chance of not rejecting. At θ = 1.5, S ~ Po(3 × 1.5) = Po(4.5), and a miss is S ≥ 4.
Null θ = 3: S ~ Po(9)probability00.10.2034812163.5 boundaryα: reject a true H₀Same rule; the true distribution changes.True θ = 1.5: S ~ Po(4.5)probability00.10.2034812163.5 boundaryβ: fail to rejectSame rule; the true distribution changes.Null θ = 3: S ~ Po(9)probability00.10.2034812163.5 boundaryα: reject a true H₀Same rule; the true distribution changes.True θ = 1.5: S ~ Po(4.5)probability00.10.2034812163.5 boundaryβ: fail to rejectSame rule; the true distribution changes.
  1. The non-rejection region under the true value
    β=P(S ≥ 4 when θ = 1.5)
  2. Lower tail of Po(4.5)
    P(S ≤ 3 at θ = 1.5)=∑k=03(e−92(92)kk!)
  3. Keep guard digits
    P(S ≤ 3 at θ = 1.5)≈0.342296
  4. Answer
    β≈0.657704About 65.8% of tests miss this reduction.
β=P(S ≥ 4 when θ = 1.5)The non-rejection region under the true value.P(S ≤ 3 at θ = 1.5)=∑k=03(e−92(92)kk!)Lower tail of Po(4.5).P(S ≤ 3 at θ = 1.5)≈0.342296Keep guard digits.β≈0.657704About 65.8% of tests miss this reduction.
  1. 1
    In context: concluding there is insufficient evidence of a reduction when the mean is really 1.5 per five minutes.
  2. 2
    H₁: θ < 3 holds many values; β needs one stated true value.
  3. 3
    β describes the rule over future samples. It does not turn this rejecting test into a Type II error.

4Type II for the binomial rule: the miss is the lower part

The rule X ≥ 8 rejects large counts, so a miss is X ≤ 7, including 7. Use the true p = 0.5.
Null p = 0.25: Bin(16, 0.25)probability00.10.2047812167.5 boundaryα: reject a true H₀Same rule; the true distribution changes.True p = 0.5: Bin(16, 0.5)probability00.10.2047812167.5 boundaryβ: fail to rejectSame rule; the true distribution changes.Null p = 0.25: Bin(16, 0.25)probability00.10.2047812167.5 boundaryα: reject a true H₀Same rule; the true distribution changes.True p = 0.5: Bin(16, 0.5)probability00.10.2047812167.5 boundaryβ: fail to rejectSame rule; the true distribution changes.
  1. Type I: the null upper tail
    α=∑k=816((16k)(14)k(34)16−k)
  2. A false increase when p is still 0.25
    α≈0.027130
  3. Type II: X ≤ 7 under Bin(16, 0.5)
    β=∑k=07((16k)(12)k(12)16−k)
  4. Answer
    β=2633365536 ≈ 0.401810The increase is missed about 40% of the time.
α=∑k=816((16k)(14)k(34)16−k)Type I: the null upper tail.α≈0.027130A false increase when p is still 0.25.β=∑k=07((16k)(12)k(12)16−k)Type II: X ≤ 7 under Bin(16, 0.5).β=2633365536 ≈ 0.401810The increase is missed about 40% of the time.
P(X ≤ 8) would wrongly include 8, which rejects. P(X ≥ 8) at p = 0.5 is the chance of finding the increase: 1 − β. A later sample with X = 7 would not reject, so a Type II error could then occur.

5Try it

Your turn

1 X ~ Bin(20, p). The rule rejects H₀: p = 0.3 for X ≥ 10. Find P(Type I error).

2 Find P(Type II error) when p is really 0.5.

3 The observed count is 11. Which type of error could have been made? Explain.

  1. 1
    P(X ≥ 10 | p = 0.3) ≈ 0.0480
  2. 2
    P(X ≤ 9 | p = 0.5) ≈ 0.4119
  3. 3
    11 ≥ 10, so H₀ is rejected: only a Type I error is possible (if p is really 0.3)
Tick what you can do now
Practise with s26/62 Q3(c); s26/63 Q5(c); m26/62 Q5(b), Q5(c), Q5(d); s26/61 Q2(b), Q2(c); s26/65 Q5(a), Q5(b); s26/65 Q5(c) (related alternative-model error practice)
5 / 6
9709 · Unit 32 · Hypothesis tests
Revisionbyexamplicity

Errors and sample size for a mean test

§6.5 · Hypothesis tests

For a mean test the rule is one line on the x̄ scale: reject when x̄ passes c. Move the true mean and the curve moves, but c stays put. The same line tells you how big a sample must be to reject.

1α on the null curve, β on the true curve

σ = 6, n = 36, SE = 1. The test of H₀: μ = 52 against H₁: μ > 52 rejects for x̄ ≥ c = 53.6448536…. Find α, then β when the true mean is 54.
Null μ = 52: X̄ ~ N(52, 1)density4850525658μ = 5253.644854α = P₅₂(X̄ ≥ c)Same c and SE = 1 in both panels.True μ = 54: X̄ ~ N(54, 1)density4850525658μ = 5453.644854β = P₅₄(X̄ < c)Same c and SE = 1 in both panels.Null μ = 52: X̄ ~ N(52, 1)density4850525658μ = 5253.644854α = P₅₂(X̄ ≥ c)Same c and SE = 1 in both panels.True μ = 54: X̄ ~ N(54, 1)density4850525658μ = 5453.644854β = P₅₄(X̄ < c)Same c and SE = 1 in both panels.
  1. Right of c, under N(52, 1)
    α=P(X̄ ≥ c when μ = 52)
  2. c is 1.644854 SEs above 52
    α=1−Φ(c−521)
  3. Answer
    α = 0.05Exactly 5% for a continuous test.
α=P(X̄ ≥ c when μ = 52)Right of c, under N(52, 1).α=1−Φ(c−521)c is 1.644854 SEs above 52.α = 0.05Exactly 5% for a continuous test.
  1. Left of the same c, under N(54, 1)
    β=P(X̄ < c when μ = 54)
  2. Standardise against 54, not 52
    z≈−0.355146
  3. Answer
    β≈0.361240About 0.361.
β=P(X̄ < c when μ = 54)Left of the same c, under N(54, 1).z≈−0.355146Standardise against 54, not 52.β≈0.361240About 0.361.
Do not move c to 54 + 1.645: that is a different test. The SE stays 1, not 6. α and β need not add to 1.

2Find the least n that rejects

When n is unknown, write z in terms of n, set z ≥ critical value, and round n up.
  1. x̄ = 54, σ = 6, H₁: μ > 52 at 5%
    z=54−526n
  2. Simplify 2√n/6
    z=n3
  3. Reach the upper 5% point
    √n ÷ 3 ≥ 1.644854
  4. Multiply by 3, then square
    n ≥ (3 × 1.6448536…)²=24.3499
  5. Answer
    least n=25Round up.
z=54−526nx̄ = 54, σ = 6, H₁: μ > 52 at 5%.z=n3Simplify 2√n/6.√n ÷ 3 ≥ 1.644854Reach the upper 5% point.n ≥ (3 × 1.6448536…)² = 24.3499Multiply by 3, then square.least n=25Round up.
Zoom near the upper 5% boundaryn = 24n = 251.601.70critical z = 1.644854Blue: reject for z ≥ 1.644854
nObserved zDecision at 5%
241.632993Below 1.644854: do not reject
251.666667Above 1.644854: reject
Normal readings make X̄ normal even though 25 is below 30. With n = 24 there is insufficient evidence at the 5% level that μ exceeds 52; that does not show μ = 52.

3Run the whole test, then conclude

  1. 1
    Name the parameter and write H₀ and H₁.
  2. 2
    Give the statistic’s distribution under H₀.
  3. 3
    Use the tail H₁ points to and the significance level.
  4. 4
    Decide, and write the conclusion in context, with “evidence” or “insufficient evidence at the 5% level”.
  5. 5
    For an error probability, keep the rule and use the distribution at the stated true value.

4Try it

Your turn

1 A test of H₀: μ = 100 against H₁: μ > 100 has SE = 1 and rejects for x̄ ≥ 101.645. Find P(Type II error) when μ = 103.

2 σ = 10. The sample mean is 53. Find the least n for which a 5% test of H₀: μ = 50 against H₁: μ > 50 rejects.

3 For that test with n = 30, write the conclusion.

  1. 1
    P(X̄ < 101.645 | μ = 103) = Φ(−1.355) ≈ 0.0877
  2. 2
    3√n/10 ≥ 1.645, n ≥ 30.06, so n = 31
  3. 3
    z = 3√30/10 ≈ 1.643 < 1.645: do not reject H₀; there is insufficient evidence at the 5% level that the mean exceeds 50
Tick what you can do now
Practise with s26/63 Q5(d); m26/62 Q5(b), Q5(c); s26/62 Q6(c); s26/63 Q5(c), Q5(d); m26/62 Q5(d)
6 / 6