null hypothesis

TOPIC 10:
HYPOTHESIS TESTING
•
•
Hypothesis testing for a single proportion
Hypothesis testing for a single mean
HYPOTHESIS TESTING
FOR A PROPORTION
Hypothesis Testing Example
A manufacturer claims that only 2% of the women using the company’s birth
control pill suffer from side effects. Recent investigations by several
journalists suggest this estimate is too low. We want to test the
manufacturers claim.
How would we do that?
Steps: Hypothesis Testing, in plain English
1. Write the null and alternative hypothesis. The null is the
claimed truth (or the status quo) while the alternative is what
an investigator believes.
2. Calculate the sample proportion from the sample data.
2. Find the probability of getting such a sample value if the claim
(the null hypothesis) was true. This is called the P-value.
3. Decision time: if that probability is low, then the null must GO!
After all, we can’t argue with a sample, but we can decide the
null is incorrect. If that probability is not low enough (not below
a predetermined significance level), then we cannot reject the
null.
Steps: Hypothesis Testing, mathematically
1. Write the null and alternative hypothesis.
The null hypothesis: H0 : p = p0 (p0 is just some number)
The alternative hypothesis:
HA : p ≠ p0 OR HA : p > p0 OR HA : p < p0
2. Calculate the
p̂ from data and find the z-score.
3. From the z-score get a P-value.
4. Decision time:
Yes
Is P-value < α ?
No
Reject H0
Fail to reject H0
The Logic of Hypothesis Testing: Unusual
Data
To be more precise about what is “unusual,” we use
z-scores, and then find P-values.
The sample value p̂ is “unusual” if we would not
expect to have such a sample value given the
claimed value for p.
Hypothesis Testing Example
A manufacturer claims that only 2% of the women using the company’s birth
control pill suffer from side effects. Recent investigations by several
journalists suggest this estimate is too low. We want to test the
manufacturers claim.
•We start with a null hypothesis ( H0 ) that represents the status quo, or
previously established estimate.
Hypothesis Testing Example
A manufacturer claims that only 2% of the women using the company’s birth
control pill suffer from side effects. Recent investigations by several
journalists suggest this estimate is too low. We want to test the
manufacturers claim.
•We start with a null hypothesis ( H0 ) that represents the status quo, or
previously established estimate.
• Here the null hypothesis is: The proportion of all women using this
manufacturer’s birth control that suffer from side effects is 2%.
Hypothesis Testing Example
A manufacturer claims that only 2% of the women using the company’s birth
control pill suffer from side effects. Recent investigations by several
journalists suggest this estimate is too low. We want to test the
manufacturers claim.
•We start with a null hypothesis ( H0 ) that represents the status quo, or
previously established estimate.
• THINK: Here the null hypothesis is: The proportion of all women using this
manufacturer’s birth control that suffer from side effects is 2%.
• WRITE: H0 : p = 0.02
Hypothesis Testing Example
A manufacturer claims that only 2% of the women using the company’s birth
control pill suffer from side effects. Recent investigations by several
journalists suggest this estimate is too low. We want to test the
manufacturers claim.
•We start with a null hypothesis ( H0 ) that represents the status quo, or
previously established estimate.
• THINK: Here the null hypothesis is: The proportion of all women using this
manufacturer’s birth control that suffer from side effects is 2%.
• WRITE: H0 : p = 0.02
•We also have our alternative hypothesis ( HA ) that represents our
research question, i.e., what we are testing for.
Hypothesis Testing Example
A manufacturer claims that only 2% of the women using the company’s birth
control pill suffer from side effects. Recent investigations by several
journalists suggest this estimate is too low. We want to test the
manufacturers claim.
•We start with a null hypothesis ( H0 ) that represents the status quo, or
previously established estimate.
• THINK: Here the null hypothesis is: The proportion of all women using this
manufacturer’s birth control that suffer from side effects is 2%.
• WRITE: H0 : p = 0.02
•We also have our alternative hypothesis ( HA ) that represents our
research question, i.e., what we are testing for.
• THINK: Here the alternative hypothesis is: The proportion of all women using this
manufacturer’s birth control that suffer from side effects is greater than 2%.
• WRITE: HA : p > 0.02
Hypothesis Testing Example
Next conduct a hypothesis test (based on the central limit theorem) under the
assumption that the null hypothesis is true.
Hypothesis Testing Example
Next conduct a hypothesis test (based on the central limit theorem) under the
assumption that the null hypothesis is true.
• A significance level is determined based on a variety of factors.
• The most common (and default) significance level is 0.05.
• α = 0.05
Hypothesis Testing Example
Next conduct a hypothesis test (based on the central limit theorem) under the
assumption that the null hypothesis is true.
•A significance level is predetermined based on a variety of factors.
• The most common (and default) significance level is 0.05.
• α = 0.05
•Then we choose a random sample from the population and compute the
sample proportion.
Hypothesis Testing Example
Next conduct a hypothesis test (based on the central limit theorem) under the
assumption that the null hypothesis is true.
•A significance level is determined based on a variety of factors.
• The most common (and default) significance level is 0.05.
• α = 0.05
•Then we choose a random sample from the population and compute the
sample proportion.
• For this example, 900 women taking this birth control pill were randomly
selected. We found that 23 of the women experienced side effects.
Hypothesis Testing Example
Next conduct a hypothesis test (based on the central limit theorem) under the
assumption that the null hypothesis is true.
•A significance level is determined based on a variety of factors.
• The most common (and default) significance level is 0.05.
• α = 0.05
•Then we choose a random sample from the population and compute the
sample proportion.
• For this example, 900 women taking this birth control pill were randomly
selected. We found that 23 of the women experienced side effects.
•
Hypothesis Testing Example
Now we compute a P-value.
Hypothesis Testing Example
Now we compute a P-value.
• We consider the sampling distribution determined by the null proportion p0.
Hypothesis Testing Example
Now we compute a P-value.
• We consider the sampling distribution determined by the null proportion p0.
• This is the normal distribution N(p0, SE), where
• For this example, we have N(0.02, .0047).
Hypothesis Testing Example
Now we compute a P-value.
• We consider the sampling distribution determined by the null proportion p0.
• This is the normal distribution N(p0, SE), where
• For this example, we have N(0.02, .0047).
• We compute the z-score for the sample proportion
Hypothesis Testing Example
Now we compute a P-value.
• We consider the sampling distribution determined by the null proportion p0.
• This is the normal distribution N(p0, SE), where
• For this example, we have N(0.02, .0047).
• We compute the z-score for the sample proportion
•
• For this example, we have z = 1.1915.
• This z-score is also called the test statistic.
Hypothesis Testing Example
Now we compute a P-value.
• We consider the sampling distribution determined by the null proportion p0.
• This is the normal distribution N(p0, SE), where
• For this example, we have N(0.02, .0047).
• We compute the z-score for the sample proportion
•
• For this example, we have z = 1.1915.
• This z-score is also called the test statistic.
• The P-value is the probability of observing data at least as favorable to HA
as our current sample (sample proportion greater than or equal to 0.0256)
Hypothesis Testing Example
Now we compute a P-value.
• We consider the sampling distribution determined by the null proportion p0.
• This is the normal distribution N(p0, SE), where
• For this example, we have N(0.02, .0047).
• We compute the z-score for the sample proportion
•
• For this example, we have z = 1.1915.
• This z-score is also called the test statistic.
• The P-value is the probability of observing data at least as favorable to HA
as our current dataset (sample proportion greater than or equal to 0.0256)
• Find the probability to the right since HA : p > 0.02
•
P-value = 0.1167. Since this is greater than α = 0.05, we fail to reject the null
hypothesis. We do not have evidence to support our alternative hypothesis.
Calculator
• 1-PropZTest (proportions, hypothesis testing)
• p0: .02
• x: 23
• n:900
• Select prop > p0
• Select Calculate for P-value; Select Draw to see the
normal curve and get the P-value
HYPOTHESIS TESTING
FOR A MEAN
Hypotheses and test statistic:
Ho: μ = μo
HA: μ < μo or μ > μo or μ ≠ μo
Test statistic:
Recall
SE =
x - mo
t=
SE
s
n
• Note that μo represents the claimed value of the population mean
and the t-statistic has a t-distribution with n − 1 degrees of freedom
under Ho .
We next calculate the P-value by shading to the right/left/two sides
depending on the alternative hypothesis.
We calculate the P-value for the test as follows:
One-sided, to
the right
One-sided, to
the left
Two-sided
If HA: μ > μ0, then the Pvalue is the area to the
right of the observed
test statistic under the
Ho model.
If HA: μ < μ0, then the Pvalue is the area to the
left of the observed test
statistic under the Ho
model.
If HA: μ ≠ μ0, then the Pvalue is the area in the
two tails, outside the
observed test statistic
under the Ho model.
t(n-1)
p- va lu e
t
T
t(n-1)
t(n-1)
p- value
2
p-value
2
p -v alu e
t
T
-t
+t
T
Using tcdf
In the case of means we use tcdf(a, b, df).
Using TI-83/84 for Hypothesis Tests
Carry out a two tail test to investigate the claim that the population mean is
65. We take a sample of size 15 and obtain a mean of 67.2, with a standard
deviation of 4.7, for the variable we are measuring.
1. Go to STAT -> TESTS ->Ttest
2. The first two lines of the resulting screen look like this.
TTest
Inpt: Data Stats
You choose “Data” if you have entered actual data into one of the lists
(L1, L2, etc.), and “Stats” if you will be entering summary statistics.
3. TTest
0:65
x: 67.2
Sx: 4.7
n: 15
≠0
4 The results are shown as follows:
T-Test
≠65
t=1.812885822
-test statistic
p=.091342079
P-value: now make a decision!
Example 1
• Let’s carry out a two-tail test to investigate the claim
that the population mean is 65. We take a sample
of size 15 and obtain a mean of 67.2, with a
standard deviation of 4.7, for the variable we are
measuring.
Example 2
• Suppose a sample of 106 body temperatures
has a mean of 98.2 degrees, and a standard
deviation of 0.62. Use a 0.05 significance
level to test the common belief that the mean
body temperature of healthy adults is equal to
98.6.
Example 3
• In order to monitor the ecological health of the
Florida Everglades, various measurements are
recorded at different times. The bottom
temperatures are recorded at the Garfield Bight
station and the mean of 30.4 C is obtained for 61
temperatures recorded on 61 different days, with a
standard deviation of 1.7 C. Test the claim that the
population mean is 30 C. Use a 0.05 significance
level.
Make a Decision
If P-value < α we reject the null. Otherwise, we fail to reject
the null.
P-value
Conclusion
P-value > 0.1
Little or no evidence against Ho
0.05 < P-value < 0.10
Some evidence against Ho
0.01 < P-value < 0.05
Moderate evidence against Ho
0.001 < P-value < 0.01
Strong evidence against Ho
P-value £ 0.001
Very strong evidence against Ho
Could we have make an error? Yes, Type 1 or Type 2.
Could We Have Made an Error?
• Yes, if we rejected H0 but in fact H0 is true that
is a Type I error.
• If we failed to reject H0 when H0 was not true
that is a Type II error.
• Sometimes one is more serious, sometimes the other!