Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Probability and Statistics -Hypothesis testing-I Dr.

T K Datta

Hypothesis Testing

Many problems in engineering require that we decide which of two competing claims or
statements about some parameter is true. The statements are called hypotheses, and the
decision-making procedure is called hypothesis testing. This is one of the most useful aspects
of statistical inference, because many types of decision making problems, tests, or experiments
in the engineering world can be formulated as hypothesis-testing problems. Furthermore, as we
will see, a very close connection exists between hypothesis testing and confidence intervals.
Statistical hypothesis testing and confidence interval estimation of parameters are the
fundamental methods used at the data analysis stage of a comparative experiment in which the
engineer is interested, for example, in comparing the mean of a population to a specified value.

Def: A statistical hypothesis is a statement about the parameters of one or more populations.

In hypothesis testing, we construct two hypotheses, known as ‘null hypothesis’ and ‘alternative
hypothesis’. Null hypothesis is denoted by Ho and the alternative hypothesis is denoted by H1.
These hypotheses are mutually exclusive. When we are testing on a parameter 𝜃, then generally
three possible null hypotheses are 𝜃 ≤ 𝜃0 , 𝜃 ≥ 𝜃0 , 𝜃 = 𝜃0 and the corresponding alternative
hypotheses are 𝜃 > 𝜃0 , 𝜃 < 𝜃0 , 𝜃 ≠ 𝜃0 . We write it as:

𝐻0 : 𝜃 ≤ 𝜃0

𝐻1 : 𝜃 > 𝜃0 …….(1) [one-sided right-tailed test]

𝐻0 : 𝜃 ≥ 𝜃0

𝐻1 : 𝜃 < 𝜃0 …….(2) [one-sided left-tailed test]

𝐻0 : 𝜃 = 𝜃0

𝐻1 : 𝜃 ≠ 𝜃0 …….(3) [2-sided test]

(1) and (2) are one-sided test.


(2) is 2-sided test.

Important: “ = ” sign must be with null hypothesis.

In (1) and (2), we can take the null hypothesis as 𝜃 = 𝜃0 too.

AnS; a) C b) W c) W d) W e) W

1
Probability and Statistics -Hypothesis testing-I Dr. T K Datta

Type I and Type II errors:

Rejecting the null hypothesis H0 when it is true is defined as a type I error.

Accepting the null hypothesis when it is false is defined as a type II error.

P(Type I error) = α (level of significance).

P(type II error) = β.

Power of the test = 1 – β.

1. Draw a random sample from the population.


2. Select a suitable statistic for this test. It is called test statistic.
3. Calculate the observed value of this test statistic.
4. Define the region of rejection at certain significant level. This is called critical
region(CR), denoted by R. The complement of R, i.e., R’ is called the region of
acceptance(AR). Each boundary point of CR and AR is called the critical point or
critical value.
5. If the observed value of the test statistic belongs to this region, reject the null hypothesis
and go in favour of the alternative hypothesis. Accept the null hypothesis if belongs to
R.

Sometimes, we use p-value approach to test in which critical region is not required.

If we assume normality in virtue of central limit theorem, the CR at α level is

1) C = {Z > zα} for right-tailed test;


2) C = {Z < - zα} for left-tailed test;
3) C = { Z < - zα/2 or Z > zα/2} for 2-tailed test

p-value: If the observed value of test statistic is z 0, then p-value is

1) p-value = P(Z > z0) = 1- Φ(z0) for right-tailed test;


2) p-value = P(Z < z0) = Φ(z0) for left-tailed test;
3) p-value = P(Z < -|z0| )+ P(Z > |z0 | ) = 2[1-Φ(|z0|)] for 2-tailed test.

When you are testing a hypothesis, the level of significance should be decided, if not given.
Ideally, it 5%, i.e. α = 0.05.

2
Probability and Statistics -Hypothesis testing-I Dr. T K Datta

Tests on the Mean (μ) of a Normal Distribution, variance (σ2) Known:

Null hypothesis 𝐻0 : μ = μ0

𝑋̅−𝜇0
If the sample size is n, then the test statistic is 𝑍 =
𝜎/√𝑛

H1 CR p-value

𝐻1 : μ > μ0 C = {Z > zα} 1- Φ(z0)

𝐻1 : μ < μ0 C = {Z < - zα} Φ(z0)

𝐻1 : μ ≠ μ0 C = {Z < - zα/2 or Z > zα/2} 2[1-Φ(|z0|)]

Calculation of α from a given critical region when the test is on mean μ:

When test is on normal population mean μ with σ known and is right-tailed.

If the CR is 𝑥̅ > 𝑘, then

𝛼 = 𝑃(𝑥̅ > 𝑘/ μ= μ0)

𝑘−μ0 σ
= 𝑃(𝑧 > σ ) because 𝑋̅ has normal distribution with mean μ and sd .
√𝑛
√𝑛

Solution: a) Here, μ0 =175, n = 10, k = 185, σ = 20.

Probability of type I error =

3
Probability and Statistics -Hypothesis testing-I Dr. T K Datta

185−175
𝛼 = 𝑃(𝑥̅ > 185/ μ= 175) = 𝑃(𝑧 > 20 ) = 1 – Φ(1.58) = 1 - 0.942947 = 0.05705.
√10

b) Probability of type II error

= 𝛽 = 𝑃(𝑥̅ ≤ 185/ μ= 185)

185−185
= Φ( 20 ) = Φ(0) = 0.5.
√10

Power of the test = 1- 𝛽 =0.5

c) Probability of type II error

= 𝛽 = 𝑃(𝑥̅ ≤ 185/ μ= 195)

185−195
= Φ( 20 ) = Φ(-1.58) = 1 – Φ(1.58) = 0.05705.
√10

Power of the test = 1- 𝛽 = 1-.05705 = 0.94295.

Solution:

a) It is right-tailed test.
180−175
p-value = 1- Φ(z0) = 1- Φ( 20 ) = 1 - Φ(0.791) = 1 – 0.7852 = 0.2148.
√10

4
Probability and Statistics -Hypothesis testing-I Dr. T K Datta

Solution:

Solution:
a) 4.85 ≤ 𝑥̅ ≤ 5.15
4.85−μ0 5.15−μ0
Or, ≤𝑧≤
𝜎/√𝑛 𝜎/√𝑛

Or, −1.70 ≤ 𝑧 ≤1.70


So, the critical region is |z| ≥1.70.
But, z0.0446= 1.70.
α/2 = 0.0446.
α = 0.0892.

5
Probability and Statistics -Hypothesis testing-I Dr. T K Datta

b) Here, μ0 + 𝛿 =5.1. So, 𝛿 = 0.1.


𝛽 = ∅(𝑧0.0446 − 1.1314) − ∅(−𝑧0.0446 − 1.1314)
= ∅(0.57) − ∅(−2.83)
= 0.71566 − 0.00242 = 0.71324.
Power of the test = 1 - 𝛽 = 0.28676.
Q1: The life in hours of a battery is known to be approximately normally distributed with
standard deviation σ = 1.25 hours. A random sample of 10 batteries has a mean life of 40.5
hours.
(a) Is there evidence to support the claim that battery life exceeds 40 hours? Use α = 0.05.
(b) What is the P-value for the test in part (a)?

Solution:
H0: μ = 40
H1: μ > 40 (right-tailed test)
Given: σ = 1.25, 𝑥̅ = 40.5, n = 10.
a) CR is C = {Z > 𝑧0.05}= {Z > 1.645}
40.5−40
Zobs = = 1.26 which does not belong to C. So, H0 is accepted. It means
1.25/√10
we can’t support the claim.
b) P-value = 1 – Φ(1.26) = 1- 0.896165 = 0.103835.

Tests on the Mean (μ) of a Normal Distribution, variance (σ2) unknown.

Test Statistics:

6
Probability and Statistics -Hypothesis testing-I Dr. T K Datta

You might also like