Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views29 pages

06 Testing

The document discusses hypothesis testing in statistics, covering large and small sample tests, statistical hypotheses, and the steps involved in conducting a hypothesis test. It provides examples, including tests for means and proportions, and explains concepts such as significance levels, p-values, and types of errors. Additionally, it outlines the process for testing claims about population parameters using various statistical methods.

Uploaded by

neelampb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views29 pages

06 Testing

The document discusses hypothesis testing in statistics, covering large and small sample tests, statistical hypotheses, and the steps involved in conducting a hypothesis test. It provides examples, including tests for means and proportions, and explains concepts such as significance levels, p-values, and types of errors. Additionally, it outlines the process for testing claims about population parameters using various statistical methods.

Uploaded by

neelampb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Hypothesis Testing

Stat 3202 @ OSU


Dalpiaz

1
Main Ideas and Large Sample Tests

2
Some Setups

Let X1 , X2 , . . . , Xn be a “large” sample from a distribution with E[X ] = µ and Var[X ] = σ 2 .


Then,

x̄ − µ approx
√ ∼ N(0, 1)
s/ n

Let X1 , X2 , . . . , Xn1 be a “large” sample from a distribution with E[X ] = µ1 and Var[X ] = σ12 and
Y1 , Y2 , . . . , Yn2 be a “large” sample from a distribution with E[Y ] = µ2 and Var[X ] = σ22 . Then,

(x̄ − ȳ ) − (µ1 − µ2 ) approx


q 2 ∼ N(0, 1)
s1 s22
n1 + n2

3
More Setups Setups

Let X1 , X2 , . . . , Xn be a “large” sample from a Bernoulli distribution with parameter p. Then,

p̂ − p approx
q ∼ N(0, 1)
p(1−p)
n

Let X1 , X2 , . . . , Xn1 be a “large” sample from a Bernoulli distribution with parameter p1 and
Y1 , Y2 , . . . , Yn2 be a “large” sample from a Bernoulli distribution with parameter p2 . Then,

(p̂1 − p̂2 ) − (p1 − p2 ) approx


q ∼ N(0, 1)
p1 (1−p1 )
n1 + p2 (1−p
n2
2)

4
Example: One Sample Test for µ

An administrator claims that undergraduate students at Ohio State are extremely healthy. In
particular, she claims that they sleep 8 or more hours a night on average. (Let µ be the true
average sleep.) To test this claim, a random sample of 50 students is selected to report on the
amount of sleep they obtained the previous night. They slept on average 7.72 hours, with a
standard deviation of 1.63 hours. Do you believe the administrator’s claim? Use a significance
level of α = 0.05 and an appropriate test.

5
Hypothesis Test Steps

• Develop scientific hypothesis


• Translate to statistical hypothesis about parameters
• Null hypothesis, H0
• Alternative hypothesis, HA or H1 .
• Set significance level, α
• Collect data
• Calculate test statistic
• Note distribution of this statistic under null hypothesis
• Calculate p-value or find rejection region
• State the statistical conclusion
• Translate to scientific conclusion

6
Example: One Sample Test for p

• Is a coin fair?

Alex is suspicious of a particular coin so he flips it 900 times and observes an outcome of heads
477 times. Let p be the probability of obtaining heads. Perform the appropriate test using a
significance level of α = 0.10.

7
Example: Two Sample Test for p1 − p2

In a comparative study of two new drugs, A and B, 120 patients were treated with drug A and
150 patients with drug B, and the following results were obtained.

Drug A Drug B
Cured 78 111
Not 42 39

We wish to test whether drug B has a higher cure rate than drug A. Perform the appropriate test
using a significance level of α = 0.05.

8
Hypothesis Testing Main Ideas

9
Statistical Hypothesis

Statistical hypothesis: an assertion or conjecture about the distribution of one or more random
variables, often specifically about a parameter of a distribution

• Null hypothesis, H0 : Hypothesis of no difference or no effect; we generally look for


evidence against the null hypothesis
• Alternative hypothesis, HA or H1 : A hypothesis that often complements the null; this is
often what we are trying to show

10
Statistical Hypothesis (Left-tailed)

• H0 : µ = µ0 vs HA : µ < µ0
• H0 : p = p0 vs HA : p < p0
• H0 : µ1 = µ2 vs HA : µ1 < µ2
• H0 : µ1 − µ2 = 0 vs HA : µ1 − µ2 < 0
• H0 : p1 = p2 vs HA : p1 < p2
• H0 : p1 − p2 = 0 vs HA : p1 − p2 < 0

11
Statistical Hypothesis (Right-tailed)

• H0 : µ = µ0 vs HA : µ > µ0
• H0 : p = p0 vs HA : p > p0
• H0 : µ1 = µ2 vs HA : µ1 > µ2
• H0 : µ1 − µ2 = 0 vs HA : µ1 − µ2 > 0
• H0 : p1 = p2 vs HA : p1 > p2
• H0 : p1 − p2 = 0 vs HA : p1 − p2 > 0

12
Statistical Hypothesis (Two-tailed)

• H0 : µ = µ0 vs HA : µ 6= µ0
• H0 : p = p0 vs HA : p 6= p0
• H0 : µ1 = µ2 vs HA : µ1 6= µ2
• H0 : µ1 − µ2 = 0 vs HA : µ1 − µ2 6= 0
• H0 : p1 = p2 vs HA : p1 6= p2
• H0 : p1 − p2 = 0 vs HA : p1 − p2 6= 0

13
Statistical Conclusions

• If p − value < α or the test statistic is in the rejection region


• Reject H0
• Claim “statistical significance!”
• If p − value > α or the test statistic is not in the rejection region
• Fail to reject H0
• “Accept” H0 ?

14
Hypotheses and Conclusions

• Type I Error: “False Positive”


• Type II Error: “False Negative”

15
α and β

• α = P(Reject H0 | H0 True)
• The probability of making a Type I error
• The probability of a false positive
• The significance level of a test
• β = P(Accept H0 | H0 False)
• The probability of making a Type II error
• The probability of a false negative
• 1 − β = P(Reject H0 | H0 False)
• The power of a test

16
Test Statistics

EST − HYP approx


z= ∼ N(0, 1)
SE(EST)

17
Test Statistics

x̄ − µ0 approx
z= √ ∼ N(0, 1)
s/ n

(x̄ − ȳ ) − 0 approx
z= q 2 ∼ N(0, 1)
s1 s22
n1 + n2

p̂ − p0 approx
z=q ∼ N(0, 1)
p0 (1−p0 )
n

(p̂1 − p̂2 ) − 0 approx n1 p̂1 + n2 p̂2


z=q ∼ N(0, 1), p̂ =
p̂(1−p̂)
+ p̂(1−p̂) n1 + n2
n1 n2

18
Rejection Regions

19
P-Values

20
Rejection Regions and P-Values

• Rejection Region: potential values of the test statistic that occur with probability α if the
null hypothesis is true
• p-value: probability of observing something (such as the test statistic) as extreme or more
extreme than what we observed, assuming that the null hypothesis is true. [Note: “extreme”
is defined in the direction of the alternative.]
• THIS IS NOT THE PROBABILITY THAT THE NULL HYPOTHESIS (OR ANY
HYPOTHESIS) IS TRUE!

21
Example: Two Sample Test for µ1 − µ2

Professor Professorson, a researcher at Greendale Community College, believes that caffeine has
a negative effect on the sleep of students.
Professorson obtains a random sample of 50 students who are given 400 mg of caffeine at noon
on some day. (Don’t try this at home.) Professor Professorson invites these students for a sleep
study and finds that they sleep an average of 6.5 hours with a standard deviation of 1.2 hours
that night.
Professorson also recruits 75 students who are given a placebo, also at noon. He again monitors
them during a sleep study and finds that they sleep an average of 7.3 hours with a standard
deviation of 1.4 hours that night.
Perform the appropriate test using a significance level of α = 0.05.

22
Small Sample Tests

23
(One-Sample) Small Sample Setups

Let X1 , X2 , . . . , Xn be a sample from a normal distribution with mean µ and variance σ 2 . Then,

x̄ − µ
√ ∼ tn−1
s/ n

(n − 1)s 2
∼ χ2n−1
σ2

24
(Two-Sample) Small Sample Setups

• Let X1 , X2 , . . . , Xn1 be a sample from a normal distribution with mean µ1 and variance σ 2 .
• Let Y1 , Y2 , . . . , Yn2 be a sample from a normal distribution with mean µ2 and variance σ 2 .

Then,

(x̄ − ȳ ) − 0
q ∼ tn1 +n2 −2
sp n11 + n12

where

(n1 − 1)s12 + (n2 − 1)s22


sp2 =
n1 + n2 − 2

25
Example: One Sample Test for µ

Battery packs for an artificial heart are tested to determine their average lifetime which the
manufacturer claims is over 4 years. In a random sample of 20 battery packs, the sample average
was 4.05 years with a standard deviation of 0.2 years. Assume that the lifetime of the battery
packs follows a normal distribution. Is there evidence to support the claim that the mean battery
life exceeds 4 years a significance level of α = 0.05?

26
Example: One Sample Test for σ

Consider a filler machine in a dog food production plant. From studying the process over time,
we assume that the population standard deviation, σ, is 0.17, but we observe an unusual level of
variability in the fill weights on a particular day. We would like to test whether the standard
deviation has increased.
In a sample of 30 boxes, we find a standard deviation of 0.21 lbs. Is this evidence that the
standard deviation has increased? Carry out a hypothesis test using a significance level of
α = 0.05.

27
Example: Two Sample Test for µ1 − µ2

Consider an experiment conducted on mice to examine the effect of a magnetic field on the
amount of weight gain. The experimental set-up included two groups, a treatment group that
was exposed to a magnetic field and a control group that was not exposed. Each group
contained 10 mice. The data consist of the weight gain per mouse, and we can assume that the
data in each group are normally distributed, with equal variances across groups. Carry out a
hypothesis test to determine whether exposure to a magnetic field inhibits growth in mice. Use a
significance level of α = 0.01.

28
Paired Sample Test

A new revolutionary diet-and-exercise plan is introduced. Eight participants were weighed in the
beginning of the program, and then again a week later. The results were as follows:

Participant 1 2 3 4 5 6 7 8
Weight Before 213 222 232 201 230 188 218 182
Weight After 208 220 224 200 220 185 220 184

Is there enough evidence to conclude that the diet-and-exercise plan is effective? (Use α = 0.05.)
What is the p-value of this test?

29

You might also like