You are on page 1of 31

Hypothesis Testing

By
Aparna Kumari
Aparna.kumari@nirmauni.ac.in
Introduction
• Hypothesis testing refers to the formal procedures used by
researchers to accept or reject statistical hypotheses. A statistical
hypothesis is a claim about the population parameter.

• For example, we may claim that the population mean is equal to a


particular value; Or the population means of two different groups are
equal. The claim may be true or false.

• The task of the researcher is to use sample data to assess the


likelihood of the hypothesis (claim) being true. If the sample data is
not consistent with the statistical hypothesis, the hypothesis is
rejected.
Types of Hypothesis Testing
There are two types of statistical
hypotheses:
Types of Test for Hypothesis Testing
• Hypothesis Testing Z Test
• Hypothesis Testing t Test
• Hypothesis Testing Chi Square: The Chi square test is a hypothesis
testing method that is used to check whether the variables in a
population are independent or not. It is used when the test statistic is
chi-squared distributed.
Two types of Hypothesis Testing

• Directional Hypothesis Testing


• One tail test
• Non Directional Hypothesis Testing
• Two tail test
One Tailed Hypothesis Testing
• Right Tailed Hypothesis Testing
• The right tail test is also known as the upper
tail test. This test is used to check whether
the population parameter is greater than
some value. The null and alternative
hypotheses for this test are given as follows:
• H0: The population parameter is ≤ some
value
• H1: The population parameter is > some
value.
• If the test statistic has a greater value than
the critical value then the null hypothesis is
rejected
One Tailed Hypothesis Testing
• Left Tailed Hypothesis Testing
• The left tail test is also known as the lower
tail test. It is used to check whether the
population parameter is less than some
value. The hypotheses for this hypothesis
testing can be written as follows:
• H0: The population parameter is ≥ some
value
• H1: The population parameter is < some
value.
• The null hypothesis is rejected if the test
statistic has a value lesser than the critical
value.
Two Tailed Hypothesis Testing
• In this hypothesis testing method, the critical
region lies on both sides of the sampling
distribution. It is also known as a non -
directional hypothesis testing method. The
two-tailed test is used when it needs to be
determined if the population parameter is
assumed to be different than some value.
• The hypotheses can be set up as follows:
• H0: the population parameter = some value
• H1: the population parameter ≠ some value
• The null hypothesis is rejected if the test
statistic has a value that is not equal to the
critical value
Steps for hypothesis testing
• Researchers follow a formal process to determine whether to reject a
null hypothesis, based on sample data. This process,
called hypothesis testing, can be summarized in the following 5
steps:

Step 1
1. State the research question: stating the research question clearly is
necessary in order to define the type of data that should be used.

• For example: Is the mean “first salary” of newly graduated students


(in Newyork) equal to 30,000 $?
Step 2
Step 3
Step 4
• Compute the probability of the test statistics. We want to know
the probability of obtaining a z value as extreme as the one we
observed under our null hypothesis. This probability is known as
the p-value. That probability is given by:
Step 5

I recommend you use “fail to reject”


Example
• A principal at a certain school claims that the students in his
school are above average intelligence. A random sample of
thirty students IQ scores have a mean score of 112.5. Is there
sufficient evidence to support the principal’s claim? The mean
population IQ is 100 with a standard deviation of 15.

• Step 1: State the Null hypothesis. The accepted fact is that


the population mean is 100, so: H0: μ = 100.

• Step 2: State the Alternate Hypothesis. The claim is that the students
have above average IQ scores, so:
H1: μ > 100.
The fact that we are looking for scores “greater than” a certain point
means that this is a one-tailed test.
• Draw a picture to help you visualize the problem.
• Step 3: Find the test statistic using this formula: For this set of data: z=
(112.5 – 100) / (15/√30) = 4.56

• Step 4.a: State the alpha level. If you aren’t given an alpha level, use 5%
(0.05).

• Step 4.b: Find the rejection region area (given by your alpha level above)
from the z-table. An area of .05 is equal to a z-score of 1.645.

• Step 5: If step-3 value is greater than step-4, reject the null hypothesis. If
it’s less than, you cannot reject the null hypothesis. In this case, it is more
(4.56 > 1.645), so you can reject the null.
Practice Problem
• A researcher thinks that if knee surgery patients go to physical
therapy twice a week (instead of 3 times), their recovery period
will be longer. Average recovery times for knee surgery patients
is 8.2 weeks. State the null hypothesis and alternate
hypothesis.

You need to convert the hypothesis to math. Remember that the average can be sometimes
written as μ.

• H1: μ > 8.2(average)

• H0: μ ≤ 8.2
• H0 (The null hypothesis): μ (the average) ≤ (is less than or equal to) 8.2

• A stronger null hypothesis denotes that if two samples are drawn from the same given
population, such that the variances and shapes of the given distributions are also equal.
Practice Problem
• The average score on a test is 80 with a standard deviation of 10.
With a new teaching curriculum introduced it is believed that this
score will change. On random testing, the score of 36 students, the
mean was found to be 88. With a 0.05 significance level, is there any
evidence to support this claim?
Answer: There is a difference in the scores after the new curriculum
was introduced.
• Solution: This is an example of two-tail hypothesis testing. The z test
will be used.,
• H0: μ = 80, H1: μ ≠ 80
• x¯ = 88, μ = 80, n = 36, σ = 10.
• z = 4.8
• α = 0.05 / 2 = 0.025
• The critical value using the normal distribution table is 1.96
• As 4.8 > 1.96, the null hypothesis is rejected.
Recap: Hypothesis testing framework
1. Set the hypotheses.
2. Calculate Point estimates if not given.
3. Check assumptions and conditions.
4. Calculate a test statistic and a p-value.
5. Make a decision, and interpret it in context of the research
question.
Summry: Hypothesis testing for a
population mean
1. Set the hypotheses
● H0: µ = null value
● HA: µ < or > or ≠ null value
2. Calculate the point estimate
3. Check assumptions and conditions
● Independence: random sample/assignment, 10% condition when sampling
without replacement
● Normality: nearly normal population or n ≥ 30, no extreme skew -- or use
the t distribution (Ch 5)
4. Calculate a test statistic and a p-value (draw a picture!)

5. Make a decision, and interpret it in context


● If p-value < α, reject H0, data provide evidence for HA
● If p-value > α, do not reject H0, data do not provide evidence for HA
Decision errors
● Hypothesis tests are not flawless.
● In the court system innocent people are sometimes wrongly
convicted, and the guilty sometimes walk free.
● Similarly, we can make a wrong decision in statistical
hypothesis tests as well.
● The difference is that we have the tools necessary to quantify
how often we make errors in statistics.
Decision errors (cont.)
There are two competing hypotheses: the null and the
alternative. In a hypothesis test, we make a decision about which
might be true, but our choice might be incorrect.
Decision errors (cont.)
There are two competing hypotheses: the null and the
alternative. In a hypothesis test, we make a decision about which
might be true, but our choice might be incorrect.
Decision errors (cont.)
There are two competing hypotheses: the null and the
alternative. In a hypothesis test, we make a decision about which
might be true, but our choice might be incorrect.
Decision errors (cont.)
There are two competing hypotheses: the null and the
alternative. In a hypothesis test, we make a decision about
which might be true, but our choice might be incorrect.

● A Type 1 Error is rejecting the null hypothesis when H0 is true.


Decision errors (cont.)
There are two competing hypotheses: the null and the
alternative. In a hypothesis test, we make a decision about which
might be true, but our choice might be incorrect.

● A Type 1 Error is rejecting the null hypothesis when H0 is true.


● A Type 2 Error is failing to reject the null hypothesis when HA is
true.
Decision errors (cont.)
There are two competing hypotheses: the null and the
alternative. In a hypothesis test, we make a decision about which
might be true, but our choice might be incorrect.

● A Type 1 Error is rejecting the null hypothesis when H0 is true.


● A Type 2 Error is failing to reject the null hypothesis when HA is
true.

We (almost) never know if H0 or HA is true, but we need to consider all


possibilities.

You might also like