Unit-5 Z Test and T Test
Unit-5 Z Test and T Test
Dr D Grover
Age last No . of Mid d=(x-28)/5 fd fd2
birthday persons (f) point (x)
16-20 12 18 -2 -24 48
21-25 22 23 -1 -22 22
26-30 20 28 0 0 0
31-35 30 33 1 30 30
36-40 16 38 2 32 64
Dr D Grover
5 16 2
164 16
x 28 28.8 years ; s 5 6.35 years
100 100 100
Since the sample is large ˆ s 6.35 years ;
Test Statistic: Under H0 the test statistic is:
x
Z ~ N (0, 1) (since sample is large)
s2 / n
28.8 30.5 1.7
Now Z 2.681
(6.35) 2 / 100 0.635
Dr D Grover
Conclusion: Since computed value of
Z 2.681 1.645 or Z 2.681 1.645,
It is significant at 5% level of significance. Hence we
reject the null hypothesis, H0 . Accept Alternative
hypothesis H1 at 5 % level of significance and
conclude that the insurance agent’s claim, that the
average age of policy-holders who insure through
him is less than the average for all agents, is valid.
Dr D Grover
Z- test
Z
x1 x2 E x1 x2
~ N (0, 1)
S .E. x1 x2
Dr D Grover
Under the Null Hypothesis H0 : 1 2 , i.e. there is no
significant difference between the sample means, we
get
E x1 x2 E x1 E x2 1 2 0
12 22
V x1 x2 V x1 V x2
n1 n2
the covariance term vanishes, since the sample means
x1 and x2 are independent. Thus under H0 :1 2 , the
test statistic becomes (for large samples)
x1 x 2
Z ~ N (0,1)
12 22
n1 n 2
Dr D Grover
Remarks :
(i) If 12 22 2 i.e. if the samples have been drawn
from population with common S.D. ,then under H0 :
1 2 ;
x1 x 2
Z ~ N (0,1)
1 n 1 n
1 2
Dr D Grover
Solution: In usual notations, we are given:
n1 1000; n2 2000; x1 67.5 inches ; x2 68.0 inches
Null Hypothesis H0 : 1 2 and 2.5 inches i.e. the
samples have been drawn from the same population
of standard deviation 2.5 inches.
Alternative Hypothesis H1 : 1 2 (two tailed)
Test Statistic: Under H0, the test statistic is:
x1 x2
Z ~ N (0,1) (since sample are large )
1 n 1 n
1 2
67.5 68.0
Now Z 5.1
1 1
2.5 Dr D Grover
1000 2000
Conclusion: Since Z 3, the value is highly significant
and we reject the null hypothesis and conclude that
samples are certainly not from the same population
with standard deviation 2.5
Example: In a survey of buying habits, 400 women
shoppers are chosen at random in super market ‘A’
located in a certain section of the city. Their average
weekly food expenditure is Rs. 250 with a standard
deviation of Rs 40. For 400 women shoppers chosen
at random in super market ‘B’ in another section of
the city, the average weekely food expenditure is Rs
220 with a standard deviation Rs 55. Test at 1% level
of significance whetherDrthe average weekly food
D Grover
expenditure of the two populations of shoppers are
equal.
Solution: In the usual notations, we are given that
n1 400; n2 400; x1 Rs 250 ; x2 Rs220;
s1 Rs 40; s 2 Rs55
Null Hypothesis H0 : 1 2 i.e. the average weekly
food expenditures of two populations of shoppers are
equal
Alternate Hypothesis H1: 1 2 (Two-tailed)
Test Statistic: since samples are large under H0, the test
statistic is
Dr D Grover
x1 x2 250 220
Z 8.82(approx )
s12 s 22
402 552
n1 n 2 400 400
Conclusion: Since Z is much greater than 2.58, the null
hypothesis 1 2 is rejected at 1% level of
significance and we conclude that the average weekly
expenditure of two populations of shoppers in
markets A and B differ significantly.
Dr D Grover
t- test
Dr D Grover
A continuous random variate ‘t’ is said to follows t-
distribution with n degree of freedom if its probability
density function (p.d.f.) is
1
f (t ) k n 1
; t
t2
1
n
k is chosen such that area under curve is one i.e.
f (t ) dt 1
Dr D Grover
We define the following:
(i) Testing of Population mean
(ii) Testing of difference between two population
means
(iii) Testing of difference of coupled two population
Dr D Grover
Testing of population mean
When population variance is unknown:
Let x1 , x2 ,……, xn be a random sample of size n
drawn from a normal population with mean and
variance unknown. We have to test whether there is
significant difference between population with mean
() and sample mean( x )
Dr D Grover
Testing of population mean
x (x ) n
t cal
s s
n
Where s 2 sample variance follows t-distribution with
(n - 1) degree of freedom
n
1
s
2
( xi x ) 2
n 1 i 1
Hence if tcal ttab accept H0 at 1% or 5% level of
significance otherwise Reject.
ttab t n1, ; (n-1) degree of freedom and is level
of significance
Dr D Grover
Example: A random sample of 9 from the men of a
large city gave mean height 68 inches and the
unbiased estimate of population variance s 2 found
from the sample was 4.5 inches. Are this data
consistent with the assumption of mean height of 68.5
inches for the men of the city.
Sol: x 68; s 2 4.5; 68.5; n 9
(x ) n (68 68.5) 9
t cal 0.707
s 4.5
ttab t n1, t8,0.05 2.31
tcal ttab Hence accept Null Hypothesis at 5%
level ofDr Dsignificance.
Grover
Example: Certain drug was administered to each of 13
patients and it resulted in the gain of sleeping hours
as follows
-4 5 2 8 -1 3 0 6 -3 1 5 0 4
1 154
s 2
(x i mean ) 2
12.83
n 1 12
s 3.58 Dr D Grover
Null Hypothesis H0: Drug is not accompanied by
measure in sleeping hours i.e. 0
(x ) n (2 0) 13
t cal 2.01
s 3.58
ttab t n1, t12,0.05 2.18
tcal ttab
Dr D Grover
Testing of difference between two population
means
When population variances are unknown:
Let x1 , x2 ,……, xn1 and y1 , y2 ,……, yn2 be two
dependent random sample of size n1 and n2 from two
populations with mean 1 and mean 2 and unknown
variance. Here we have to test whether two sample
are drawn from normal population (12)
Null Hypothesis (H0): The samples have been drawn
from the same normal population with mean(12)
then xy follows t-distribution
t cal
1 1 with (n1+n2-2)
s
n1 n2 degrees of freedom
Dr D Grover
where s 2 is called pooled sample variance and is given
by
n1 n2
1
s
2
( xi x ) ( y j y )
2 2
n1 n2 2 i 1
j 1
s
2 1
n1 n2 2
(n1 1) s12 (n2 1) s22
Dr D Grover
Example: Samples of two types of electric light bulbs
were tested for length of life following data were
obtained:
Type-I n1=8; mean=1234 hours; s1 = 36 hours
Type-II n2=7; mean=1036 hours; s2 = 40 hours
Is the difference in the means sufficient to warrant that
Type I is superior to Type II regarding length of life?
Solution:
Null Hypothesis H0: the two types I and II of electric
bulbs are identical
s
2 1
n1 n2 2
(n1 1) s12 (n2 1) s22 1436.30
Dr D Grover