Uploaded by ahmedfrege

hYPOTHESIS TESTING

advertisement
06.02.2024
8. HYPOTHESIS TESTING
Hypothesis Testing and the p-value
Learning Objectives
• Develop null and alternative hypotheses to test for a given situation.
• Understand the critical regions of a graph for single- and two-tailed
hypothesis tests.
• Calculate a test statistic to evaluate a hypothesis.
• Test the probability of an event using the p-value.
• Understand Type I and Type II errors.
• Calculate the power of a test.
8. HYPOTHESIS TESTING
Hypothesis testing:
• Educated guesses about a population based on a sample drawn from
the population.
 For example: making guesses about the difference between the
hypothesized value of the mean of an overall population and that of
the sample.
1
06.02.2024
8. HYPOTHESIS TESTING
Developing Null and Alternative Hypotheses
(the mean as example)
8. HYPOTHESIS TESTING
Hypothesis testing
The end result of a hypotheses testing procedure is a choice of one of the
following two possible conclusions:
1. Reject 𝐻 (and therefore accept Ha), or
2. Fail to reject 𝐻 (and therefore fail to accept Ha).
2
06.02.2024
8. HYPOTHESIS TESTING
For example, if we were to test the hypothesis that the seniors had a
mean SAT score (Scholastic Aptitude Test) of 1100, our null hypothesis
would be that the SAT score would be equal
to 1100 or:
π‘―πŸŽ : 𝝁
𝟏𝟏𝟎𝟎
where:
𝐻
symbol for null hypothesis
πœ‡ population mean
1100 = value to be tested
We test the null hypothesis against an alternative hypothesis
1100
𝑯𝒂 : 𝝁
8. HYPOTHESIS TESTING
Example:
We have a medicine that is being manufactured and each pill is supposed
to have 14 milligrams of the active ingredient.
What are our null and alternative hypotheses?
Solution:
𝐻 :πœ‡
14
𝐻 :πœ‡
14
3
06.02.2024
8. HYPOTHESIS TESTING
Example:
The school principal wants to test if it is true what teachers say – that
high school juniors use the computer an average 3.2 hours a day. What
are our null and alternative hypotheses?
Solution:
𝐻 :πœ‡
𝐻 :πœ‡
3.2
3.2
8. HYPOTHESIS TESTING
Deciding whether to reject the Null Hypothesis:
Single and Two-Tailed Hypothesis Tests
When a hypothesis is tested, a statistician must decide on how much
evidence is necessary in order to reject the null hypothesis.
4
06.02.2024
8. HYPOTHESIS TESTING
Statisticians first choose a level of significance or alpha 𝜢 level,
which is an event probability below which discrepancies from the null
hypothesis are deemed significant.
The most frequently used levels of significance are 0.05 and 0.01.
A two-tailed test example:
8. HYPOTHESIS TESTING
Single-tail hypothesis
The critical region for the single-tail hypothesis test is defined differently.
 A single-tail hypothesis test is used when the direction of the results is
anticipated or we are only interested in one direction of the results.
5
06.02.2024
8. HYPOTHESIS TESTING
Single-tail hypothesis
Using our example about SAT scores of graduating seniors, our null and
alternative hypothesis could look something like:
𝐻 :πœ‡
𝐻:πœ‡
1100
1100
 In this scenario, our null hypothesis states that the mean SAT scores
would be lower equal to 1100
 The alternate hypothesis states that the SAT scores would be greater
than 1100.
8. HYPOTHESIS TESTING
Single-tail hypothesis
The alternative hypothesis looks different.
𝐻 :πœ‡
𝐻:πœ‡
1100
1100
• To calculate the critical regions, we must first find the critical values or the cut-offs
where the critical regions start.
• To find these values, we use the critical values found specified by the z-distribution.
6
06.02.2024
8. HYPOTHESIS TESTING
Lower-tailed test
𝐻 :πœ‡
πœ‡
𝐻:πœ‡
πœ‡
Reject if 𝑧
Upper-tailed test
𝑧
𝐻 :πœ‡
πœ‡
𝐻:πœ‡
πœ‡
Reject if 𝑧
Two-tailed test
𝑧
𝐻 :πœ‡
πœ‡
𝐻:πœ‡
πœ‡
Reject if 𝑧
𝑧
∪𝑧
𝑧
The rejection regions defined by the decision rule for upper-, lower- and two-tailed 𝑧 tests with α=0.05.
𝑍
1.645
8. HYPOTHESIS TESTING
Calculating the Test Statistic for testing the mean
Before evaluating our hypotheses by determining the critical region and
calculating the test statistic, we need to first:
1. Confirm that the distribution of the mean is normal or approximatively
normal (𝑛 30?)
2. Determine the hypothesized mean 𝝁𝟎 of the distribution
3. If we don’t have the population variance 𝝈𝟐 , we will need to calculate
the standard deviation of the sample 𝝈 π‘Žπ‘™π‘ π‘œ π‘π‘Žπ‘™π‘™π‘’π‘‘ 𝒔 so that we can
estimate the standard error of the mean 𝑺𝑬 𝒙
•
•
𝝈
𝒏
If the variance is unknown we need to use the t-distribution
If the variance is unknown but the sample size is large enough (𝑛
it can be assumed that the test statistic and the mean are
approximatively normal distributed
30
7
06.02.2024
8. HYPOTHESIS TESTING
If the population variance is not known (but the sample size is large enough)
the z π‘ π‘π‘œπ‘Ÿπ‘’ determines how different the two means are from each other.
𝑧
π‘₯Μ… πœ‡
𝑆𝐸 π‘₯Μ…
π‘₯Μ…
πœ‡
𝜎
𝑛
Example:
College A has an average SAT score of 1500. From a random sample of 125 freshman
psychology students we find the average SAT score to be 1450 with a standard deviation of
100.
• Are these freshman psychology students representative of the overall population?
8. HYPOTHESIS TESTING
Example:
A farmer is trying out a planting technique that he hopes will increase the yield on his
pea plants. Over the last 5 years, the average number of pods on one of his pea plants
was 145 pods with a standard deviation of 100 pods. This year, after trying his new
planting technique, he takes a random sample of size 144 of his plants and finds the
average number of pods to be 147.
He wonders whether or not this is a statistically significant increase.
• What is his hypotheses and the test
statistic?
• What can be said about the increase?
8
06.02.2024
Example of a Two-Tailed Test
As a hypothetical example from finance:
Imagine that a new stockbroker, named XYZ, claims that their brokerage
fees are lower than that of your current stockbroker, ABC. Data available
from an independent research firm indicates that the mean and standard
deviation of all ABC broker clients are $18 and $6, respectively.
A sample of 100 clients of ABC is taken, and brokerage charges are
calculated with the new rates of XYZ broker. If the mean of the sample is
$18.75 and the sample standard deviation is $6, can any inference be
made about the difference in the average brokerage bill between ABC and
XYZ broker?
9
06.02.2024
8. HYPOTHESIS TESTING
Testing the p-value of an event
Let’s use the example about the pea farmer.
What if the farmer is really hoping is that some plants have a
more dramatic yield increase.
• What is the probability of a plant having a much higher yield
of over 144 pea pods?
10
Download