Lecture Note 5
Lecture Note 5
Example: The length of metal bars produced by a particular machine are normally distributed with
mean length 420cm and standard deviation 12cm. The machine is serviced after which a sample
of 100 bars gave any other value as the mean length of 423cm. Is there any evidence at the 5%
level for a difference in the mean length of bars produced by the machine?
\
Procedure for carrying out a test
Step 1: State 𝐻0 and 𝐻1 and decide whether it is a one tailed or two tailed test.
Step 2: Consider the distribution of sample variable which is used to estimate the population
parameter under the assumption of 𝐻0 is true.
General Conclusion:
Exercise: The weights of components produced by a certain machine are normally distributed with
mean weight 15.4g and standard deviation 23g. A random sample of 81 components has a mean
weight of 15g. Use this provided evidence at the 5% level of significance to test whether there is
a reduction in the mean weight of component produced by the machine. Assume that the standard
deviation remains the same.
Test involving one sample mean – when 𝜎 2 is unknown
2
Sampling distribution of mean 𝑋̅~𝑁 (𝜇, 𝜎 ⁄𝑛). But since 𝜎 2 is unknown, we use the
unbiased estimator 𝑠 2 (sample variance). Then the test statistic is,
𝑥̅ − 𝜇
𝑇=𝑠 ~𝑡𝑛−1
⁄ 𝑛
√
➢ Note that for large samples (𝑛 ≥ 30) distributions of 𝑥̅ can be considered as normal even
𝜎 2 is unknown. Then the test statistic,
𝑥̅ − 𝜇
𝑍=𝑠 ~𝑁(0,1)
⁄ 𝑛
√
Exercise: Five readings of the resistance in Ω of a piece of wire gave the following results
1.51 1.49 1.54 1.52 1.54
If the wire is pure silver its resistance should be 1.5Ω. If the wire is not pure then the resistance
can be increased. Test at 5% level the hypothesis that the wire is pure silver.
Comparing two population means
The objective of this section is testing the difference between two population means based
on means of two random samples. The all-possible hypothesis under two population mean
comparison can be listed as follows.
𝐻0 : 𝜇1 − 𝜇2 = 𝜇0 and 𝐻1 : 𝜇1 − 𝜇2 > 𝜇0
𝜇1 − 𝜇2 < 𝜇0
𝜇1 − 𝜇2 ≠ 𝜇0
There are two main cases have to be discussed here.
Case I – Unpaired case
Consider 𝑥1 ~𝑁(𝜇1 , 𝜎12 ) and 𝑥2 ~𝑁(𝜇2 , 𝜎22 ). Then sampling distributions of 𝑥̅ ′s is,
𝜎2 𝜎2 𝜎2 𝜎2
𝑥̅1 ~𝑁(𝜇1 , 1 ⁄𝑛1 ) and 𝑥̅2 ~𝑁(𝜇2 , 2 ⁄𝑛2 ). Now (𝑥̅1 − 𝑥̅2 )~𝑁(𝜇1 − 𝜇2 , 1 ⁄𝑛1 + 2 ⁄𝑛2 ).
Here also there are 3 sub cases to explain the test statistic for different conditions of population
variances.
• Sub case I: If 𝜎12 and 𝜎22 are known
(𝑥̅ 1 −𝑥̅ 2 )−(𝜇1 −𝜇2 )
Test statistic is 𝑍 = 2 2
~𝑁(0,1)
√𝜎1⁄𝑛 +𝜎2⁄𝑛
1 2
• Sub case III: If 𝜎12 ≠ 𝜎22 and 𝜎12 , 𝜎22 are unknown
2
𝑠2 𝑠2
(( 1 ⁄𝑛1 )+( 2⁄𝑛2 ))
(𝑥̅ 1 −𝑥̅ 2 )−(𝜇1 −𝜇2 )
Test statistic is 𝑇 = 2 2
~𝑡𝑢 ; where 𝑢 = 2 2
√𝑠1⁄𝑛 +𝑠2⁄𝑛 𝑠2 𝑠2
( 1⁄𝑛1 ) ( 2⁄𝑛2 )
1 2
+
𝑛1 −1 𝑛2 −1
Exercise: The same test was given to a group of 100 scouts and 144 guides. The mean score for
scouts was 27.53 and the mean score for the guides was 26.81. Assuming a common population
standard deviation of 3.48, test 5%level of significance whether the scout’s performance in the test
was better than that of the guides.
Case II: Paired case
The objective of this is testing the difference between population means based on means
of two dependent random samples.
The matched sample design often leads to a smaller sampling error than the independent
sampling design. The key to analyzing a matched sample design is to use the difference data only.
Example: A matched sample design was used for two production methods. A sample of 6 workers
was taken, each worker performed the task for both production methods. The data on completion
time for the 6 workers are as follows.
worker Completion Time Difference in
completion time
Method 1 Method 2
1 6.0 5.4
2 5.0 5.2
3 7.0 6.5
4 6.2 5.9
5 6.0 6.0
6 6.4 5.8
Exercise: A college claims that it admits equal number of male and female students. A random
sample of 500 students at a college gave 267 males. Is there any evidence at 5% level of
significance that the college population is not evenly distributed into males and females?
Test involving two sample proportions
𝑝1 𝑞1
Here the main objective is to compare two population proportions. Let 𝑝̂1 ~𝑁(𝑝1 , ) and
𝑛1
𝑝2 𝑞2 𝑝1 𝑞1 𝑝2 𝑞2
𝑝̂2 ~𝑁(𝑝2 , ). Then, (𝑝̂1 − 𝑝̂ 2 )~𝑁(𝑝1 − 𝑝2 , + ).
𝑛2 𝑛1 𝑛2
The test statistic for this parameter can be discussed under two cases which are depends on the 𝐻0 .
• Case I: When 𝐻0 : 𝑝1 − 𝑝2 = 0
(𝑝̂1 −𝑝̂2 )−(𝑝1 −𝑝2 )
𝑍= 1 1
~𝑁(0,1)
√𝑝̂𝑞̂(𝑛 +𝑛 )
1 2
Exercise: Test in Mr. Fernando’s past statistic classes has scores with standard deviation 14.1,
some of his current classes now has 25 test scores with a standard deviation of 9.3. Use 5% level
of significance to test the claim that his current class has less variance than past classes.
Testing a Comparison of Variance
Let 𝑥1 , 𝑥2 , … , 𝑥𝑛 be a random sample from 𝑁(𝜇1 , 𝜎12 ) and 𝑦1 , 𝑦2 , … , 𝑦𝑚 be a random sample from
𝑁(𝜇2 , 𝜎22 ). Then we can use test statistic to compare two population variances 𝜎12 and 𝜎22 ,
𝑠2 𝜎2
𝐹 = 𝑠12 𝜎22 .
2 1
Note: In the calculation of F-ratio say the sample variance belongs to the largest population
variance as the numerator. So that the F-ratio will always be greater than one.
For two tailed test – Get biggest sample variance as the numerator
𝑠2
For one tailed test – Under 𝐻1 , if 𝜎12 > 𝜎22 we expect 𝑠12 > 𝑠22 . Then 𝐹 = 𝑠12 .
2
Exercise: A random sample of size 10 was chosen from London-School children of the same age.
The heights (in cm) of the children chosen were,
Boys 142 125 127 122
Girls 130 122 117 125 123 121
Assuming that the heights are normally distributed, test whether variance of heights of boys is
higher than the variance of heights of girls at 5% level of significance.
Type I Error and Type II Error
In a statistical hypothesis test we reach one of four possible conclusions. Among these
conclusions there are two types of errors can be occurred.
Conclusion Hypothesis (𝐻0 )
True False
Accept 𝐻0 No error Type II error
Reject 𝐻0 Type I error No error