You are on page 1of 15

Hypothesis Testing

Example problem
• Agricultural extension service wants to determine whether the mean yield per
acre of soybean, due to the introduction of a new variety in a district has
increased during the current year over the mean yield of the last year. Last
year’s mean yield, μ1, was 1100 kg per hectare. The current year’s mean yield
μ2, is unknown.
• To estimate μ2 , samples are collected from 50 farmers of each of the 14 talukas
across the district. The mean and standard deviation are calculated for this
sample set. This mean is = 1150, how do we know μ2 is greater than μ1 ?
Last year’s mean yield, μ1, was 1100 kg per hectare. To estimate current year’s mean yield μ2 , samples are collected.
Sample mean is = 1150, how do we know μ2 is greater than μ1 ?

μ2 ?

If is less than what is the likelihood


of getting = 1150 ?

Is it plausible that this sample, with


its mean of 1150, could have come
μ2 from a population whose mean is
1100 or less?

= 1150

There may be two answers to this question:


1. is smaller than and is greater than this only because of random variation and the new variety has not succeeded in
increasing the yield
2. is greater than , and reflects this fact and the new variety is successful and may now be introduced across the state
We can find the likelihood of getting = 1150 when

𝜎𝑋 Find the z-score (compute the test statistic)

z =
μ2

= 1150

Probability of finding = 1150 when . If it is less than a certain value, we can say that being greater than 1100 is plausible
Given that σ =120, what is the probability of = 1150 or greater?

z = = = ? Probability of z-score = 2.95 and greater, = .0015

Hence if we consider a significance level of 1%, then it is plausible that is greater than 1100

This is the sort of question that hypothesis tests are designed to address.
Hypothesis Testing
• Null Hypothesis – Nothing has changed, or the sample mean is opposed to the Null Hypothesis because of random
variation. i.e. it has occurred due to the small likelihood that it may.
• Alternate Hypothesis – The sample mean accurately reflects the underlying population. Hence if the sample mean is
greater than the old µ, it is because the new µ is greater.
Null Hypothesis H0 : μ ≤ 1100
Alternate Hypothesis H1 : μ > 1100
• Compute the test statistic for the observed value (), when H0 is
true
X ~ N(1100, ) z=
𝜎𝑋
• Identify the rejection region for the test statistic (All values with
disagreement equal to and greater than the observed value)
• Probability of finding the test statistic in the rejection region is
the p-value p-value
• If the p-value is greater than the significance level then H0 is
plausible

= 1150
Problem
A certain type of automobile engine emits a mean of 100 mg/s of oxides of nitrogen (NOx ). A modification to the engine
design has been proposed that may reduce NOx emissions. The new design will be put into production if it can be
demonstrated that its mean emission rate is less than 100 mg/s. A sample of 50 modified engines are built and tested. The
sample mean NOx emission is 92 mg/s, and the sample standard deviation is 21 mg/s.

• H0 : μ ≥ 100 H1 : μ < 100


• X ~ N(100, ) z =
H0 and oppose each other
= 92 μ = 100

• Identify the rejection region for the test statistic


Rejection regions: All values which have a disagreement with H0, such that the disagreement is equal to and greater than
the observed value

Find the z-score; z = - 2.69;


From z-table, F(-2.69) = 0.0036; p-value = 0.0036
Consider significance level as 5%, p-value*100 = .36% is < 5%, hence H0 is rejected
=> New engine will lower emissions. This result is statistically significant at the 5% level.
Problem
• When farmers use furrow irrigation for irrigating gram crop, the irrigation depth is an
average of 55 mm. It was noted that many farmers now use sprinkler to irrigate gram
because there are several advantages to it including reduced labour, ease of irrigating at
night. However, it was unclear under what conditions, or if at all, sprinkler results in
reduction of irrigation water application. Hence a study was conducted, wherein the
irrigation depth for 30 farmers using sprinkler was measured. Sample mean and standard
deviation were found to be of 48 mm, and 25 mm respectively. Can we conclude that
sprinkler usage results in reduced irrigation depth?
Example where μ ≠ μ0
A scale is to be calibrated by weighing a 1000g test weight 60 times. The 60 scale readings have mean 1000.6g and
standard deviation 2g. We want to know if the scale is fine, or it needs to be recalibrated.
i.e. Is a result of 1000.6 plausible for a weight of 100 g, if the scale works correctly.

H0 : μ = 1000 = 1000.6, opposes H0


H1 : μ ≠1000
• Identify the rejection region for the test statistic (All values with disagreement equal to and greater than the
observed value):
< 999.4 and > 1000.6
z=
z < -2.32 and z > 2.32

p-value = 2 * F (-2.32) = 2*.0102 = .0204


p-value = 2.04%

Therefore, if H0 is true, the probability of a result as extreme as or more extreme than that observed is only
2.04 %. The evidence against H0 is pretty strong. It would be prudent to reject H0 and to recalibrate the scale.
One-tailed and two-tailed tests

• Whenever p-value is less than a particular threshold, the result is said to be “statistically significant”
at the 100α% level.
• The null hypothesis is rejected at the 100α% level.

Problem:
A hypothesis test is performed of the null hypothesis H0 : μ = 0. The p-value turns out to be 0.03. Is the
result statistically significant at the 10% level? The 5% level? The 1% level? Is the null hypothesis
rejected at the 10% level? The 5% level? The 1% level?
Significance level (terminology)
• Whenever p-value is less than a particular threshold, the result is said to be
“statistically significant” at the 100α % level.
• The null hypothesis is rejected at the 100α % level.
• Reporting the p-value rather than just the significance level gives more
information about the strength of the evidence against the null hypothesis and
allows each reader to decide for himself or herself whether to reject

• A hypothesis test is performed of the null hypothesis H0 : μ = 0. The P-value


turns out to be 0.03. Is the result statistically significant at the 10 % level? The
5 % level? The 1 % level? Is the null hypothesis rejected at the 10 % level? The
5 % level? The 1 % level?
Notes about p-value
• The smaller the P-value, the more certain we can be
that H0 is false. 𝜎𝑋

• The larger the P-value, the more plausible H0


becomes, but we can never be certain that H0 is true. p-value
μ2
• A rule of thumb suggests to reject H0 whenever P ≤
0.05. While this rule is convenient, it has no scientific
basis. = 1150

• The equality always goes with the Null hypothesis because we want to test H0 with the value
closest to H1 . Without the equality we would not have a Null distribution with any value closest
to H1.
• The P-value is not the probability that H0 is true. H0 Is true or not true – since it is a phenomena
from the real world. It is the probability of finding an of a certain value given H0.
Other notes
• Note that the method we have just described uses the Central Limit Theorem. It
follows that for this method to be valid, the sample size must be reasonably
large, say 30 or more.
• For a large enough sample we may equate the sample standard deviation with
the population standard deviation.
i.e. s = ( )
• The calculation of the p-value was done by computing a z-score. For this reason,
the z-score is called a test statistic. A test that uses a z-score as a test statistic is
called a z test.
• What we covered is a ‘large sample test’. When large enough samples are not
available (< 30), the z test is not used.
• Important to select H0 correctly:
• Specifications for a water pipe call for a mean breaking strength μ of more
than 2000 lb per linear foot. Engineers will perform a hypothesis test to
decide whether or not to use a certain kind of pipe. They will select a random
sample of 1 ft sections of pipe, measure their breaking strengths.

• Assume the engineers test H0: μ ≥ 2000 versus H1 : μ < 2000. Will the
engineers decide to use the pipe if H0 is rejected? What if H0 is not rejected?
End of slide deck

You might also like