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

Difference between a two-tailed and one tailed test

A two-tailed test is a test where the null hypothesis specifies a single


value of the population parameter i.e.
 H0: µ = µ0
 H1: µ ≠ µ0
Where µ0 is the hypothesized population mean

The decision rule will have rejection regions in both the upper and lower
tales of the sampling distribution of the test statistic.

1
A one –tailed test is a test where the null hypothesis specifies a
range of values for a population parameter.
Form II (One-tailed test)
 H0: µ ≥ µ0
 H1: µ < µ0

Form III (One-tailed test)


 H0: µ ≤ µ0
 H1: µ > µ0

The decision rule for the hypothesis test will have a rejection region
either in the lower tail only (Form II) or in the upper tail only (Form III)

2
Form II

Form III

3
Introduction to t-tests

• To test the differences between the means of two samples or


between a sample mean and an hypothesised population mean.
• Assumptions:
The samples are from a normal distribution
If the difference of two samples are being tested, the two
samples must be independent except for a paired test
• Variances – to be discussed later

4
The general formula for the t-test
𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 𝑡𝑡𝑡𝑡𝑡𝑡 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚
t = 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑜𝑜𝑜𝑜 𝑡𝑡ℎ𝑒𝑒 𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑

Rejection region: |t| > tα/2,df

Using the t-test to find the rejection region: One tailed tables

When using a one-tailed table for a two-tailed test,


you must divide alpha by two and look up this value
(Rejection region |t| > tα/2,df)

5
Hypothesis test for the population mean
• When the sample size is less than 30 a t-test is used
• Null hypothesis (form I)
 H0: µ = µ0
 H1: µ ≠ µ0
Where µ0 is the hypothesized population mean

•The test statistic is calculated as follows:


𝑥𝑥̅ −µ
t=
𝑠𝑠𝑠𝑠

where s.e. = s/√𝑛𝑛


and d.f. = n-1

Question
Does the sample come from the
population? 6
Confidence intervals
• A sample mean is an unbiased estimator of the population mean
• The reliability of the estimator is determined by sample size
• It is useful to determine the limits (upper and lower) of the mean
• A confidence interval can be calculated for sample sizes less than 30
using:
𝑥𝑥̅ ± tα/2,df (s.e.)

7
Example

The yield (in g) of 10 strawberry plants in a uniformity trial is: 239, 176,
217, 234, 216, 318, 190, 181, and 225.
Test the hypothesis that the mean is 205 g against the alternative that the
mean is not 205 g using α = 0.05.
Calculate 95% and 99% confidence intervals for the mean.

8
Independent samples
If we want to test the difference between two means
(i.e. H0: µ1 = µ2 against H1: µ1 ≠ µ2)
we use a t-test for independent samples.
𝑥𝑥̅ 1−𝑥𝑥̅ 2
t = 𝑠𝑠
𝑥𝑥�1−𝑥𝑥�2
if |t| > tα/2,df : reject H0

• Depending on sample sizes and whether the variances are equal, we


use different formulae for the calculations of the s.e. and the d.f.

Question
Are sample 1 and sample 2 from the same population?

9
F-test
• To test whether the variances are equal (i.e. H0: σ12 = σ22 against H1: σ12 ≠ σ22) use the F-
test (Variance ratio)

𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 𝑠𝑠 2
Fc = 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑠𝑠2

If F > Fα,dfn,dfd reject H0

10
Formulae for standard errors and degrees of freedom (1)

1. If n1 > 30 and n2 > 30 and σ12 = σ22 then:


2
𝑠𝑠1 2
𝑠𝑠2
𝑠𝑠𝑥𝑥 1 −𝑥𝑥 2 = �𝑛𝑛 + 𝑛𝑛2
1

d.f. = ( n1-1)+ (n2-1)

2. If n1 < 30 or n2 < 30 or both and σ12 = σ22 then:


1 1
𝑠𝑠𝑥𝑥 1 −𝑥𝑥 2 =�𝑠𝑠𝑐𝑐2 �𝑛𝑛 + 𝑛𝑛 �
1 2

2 +(𝑛𝑛 −1 )𝑠𝑠 2
(𝑛𝑛 1 −1 )𝑠𝑠1
𝑠𝑠𝑐𝑐2 = 2
(𝑛𝑛 1 −1 )+(𝑛𝑛 2 −1 )
2

11
Formulae for standard errors and degrees of freedom (2)

We cannot assume σ12 = σ22 (i.e. σ1 ≠ σ2 )


2 2

𝑠𝑠12 𝑠𝑠22
𝑠𝑠𝑥𝑥 1 −𝑥𝑥 2 = �𝑛𝑛 +
1 𝑛𝑛2

[𝑠𝑠12 ⁄𝑛𝑛1 + 𝑠𝑠22 ⁄𝑛𝑛2 ]2


d.f. =
(𝑠𝑠12 ⁄𝑛𝑛1 )2 (𝑠𝑠22 ⁄𝑛𝑛2 )2
� + �
(𝑛𝑛1 − 1) (𝑛𝑛2 − 1)

Round the d.f. to the nearest integer

12
Example 1

Maize data: mean height of plants


Field 1: 𝑥𝑥̅1 = 268.2, 𝑠𝑠1 = 13.0, 𝑛𝑛1 = 9
Field 2: 𝑥𝑥̅2 = 235.3, 𝑠𝑠2 = 25.2, 𝑛𝑛2 = 14
Test if there is a significant difference in the mean heights of maize in the
Fields 1 and 2. Assume equal variances.

13
Example 2
• The following is the percentage of fine gravel in two soils:

Poor soil Good soil


𝑥𝑥̅𝑝𝑝 = 3.94 𝑥𝑥̅𝑔𝑔 = 10.91
𝑠𝑠𝑝𝑝 2 = 6.95 𝑠𝑠𝑔𝑔 2 = 40.1
𝑛𝑛𝑝𝑝 = 7 𝑛𝑛𝑔𝑔 = 7

• Test if there is a significant difference in fine gravel between the


good and poor soils. First test if σ12 = σ22.

14
Paired data

• When the data are related or paired we use the paired t-test:
 H0: µD = 0
 H1: µD ≠ 0
 Where µD is the mean of the differences between the paired samples

• The test statistic is calculated As follows:



𝐷𝐷
t=
𝑠𝑠𝐷𝐷

• Where:
 𝐷𝐷 � = the mean of the differences
 𝑠𝑠𝐷𝐷 = s/√𝑛𝑛

15
• and
2
∑ 𝐷𝐷 𝑖𝑖2 − �∑ 𝐷𝐷 𝑖𝑖 � /𝑛𝑛
 s=� 𝑛𝑛 −1

 ∑ 𝐷𝐷𝑖𝑖 = sum of the differences

2
 ∑ 𝐷𝐷𝑖𝑖 = sum of the squared differences
• Rejection region: if |t| > tα/2,df reject H0
• Degrees of freedom: n-1, where n = the number of pairs

16
Example

Suppose in a physical fitness study we measured the time to run, 2.5 km


in May and September:

Person May September


1 12.40 11.27
2 12.75 11.21
3 11.27 11.39
4 12.23 10.41
5 11.17 10.88

Test to see if there is a difference between the times in May and


September.

17

You might also like