Unit 5 Hypothesis Testing-Compressed-1
Unit 5 Hypothesis Testing-Compressed-1
For example:
If I (decrease the amount of water given to herbs) then (the herbs will
increase in size).
If I (give patients counseling in addition to medication) then (their overall
depression scale will decrease).
If I (look in this certain location) then (I am more likely to find new
species).
14
15
16
17
18
19
Rationale for Hypothesis Testing
20
Direction of Hypothesis Test
The direction of a hypothesis test refers to whether the alternative
hypothesis is one-tailed or two-tailed.
One-Tailed Test: The alternative hypothesis specifies a direction
for the effect (e.g., greater than, less than).
Two-Tailed Test: The alternative hypothesis does not specify a
direction for the effect; it only suggests that there is a difference.
Example: Suppose a manufacturer claims that the average weight
of their product is less than 10 kg. In this case, the alternative
hypothesis would be one-tailed, indicating a direction (less than).
On the other hand, if the manufacturer only claims that there is a
difference in weight, without specifying whether it is greater or less
than 10 kg, then the alternative hypothesis would be two-tailed.21
Errors in Hypothesis Testing
22
Errors in Hypothesis Testing
23
24
Correct decisions :
Type 1 error –
Type 2 error -
25
Formula Review
α = probability of a Type I error = P(Type I error) = probability of
rejecting the null hypothesis when the null hypothesis is true.
β = probability of a Type II error = P(Type II error) = probability of
not rejecting the null hypothesis when the null hypothesis is false.
26
27
General Procedure for Hypothesis Testing
Formulate Hypotheses: State the null hypothesis (H0) and the alternative
hypothesis (H1or Ha).
Select Significance Level: Choose the significance level (α) to specify the
probability of committing a Type I error.
Collect Data: Collect sample data relevant to the hypothesis being tested.
Calculate Test Statistic: Compute a test statistic based on the sample data and
the assumed distribution under the null hypothesis.
Make Decision: Compare the test statistic to the critical value or calculate the p-
value. Reject the null hypothesis if the test statistic falls in the rejection region, or
if the p-value is less than the significance level (αα).
Interpret Results: Draw conclusions based on the decision made in step 5,
considering the context of the problem and the consequences of potential errors.
28
Z Test statistics is a statistical procedure used to test an alternative
hypothesis against the null hypothesis. It is any statistical
hypothesis used to determine whether two samples means are
different when variances are known and the sample is large.
Z Test determines if there is a significant difference between sample
and population means.
Z Test normally used for dealing with problems relating to large
samples.
When the sample size is more than 30 units than in that case the z
test must be performed. Mathematically z test formula is
represented as,
29
Here,
x̄ = Mean of Sample
μ = Mean of Population
σ = Standard Deviation of
Population
n = Number of
Observation
30
31
32
33
34
Example 1: A teacher claims that the mean score of students in his class
is greater than 82 with a standard deviation of 20. If a sample of 81
students was selected with a mean score of 90 then check if there is
enough evidence to support this claim at a 0.05 significance level.
35
36
Example 2: An online medicine shop claims that the mean delivery time for medicines is
less than 120 minutes with a standard deviation of 30 minutes. Is there enough evidence
to support this claim at a 0.05 significance level if 49 orders were examined with a mean
of 100 minutes?
Solution: As the sample size is 49 and population standard deviation is known, this is an
example of a left-tailed one-sample z test.
H0: μ=120,H1: μ<120
From the z table the critical value at α
= -1.645. A negative sign is used as this is a left tailed test.
37
38
39
We reject H0 because 2.38 > 1.645. We have statistically
significant evidence at a =0.05, to show that the mean weight
in men in 2006 is more than 191 pounds.
40
Example:
The National Center for Health Statistics (NCHS) published a report in
2005 entitled Health, United States, containing extensive information on
major trends in the health of Americans. Data are provided for the US
population as a whole and for specific ages, sexes and races. The NCHS
report indicated that in 2002 Americans paid an average of $3,302 per
year on health care and prescription drugs. An investigator hypothesizes
that in 2005 expenditures have decreased primarily due to the availability
of generic drugs. To test the hypothesis, a sample of 100 Americans are
selected and their expenditures on health care and prescription drugs in
2005 are measured. The sample data are summarized as follows: n=100,
x̄=$3,190 and s=$890. Is there statistical evidence of a reduction in
expenditures on health care and prescription drugs in 2005? Is the sample
mean of $3,190 evidence of a true reduction in the mean or is it within
chance fluctuation? We will run the test using the five-step approach.
41
Step 1. Set up hypotheses and determine level of significance
H0: μ = 3,302 H1: μ < 3,302 α =0.05
The research hypothesis is that expenditures have decreased, and
therefore a lower-tailed test is used.
Step 2. Select the appropriate test statistic.
Because the sample size is large (n> 30)
42
43
Example:
The NCHS reported that the mean total cholesterol level in 2002 for all adults
was 203. Total cholesterol levels in participants who attended the seventh
examination of the Offspring in the Framingham Heart Study are summarized as
follows: n=3,310, x̄ =200.3, and s=36.8. Is there statistical evidence of a
difference in mean cholesterol levels in the Framingham Offspring?
Here we want to assess whether the sample mean of 200.3 in the Framingham
sample is statistically significantly different from 203 (i.e., beyond what we would
expect by chance). We will run the test using the five-step approach.
Step 1. Set up hypotheses and determine level of significance
H0: μ= 203 H1: μ≠ 203 α=0.05
The research hypothesis is that cholesterol levels are different in the
Framingham Offspring, and therefore a two-tailed test is used.
44
45
An insurance company sells health insurance and motor insurance policies. Customers pay premiums for
these policies. The CEO of the insurance company wonders if premiums paid by either of the insurance
segments (health insurance and motor insurance) are more variable than another. He finds the following
data for premiums paid: