0% found this document useful (0 votes)
85 views22 pages

AG213 UNIT 4 QM Revision PDF

This document provides an overview of unit 4 of the course AG213: Statistics for Agriculture. The unit focuses on comparing means between two groups and hypothesis testing. Key points covered include: - Explaining how to compare sample means to determine population mean differences. - Defining null and alternative hypotheses, and how to formulate them to test differences between groups. - How to perform t-tests to test differences between independent and related group means, and calculate acceptance regions and confidence limits. - The different terms introduced in the unit, such as definition and calculation formulae for standard deviation and variance. - An example of using a two sample t-test to test differences between independent groups using data

Uploaded by

Naiker Kaveet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views22 pages

AG213 UNIT 4 QM Revision PDF

This document provides an overview of unit 4 of the course AG213: Statistics for Agriculture. The unit focuses on comparing means between two groups and hypothesis testing. Key points covered include: - Explaining how to compare sample means to determine population mean differences. - Defining null and alternative hypotheses, and how to formulate them to test differences between groups. - How to perform t-tests to test differences between independent and related group means, and calculate acceptance regions and confidence limits. - The different terms introduced in the unit, such as definition and calculation formulae for standard deviation and variance. - An example of using a two sample t-test to test differences between independent groups using data

Uploaded by

Naiker Kaveet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

AG213: Statistics for Agriculture

Unit 4 Differences between m eans


and hypothesis testing

Learning Outcomes
This unit will focus on comparing two independent and dependent/related groups.
At the end of this unit, you should be able to:
 Explain how comparing two groups at the sample level can be applied to
determine the difference between the same groups at the population level.
 Define the Null Hypothesis (Ho) and Alternative Hypothesis (HA) in general
terms then formulate a hypothesis about difference between two groups for a
specific example.
 Test a hypothesis about difference between two independent groups using t-
test.
 Calculate acceptance region and confidence limits for difference between
independent group means.
 Carry out 2-sample t-test for appropriate data.
 Test a hypothesis about difference between two related groups using t-test.
 Calculate acceptance region and confidence limits for difference between
related group means.
 Carry out paired t-test for appropriate data.
 Differentiate between one tailed and two tailed tests.
 Explain the terms presented in this unit.

4.1 Introduction
In this unit we will extend our study of variation between individuals and groups to a
study of methods for comparing groups. To do this we will look at how differences
between group means can vary. Then we will draw conclusions about the likelihood
that two groups have been sampled from one population, or, alternatively, come from
different populations.

4.2 Why group comparisons are made?


In Unit 3 you learnt that groups taken at random from a population have means that
vary around the true mean of the population. You also learnt that the distribution of
these sample means followed what is called a t-distribution. Remember that this is
somewhat like the normal distribution of individual measurements but it has

Unit 4: Differences between means and hypothesis testing 4.1


AG213: Statistics for Agriculture

relatively longer tails and a lower peak. Another important point is that the t-
distribution changes shape with changes in the number of individual items included
in the sample.
You also saw in Unit 3 that one could estimate the expected standard deviation of
sample means (called the Standard Error of the Mean) from the standard deviation of
individual items in one sample and the number of items measured. With this, and
tables of the t-distribution, confidence intervals could be calculated within which we
would expect to find the population mean. These procedures give us useful
information about a sample and the population it came from. However, we will often
want to do more than that – we will want to compare different groups and draw
conclusions about possible differences between the populations they came from.
Such comparisons are the basis of agricultural experiments and observations that we
often use to help us make decisions.
In experimental situations we might want to decide, for example, whether:
 An insecticide will reduce blemishes on fruit.
 Fertiliser will increase plant growth.
 An amino acid supplement will make up for a deficiency in pig diets.
 Local materials can replace imported feeds in chicken rations.
For each of these examples we would impose different treatments on groups of
subjects that were initially the same and then compare the groups after the
experimental treatment.
In an observational situation we might want to decide whether:
 A new hybrid variety of coconuts produces more than a local variety.
 The meat from female animals contains more fat than meat from males.
 Taro Niue tastes better than Alafua Sunrise.
 Brahman cattle are better adapted to tropical conditions than Herefords.
Here we start with subjects with different characteristics and compare the two groups
for other features that interest us. No experiments or treatments are involved.
In all of the above cases we will still be making comparisons between samples and
drawing conclusions about possible differences between the populations that they
came from or the populations that had been given different treatments. In this unit we
will study the methods for making comparisons by considering the simplest situation
of examining two groups. For example, in an experiment there might be one treated
group and one group not treated (called a control group). For observations, we may
compare one group of females with another group of males.

Unit 4: Differences between means and hypothesis testing 4.2


AG213: Statistics for Agriculture

4.3 Hypotheses about differences between


populations
A hypothesis is a theory or an idea. Researchers usually begin with a hypothesis and
then set out to prove whether the hypothesis is true. For example, a scientist might
hypothesise that the introduction of geese (large birds that enjoy eating snails) into
Samoa will eliminate all the African snails. This is his/her ‘theory’ or ‘idea’. Next
the scientist must test the hypothesis to discover whether it is right or wrong. The
correct use of statistical procedures is an essential part of the process of proving
whether the findings are true or not.
Consider two groups which are samples from two populations. If the sample groups
have different means for some feature, there are two possible explanations for this:
(a) There is a real difference in that feature between the populations the groups
were sampled from (illustrated in Figure 4.1) or:
(b) There is no real difference between the populations with regard to that
feature. The groups we have studied are effectively just random samples from
the same population (for the feature) and the difference between the samples
is just due to chance (illustrated in Figure 4.2).

Figure 4.1: Illustration of samples drawn from two different populations.

Figure 4.2: Illustration of two samples taken from the same population where the samples differ by
chance.

Unit 4: Differences between means and hypothesis testing 4.3


AG213: Statistics for Agriculture

As we only have the samples and not the populations, we do not really know which
of these two possible situations is true. We therefore have to make a hypothesis (a
theory) and we start by assuming that situation (B) is true, that is, there is no
difference between the populations. This is called the null hypothesis (Ho). Situation
(A) is then called our alternative hypothesis (HA), that there is a real difference
between the populations.
In statistical analyses we always start with the null hypothesis (assume no difference
between populations) and we then calculate the probability that our observed
difference between samples could happen just by chance. If this probability is too
small to be reasonable, we reject the null hypothesis and accept the alternative
hypothesis. In other words, we say that it is not likely the two samples could have
come from the same population and we assume that the populations they came from
are really different.
Before proceeding, it is important to note that the formulae for the standard deviation
and the variance of a sample you learnt in Unit 3 are known in statistics as definition
formulae. In other words, the definition formulae for the standard deviation and
variance of a sample can be used for calculations as well as for describing in words
what they mean. However, when you are handling a large set of data from a sample,
their applications to calculations can be quite laborious, even with a scientific
calculator. Alternative formulae for the standard deviation and variance of a sample
exist and they are normally referred to in statistics as calculation formulae. The
calculations involved are undemanding especially when a scientific calculator is
used.

The calculation formula for the standard deviation of a sample is:

 x
 x  n
2
2

s
n 1
and that for the variance of a sample is:

 x
 x  n
2
2
SS
s2  
n 1 df

(SS = sum of squares; df = degrees of freedom = n – 1)

The Σx refers to x1 + x2 + x3 + …+ xn, and Σx2 refers to x12 + x22 + x32 + … + xn2. In
this unit, we will use these calculation formulae to calculate these two sample
statistics.

Unit 4: Differences between means and hypothesis testing 4.4


AG213: Statistics for Agriculture

Activity 4.1
It is important that you have a clear understanding of the terms we have just been
introducing you to. Read through this first section of Unit 4 again and then write
down in your own words definitions for the following terms:

 Hypothesis
 Null hypothesis
 Alternative hypothesis
 Definition formulae
 Calculation formulae

4.4 Two (2) sample T-test of differences


between independent groups

Equal group sizes


We will illustrate the t-test using an example from a taro variety trial with a step-by-
step outline of the procedures. Table 4.1 gives the average weights of two varieties
of individual taro corms grown in eight plots.

Table 4.1: Corm weights (g) of two varieties of taro

Variety 1 Variety 2

890 957
522 909
849 1081
885 1134
990 1133
1018 933
632 974
697 849

Before we deal with the methods for calculating the t-test we need to extend slightly
our mathematical notation so that we can represent statistics for the different groups.
We do this by writing a numerical subscript after the symbol for the statistic, as
shown on the next page.

Unit 4: Differences between means and hypothesis testing 4.5


AG213: Statistics for Agriculture

n1 = number in variety 1 n2 = number in variety 2

df1 = (n1-1) = degrees df2 = (n2-1) = degrees of


of freedom freedom for
for variety 1 variety 2

x1 = mean of variety 1 x2 = mean of variety 2

s1 = standard deviation of s2 = standard deviation of


variety 1 of variety 2

Using the methods you learnt in Unit 3 and the calculation formulae introduced
earlier in this unit, you should now be able to calculate these sample statistics for the
two groups and verify the following:

For variety 1:

n1 = 8 df1 = 7

_
x1 
 x  6483  810.38 g
n1 8

 x
 x  n
2
2
5470267 
6483
2

s1  1
 8  175.908g
n1  1 7

For variety 2:

n2 = 8 df2 = 7

_
x2 
 x  7970  996.25 g
n2 8

 x
 x  n
2
2
8020302 
7970
2

s2  2
 8  107.031g
n 2 basic
Now with these 1 7 group we can carry out the t-test using the
statistics for each
procedure given on next page.

Unit 4: Differences between means and hypothesis testing 4.6


AG213: Statistics for Agriculture

Step 1 Hypotheses

Define the null hypothesis and the alternative hypothesis.

The null hypothesis is that there is no real difference in corm weight between the two
taro varieties that the sample groups were taken from, or simply:

HO : 1 = 2

The alternative hypothesis is that there is indeed a real difference in corm weight
between the varieties that the sample groups were taken from, or simply:

HA : µ1 ≠ µ2

Step 2 Pooled variance

Calculate a weighted average of the two variances. This is called the pooled
variance with the symbol s2pooled.

s 2pooled 
n1  1s12  n 2  1s 22 
SS1  SS 2
n1  n 2  2 df1  df2

(7)(175.908) 2  (7)(107.031) 2

882

= 21199.88 g2

Step 3 Standard error of difference

Calculate the standard error for the difference between the group means.

2  s 2pooled
sed  s  _ _  
 x1  x 2  n
 

sed = 2(21199.88)
 72.80 g
8

Step 4 t-value

Look up the t-table (Table 3.4) in the 95% column for the degrees of freedom of the
difference which is simply df1 + df2 = 7 + 7 = 14.

t0.05,14  2.145

Unit 4: Differences between means and hypothesis testing 4.7


AG213: Statistics for Agriculture

Step 5 Acceptance limits


Multiply the standard error of the difference by the t-value to obtain the acceptance
limits.
We expect differences between these limits to occur by chance when there is no real
difference between the populations from which the samples were taken. Therefore,
we call the region between these limits the Acceptance region; and if the difference
between the group means is within this region we accept the null hypothesis, i.e., we
say that there was no real difference between the populations the groups were taken
from.
( s( X1  X 2 ) )(t.05,14 )  (72.80)(2.145)  156.16 g
Step 6 Observed difference

Calculate the observed difference between the group means.

_ _
( x1  x 2 )  (810.38  996.25)  185.87 g

Step 7 Conclusion
Compare the observed difference in step 6 with the acceptance region calculated in
step 5.

In this case the observed difference (-186 g) is outside the acceptance region (  156
g), so we reject the null hypothesis and instead accept the alternative hypothesis
(there is a real difference between the populations – the varieties, i.e., 1  2). This
is illustrated in Figure 4.3. Notice that the difference and acceptance limits displayed
in the figure have been rounded off to the nearest gram. At least two decimal places
were maintained in the calculations to avoid rounding off errors (see Unit 2), but it
would be unrealistic to imply such an accuracy of measurement when presenting the
results of an investigation in a report.

Figure 4.3: t-distribution of differences between two means (df = 14) showing limits of the
acceptance region for the example data in Table 4.1.

Unit 4: Differences between means and hypothesis testing 4.8


AG213: Statistics for Agriculture

By convention, if an observed difference between samples is outside the acceptance


region we say that it is Significant, while if it is within the acceptance region it is not
significant. The logic of the analysis is that we test the significance of the difference
between the samples, and from this make a conclusion about the difference between
the populations the samples came from on the basis of our original hypothesis. This
is what is called inferential statistics.

Confidence limits for difference


In the same way that we calculated confidence limits for an individual mean in Unit
2, we can produce confidence limits for difference between two populations. For this
we use the t-value for the difference (step 4) and the standard error of the difference
(step 3):

_ _ 
Confidence limits for difference =  x1  x 2   (t0.05,14 )(s( x1  x2 ) )
 
= -185.87  (2.145)(72.80)

= -185.87  156.16
We can add to our conclusion, therefore, and say that variety 1 has lower corm
weights than variety 2, with a 95% probability that the true difference between the
populations that the samples came from lies between the following limits:

Upper limit: -185.87 + 156.16 = - 30 g


Lower limit: -185.87 - 156.16 = -342 g

Note that this method for calculating the t-test is slightly different to that used in
most text books. We have found that this one makes it easier for students to
understand why a null hypothesis is accepted or rejected. The more conventional
method used in most text books is outlined below.

The conventional/alternative method (The critical t


value method)
Step 1 to step 3 are the same as outlined earlier. After that carry out the following:
Step 4 Acceptance limits – the critical t–value.
Look up the t-table as before but now define the acceptance limits as plus and minus
this value.
Acceptance limits = 2.145
Step 5 Observed difference
Calculate the observed difference between the group means.
( x1 - x2 ) = (810.38 - 986.25)= - 185.87 g

Unit 4: Differences between means and hypothesis testing 4.9


AG213: Statistics for Agriculture

Step 6 Observed t-value


Divide this observed difference by the standard error of the difference, ignoring the
sign of the standard error. This gives an observed t-value (to ).
( x1 - x 2 ) - 185.87
to = = = - 2.553
s( X 1 - X 2 ) 72.80
Step 7 Conclusion
Compare the observed t-value with the acceptance limits defined in step 4.
As the observed t-value (-2.553) is outside the acceptance limits of ±2.145, we reject
the null hypothesis and conclude that there is a real difference between the
populations the samples came from (the varieties).
This system essentially converts the differences to standard units (t-values) before
comparisons are made. It has an advantage in that we can calculate the actual
probability of obtaining the observed t-value by chance if the null hypothesis is true,
although tables or a computer routine are needed. In the example, the probability of
obtaining an observed t-value of ±2.553 by chance is 0.023 or 2.3%. Figure 4.4
illustrates the acceptance region re-scaled into t-units and the location of the
observed t-value.

Figure 4.4: Acceptance limits and the observed difference between means. When the data illustrated
in Figure 4.3 are expressed in t units (i.e., divided by the standard error of the difference).

Now, to practice the t-test method, please revise the steps and then complete Activity
4.2

Unit 4: Differences between means and hypothesis testing 4.10


AG213: Statistics for Agriculture

Activity 4.2
Observations were made of the annual nut production from 10 trees each of two
cultivars of dwarf coconuts. The numbers of nuts counted are given in Table 4.2.
Compare the production of the two varieties using a 2 sample t-test after stating an
appropriate null hypothesis. Make a conclusion from the test about the productivity
of the populations that the sample trees were taken from, and calculate the 95%
confidence limits of the difference between the populations.
Table 4.2: Annual nut production of two varieties of dwarf coconuts

Cultivar 1 Cultivar 2
162 134
115 58
176 67
200 108
217 89
181 52
191 190
168 93
149 127
149 130

In your answer:
 State the null and the alternative hypotheses;
 Show all step by step working/calculations; and,
 Draw conclusions about the two populations (cultivars) that the samples were
taken from. That is, comment about the differences in the productivity of the
two dwarf cultivars of coconuts.

Unequal group sizes


It is possible to use the t-test even if there are different numbers of measurements in
each group, i.e., different sample sizes. The only change in procedure is in Step 3 for
calculating the standard error of the difference between the means. For unequal
sample sizes, the standard error of the difference is calculated as follows:

1 1 
sed  s  _ _ 
 s 2pooled    
 x1  x 2 
 
 n1 n 2 

Unit 4: Differences between means and hypothesis testing 4.11


AG213: Statistics for Agriculture

All other steps are calculated as outlined above or with the conventional method.
It is important that you can recognise when to use this modified method for
comparing groups that have unequal sizes. For more practice in doing this and the
calculations involved, stop now and complete Activity 4.3.

Activity 4.3
In a survey of sweet potato yields in village gardens, available soil Phosphorus (P)
was measured. The gardens were classed as below or above average P. The yields of
sweet potato are listed in Table 4.3. State a null hypothesis and do a 2 sample t-test.
What is your conclusion?
Table 4.3: Yields (t/ha) of sweet potato
Below average P Above average P
12.0 14.3
12.3 15.2
11.4 11.2
9.0 15.5
9.5 13.8
8.9 15.4
10.0 12.2
10.3
11.5

In your answer:

 State the null and the alternative hypotheses;


 Show all step by step working/calculations; and,
 Draw conclusions about the two populations (P levels) that the samples were
taken from. That is, comment about the differences in the yield of sweet
potatoes grown on soils with above and below average levels of P.

4.5 Paired sample T-test of differences


between related/dependent groups
So far in this unit we have made comparisons where the members of each group are
independent of those in the other group. Thus, in Table 4.1, there was no relationship
between the plants in variety 1 and those in variety 2. This is a very common
situation, but there is another useful technique that can be applied in particular cases.
Here, pairs of similar individuals are selected at the start of an experiment; then one

Unit 4: Differences between means and hypothesis testing 4.12


AG213: Statistics for Agriculture

treatment is applied to one member of each pair while a second treatment is applied
to the other member of the pair.
Examples of meaningfully ‘paired’ individuals are pairs of female piglets from the
same litter. Each pair will be full sisters so they will be genetically similar and share
a common maternal environment. This pair is as close to being exactly alike as
possible which means that any treatment applied that results in significantly different
findings will most likely be because of the treatment. The pairs would be taken from
a number of litters. In another case, pots in a shade house can be arranged in pairs so
that variation in light, temperature or other position effects will be similar for each
pair. When we use pairs that are almost perfectly the same we are said to be
controlling all the other variables that could upset the experiment.
A special use of this technique involves self-pairing. Each individual is measured
before and after a treatment is applied, or two treatments are applied to different
sides of the same individual. These are particularly useful when there is wide
variation between individuals. We will illustrate the analysis method with this type
of paired experiment, but it is the same for any type of pairing.
Table 4.4 gives data from a paired experiment. They are the number of lesions on
tobacco leaves caused by two different preparations of a virus extract. One
preparation was applied to half of a leaf while the second preparation was applied to
the other half. Thus, the two halves of the same leaf were the pair and this was
repeated on a number of plants. The table also shows the calculations needed for the
analysis.
Table 4.4: Number of lesions on half tobacco leaves

Pair Prep. 1 Prep. 2 Difference (d)


1 31 18 13
2 20 17 3
3 18 14 4
4 17 11 6
5 9 10 -1
6 8 7 1
7 10 5 5
8 7 6 1
Total 120 88 32
Mean 15 11 4

(Source: Snedecor, G.W. and Cochran, W.G. (1980). Statistical Methods 7th ed.
Iowa State University Press, Ames. 99 86-87.)

Unit 4: Differences between means and hypothesis testing 4.13


AG213: Statistics for Agriculture

Step 1 Hypotheses
Define the null hypothesis and the alternative hypothesis.
Null hypothesis
First we have to set up a null hypothesis. This is: There is no difference between the
virus extracts in the number of lesions they cause on tobacco leaves. If this is true,
then we expect the mean difference to be 0, or simply:

HO: D =0
Alternative hypothesis
There is indeed a real difference between the virus extracts in the number of lesions
they cause on tobacco leaves.

HA: D ≠0

Step 2 Mean difference


As there are eight pairs the mean difference is:

d 
d 
32
4
n 8
Where n, in this case, is the number of pairs (which is eight) and NOT the number of
individual values from the two virus extract preparations, which is 16.

Step 3 Standard deviation of mean difference


The standard deviation of differences between pairs is:

 d
 d  n
32
2 2
2
258 
sd   8  4.309
n 1 8 1
Step 4 Standard error of mean difference
The standard error of the mean difference is:

sd  4.309
sd = = =  1.52
n 8

Step 5 Acceptance limits


For the mean difference there are (n-1) = 7 degrees of freedom so we look up the t-
value for this at the 95% level of Table 3.3 in Unit 3. This is 2.365, so the acceptance
region for the null hypothesis is:
Acceptance region= ( t 0.05,7 )( s d ) = (2.365)( 1.52)=  3.59

Unit 4: Differences between means and hypothesis testing 4.14


AG213: Statistics for Agriculture

Step 6 Conclusion
As the mean difference of 4 is outside this acceptance region we reject the null
hypothesis and conclude that there is a real difference between the virus extracts in
the number of D  0 they produce, i.e.,
lesions
Step 7 Confidence limits
Following this conclusion, we will be interested in estimating confidence limits for
the mean difference from our analysis. We saw earlier that these are simply the mean
difference plus the acceptance limits. Thus:

Upper limit: 4 + 3.59 = 7.59


Lower limit: 4 – 3.59 = 0.41
We can say that there is a 95% probability that the real difference between the
vaccine preparations is within these limits.
As with the 2-sample t-test for independent groups, a slightly different and more
conventional method used in most text books can also be used and is outlined below.

The conventional/alternative method (The c ritical t


value method) for paired sample t-test
Follow the steps outlined in section 4.5 as far as the calculation of the acceptance
limits. With the alternative procedure we have:

Observed t-value (t0) = d 4


  2.63
sd 1.52
Acceptance limits or Critical t-value = ±t0.05,7 = ±2.365

Conclusion
As the observed t-value is outside the acceptance region, we reject the null
hypothesis as before.

Activity 4.4
In a study of change in blood cholesterol after heart attack, cholesterol levels were
measured for the same patients after 2 and 4 days (Table 4.5). State an appropriate
null hypothesis for the change in cholesterol level and carry out a paired sample t-
test. Make a conclusion about the change and calculate the 95% confidence limits.

Unit 4: Differences between means and hypothesis testing 4.15


AG213: Statistics for Agriculture

Table 4.5: Cholesterol levels after heart attack (mg/L).


Patient 2 days 4 days
1 270 218
2 236 234
3 210 214
4 142 116
5 280 200
6 272 276
7 160 146
8 220 182
9 226 238
10 242 288
11 186 190
12 234 220

(Source of data: Ryan, B.F., Joiner, B.L. and Ryan, T.A. (1985) MINITAB Handbook
2nd ed. PWS-Kent Publishing Company, Boston. p.92)

In your answer:

 State the null and the alternative hypotheses;


 Show all step by step working/calculations for the paired sample t-test; and,
 Draw conclusions about the two populations (blood cholesterol after 2 and 4
days after heart attack) that the samples were taken from. That is, comment
about the differences in the blood cholesterol at 2 and 4 days following heart
attack.

Important notes about the 95% confidence limits


When there is a real/significant difference between two means, the values for
confidence limits will either be both positive or both negative. That is, the
confidence interval will never include zero.
When there is no real/significant difference between the two means, the values for
confidence limits will include one positive value and one negative value. That is, the
confidence interval will include zero.

Unit 4: Differences between means and hypothesis testing 4.16


AG213: Statistics for Agriculture

4.6 Types of errors in test of hypothesis

What are type I and type II errors?


No hypothesis test is 100% certain. Because the test is based on probabilities, there is
always a chance of making an incorrect conclusion. When a hypothesis test is carried
out, two types of errors are possible: Type I and Type II. The risks of these two
errors are inversely related and determined by the level of significance and the power
for the test. Therefore, you should determine which error has more severe
consequences for your situation before you define their risks.

Type I error
When the null hypothesis is true and you reject it, you make a type I error. The
probability of making a type I error is α, which is the level of significance you set for
your hypothesis test. An α of 0.05 indicates that you are willing to accept a 5%
chance that you are wrong when you reject the null hypothesis. To lower this risk,
you must use a lower value for α. However, using a lower value for alpha means that
you will be less likely to detect a true difference if one really exists.

Type II error
When the null hypothesis is false and you fail to reject it, you make a type II error.
The probability of making a type II error is β, which depends on the power of the
test. You can decrease your risk of committing a type II error by ensuring your test
has enough power. You can do this by ensuring your sample size is large enough to
detect a practical difference when one truly exists.
The probability of rejecting the null hypothesis when it is false is equal to 1–β. This
value is the power of the test.

Truth about the population

Decision based
H0 is true H0 is false
on sample

Type II Error
Correct Decision
Retain H0 Accepting H0 when it is false
(probability = 1 - α)
(probability = β)
Type I Error
Correct Decision
Reject H0 Rejecting H0 when it is true
(probability = 1 - β)
(probability = α)

Unit 4: Differences between means and hypothesis testing 4.17


AG213: Statistics for Agriculture

Example of Type I and Type II error


To understand the interrelationship between type I and type II error, and to determine
which error has more severe consequences for your situation, consider the following
example.
A medical researcher wants to compare the effectiveness of two medications. The
null and alternative hypotheses are:
 Null hypothesis (H0): μ1= μ2
 The two medications are equally effective.
 Alternative hypothesis (H1): μ1≠ μ2
The two medications are not equally effective.
A Type I error occurs if the researcher rejects the null hypothesis and concludes that
the two medications are different when, in fact, they are not. If the medications have
the same effectiveness, the researcher may not consider this error too severe because
the patients still benefit from the same level of effectiveness regardless of which
medicine they take. However, if a Type II error occurs, the researcher fails to reject
the null hypothesis when it should be rejected. That is, the researcher concludes that
the medications are the same when, in fact, they are different. This error is
potentially life-threatening if the less-effective medication is sold to the public
instead of the more effective one.
As you conduct your hypothesis tests, consider the risks of making Type I and Type
II errors. If the consequences of making one type of error are more severe or costly
than making the other type of error, then choose a level of significance and a power
for the test that will reflect the relative severity of those consequences.

4.7 About the null and alternative


hypotheses
The null and alternative hypotheses are two mutually exclusive statements about a
population. A hypothesis test uses sample data to determine whether to reject the null
hypothesis.

Null hypothesis (H0)


The null hypothesis states that a population parameter (such as the mean, the
standard deviation, and so on) is equal to a hypothesized value. The null hypothesis
is often an initial claim that is based on previous analyses or specialized knowledge.

Alternative Hypothesis (H1)


The alternative hypothesis states that a population parameter is smaller, greater, or
different than the hypothesized value in the null hypothesis. The alternative
hypothesis is what you might believe to be true or hope to prove true.

Unit 4: Differences between means and hypothesis testing 4.18


AG213: Statistics for Agriculture

One-sided and two-sided hypotheses or tests

The alternative hypothesis can be either one-sided or two sided.

Two-sided
Use a two-sided alternative hypothesis (also known as a non-directional hypothesis)
to determine whether the population parameter is either greater than or less than the
hypothesized value. A two-sided test can detect when the population parameter
differs in either direction, but has less power than a one-sided test.

One-sided
Use a one-sided alternative hypothesis (also known as a directional hypothesis) to
determine whether the population parameter differs from the hypothesized value in a
specific direction. You can specify the direction to be either greater than or less than
the hypothesized value. A one-sided test has greater power than a two-sided test, but
it cannot detect whether the population parameter differs in the opposite direction.

Examples of two-sided and one-sided hypotheses

Two-sided
A researcher has results for a sample of students who took a national exam at a high
school. The researcher wants to know if the scores at that school differ from the
national average of 850. A two-sided alternative hypothesis (also known as a non-
directional hypothesis) is appropriate because the researcher is interested in
determining whether the scores are either less than or greater than the national
average. (H0: μ = 850 vs. H1: μ≠ 850)

One-sided
A researcher has exam results for a sample of students who took a training course for
a national exam. The researcher wants to know if trained students score above the
national average of 850. A one-sided alternative hypothesis (also known as a
directional hypothesis) can be used because the researcher is specifically
hypothesizing that scores for trained students are greater than the national average.
(H0: μ = 850 vs. H1: μ > 850)

4.8 Level of significance


The level of significance is defined as the probability of rejecting a null hypothesis
by the test when it is really true, which is denoted as α. That is, P (Type I error) = α.
This quantity ranges from zero (0.0) to one (1.0) and is typically denoted by the
Greek letter alpha (α). The significance level is sometimes referred to as the
probability of obtaining a result by chance alone. As this quantity represents an
"error rate," lower values are generally preferred. In the literature, nominal values of
a generally range from 0.05 to 0.10. The significance level is also referred to as the
"size of the test" in that the magnitude of the significance level determines the end
points of the critical or rejection region for hypothesis tests.

Unit 4: Differences between means and hypothesis testing 4.19


AG213: Statistics for Agriculture

Confidence level
Confidence level refers to the possibility of a parameter that lies within a specified
range of values, which is denoted as c. Moreover, the confidence level is connected
with the level of significance. The relationship between level of significance and the
confidence level is c=1−α.
The common level of significance and the corresponding confidence level are given
below:

 The level of significance 0.10 is related to the 90% confidence level.


 The level of significance 0.05 is related to the 95% confidence level.
 The level of significance 0.01 is related to the 99% confidence level.
The rejection rule is as follows:

Rejection region:
The rejection region is the values of test statistic for which the null hypothesis is
rejected.

Non rejection region:


The set of all possible values for which the null hypothesis is not rejected is called
the rejection region.

The rejection region for two-tailed test is shown below:

Unit 4: Differences between means and hypothesis testing 4.20


AG213: Statistics for Agriculture

The rejection region for one-tailed test is given below:

 In the left-tailed test, the rejection region is shaded in left side.


 In the right-tailed test, the rejection region is shaded in right side.

Revision of terms
When you have finished the analyses in Activities 3.2, 3.3 and 3.4, revise the unit and
answer the short questions below:

Activity 4.5
1. What distribution does the differences between sample means follow?
2. What is a null hypothesis?
3. What is the standard error of the difference between means?
4. What is an acceptance region?
5. When is a difference between means significant?
6. What conclusion is drawn when a difference between means is significant?
7. What is a paired sample t-test?
8. When is a paired experiment useful?

Unit 4: Differences between means and hypothesis testing 4.21


AG213: Statistics for Agriculture

Online Educational Resources


https://statisticsbyjim.com/hypothesis-testing/types-errors-hypothesis-testing/
https://www.youtube.com/watch?v=pTmLQvMM-1M
https://www.youtube.com/watch?v=zD3VIBkwc-0

Unit 4: Differences between means and hypothesis testing 4.22

You might also like