STAT 211 Topic 7

From Notes
Jump to navigation Jump to search
Lecture 14 Notes

« previous | Thursday, March 10, 2011 | next »


Hypothesis Testing

  1. Form hypotheses (null and alternative)
  2. Find test statistic (value from sample data on which decision is based
    • z-test (if it follows Z distribution)
    • t-test (if it follows T distribution)
    • χ2-test (if it follows χ2 distribution)
  3. Find rejection region
  4. Reach conclusion

Significance Level

α represents "significance level" and is usually predetermined. It is the probability that we make a type 1 error (see below).

2 types of errors:

  1. Rejecting the null hypothesis when the null hypothesis is true
  2. Fail to reject the null hypothesis although the null hypothesis is false


Case 1: Normal population with known σ

Null hypothesis:

H0: μ=μ0

Test Statistic:

z=x¯μ0σ/n

Rejection Region:

μ>μ0; zzα
μ<μ0; zzα
μμ0; zzα/2 or zzα/2


Case 2: Large Sample

Similar to Case 1, but we use our sample standard deviation instead of σ

Null hypothesis:

H0: μ=μ0

Test Statistic:

z=x¯μ0s/n

Rejection Region:

μ>μ0; zzα
μ<μ0; zzα
μμ0; zzα/2 or zzα/2


Case 3: Normal population with unknown σ and small sample

Similar to Case 2, only we use t-test instead of z-test.


Null hypothesis:

H0: μ=μ0

Test Statistic:

t=x¯μ0s/n

Rejection Region:

μ>μ0; ttα
μ<μ0; ttα
μμ0; ttα/2 orttα/2


Example

Suppose we have the following information

  • σ=10 (known standard deviation)
  • μ=170 (our claim about a normal distribution)
  • n=30 (sample size)
  • X¯=180 (sample average)
  • s=12 (sample standard deviation)

Null hypothesis

H0:μ=170

Alternative Hypothesis

Ha:μ170

Test Statistic

z=18017010/30=305.48

If our significance level α=1%

We reject the null hypothesis if z>z0.01
5.48>2.58, so we reject the null hypothesis.


One-sided vs. Two-sided

If the null hypothesis is that the average is a certain number (μ=17):

a one-sided test
would be if our alternative hypothesis is either μ>17 or μ<17.
a two-sided test
includes both cases of the above alternatives in a single alternative hypothesis: μ17.


Lecture 15

Lecture 15 Notes


Testing Population Proportion

  • We must have a large sample
  • H0:p=p0 (the proportion is claimed to be some number p0)
  • z=p^p0p0(1p0)n
    Note: be careful to use p0 in the denominator, not p^!

Rejection Region:

p>p0; zzα
p<p0; zzα
pp0; zzα/2 or zzα/2


Closer look at Hypothesis Testing

If the null hypothesis is true, the significance level α is the probability that the null hypothesis will be rejected:

If H0 is true:

  • P(zzα)=α
  • P(zzα)=α
  • P(zzα/2 or zzα/2)=α


Errors

Type 1
Rejecting the null hypothesis when the null hypothesis is true
We let the probability that the null hypothesis is true and the test statistic falls into the rejection region P(Type 1 error)=α
Type 2
Fail to reject the null hypothesis although the null hypothesis is false
we don't care about this, but the book discusses a way to calculate this probability

P-Values

Suppose that we reject the null hypothesis at 5% significance level, but not at 1%.

Our statistic z changes from sample to sample, but if the null hypothesis is true, zN(0,1) and our statistic should be somewhere around 0. If our z=5 for example, then we know that something is wrong with our null hypothesis.

P-value is the probability that another test statistic Z is further away from mean 0 than our z above. If this value very small (i.e. smaller than the significance level α), then we reject the null hypothesis.

  • H0:μ=μ0
  • Ha:{μ>μ0P(Z>z)=1Φ(z)μ<μ0P(Z<z)=Φ(z)μμ0P(Z>|z| or Z<|z|)=2×min(P(Z>z), P(Z<z))


What about t-test?

Substitute t for z

  • H0:μ=μ0
  • Ha:{μ>μ0P(Tn1>t)μ<μ0P(Tn1<t)μμ0P(Tn1>|t| or Tn1<|t|)=2×min(P(Tn1>t), P(Tn1<t))