0% found this document useful (0 votes)
39 views24 pages

Unit-5 Z Test and T Test

The document discusses hypothesis testing using z-tests and t-tests. It provides examples of using z-tests to test for differences in means and using a t-test to test if a sample mean is equal to a population mean. Formulas and steps for conducting the tests are provided.

Uploaded by

Arun Kochar
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)
39 views24 pages

Unit-5 Z Test and T Test

The document discusses hypothesis testing using z-tests and t-tests. It provides examples of using z-tests to test for differences in means and using a t-test to test if a sample mean is equal to a population mean. Formulas and steps for conducting the tests are provided.

Uploaded by

Arun Kochar
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/ 24

Remark: 2.

33 is the value z1 of Z from standard


normal probability integrals, such that
P Z  z1   0.98  P(Z  z1 )  0.49
Example: An insurance agent has claimed that the
average age of policy-holders who insure through
him is less than the average for all agents, which is
30.5 years.
A random sample of 100 policy-holders who had
insured through him gave the following age
distribution:
Age last birthday 16-20 21-25 26-30 31-35 36-40
No of Persons 12 22 20 30 16
Calculate the arithmetic mean and standard deviation
of this distribution and use these values to test his
claim at the 5% level of significance. You are given
that Z(1.645)=0.95
Solution: Null Hypothesis H0  = 30.5 years, i.e., the
sample mean x  and population mean ( ) do not
differ significantly.

Alternative Hypothesis H1 :  < 30.5 years (Left-tailed


alternative)

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

Total N=100 16 164

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

Test of significance for difference of means


Let x1 be the mean of sample of size n1 from a
population with mean 1 and variance  12 and let x2 be
the mean of sample of size n2 from a population with
mean 2 and variance  22 . Then since sample size are
large, x1 ~ N (1,12 / n1 ) and x2 ~ N (2 , 22 / n2 )
also x1  x2 being the difference of two independent
normal variates is also a normal variate. The value of
Z (S. N. V.) corresponding to x1  x2 is given by:

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

(ii) If  12   22 and  1 and  2 are not known, then they


are estimated from sample values. This results in
some error, which is practically immaterial, if
samples are large . These estimates for large samples
are given by Dr D Grover
ˆ12  S12  s12 and ˆ 22  S 22  s22
x1  x2
hence Z 
 s12   s 22 
    
 n1  n 2

Example: The means of two single large samples of


1000 and 2000 members are 67.5 inches and 68.0
inches respectively. Can the samples be regarded as
drawn from the same population of standard
deviation 2.5 inches? (test at 5% level of significance)

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 
    
402  552
 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

Test of significance based on t-distribution:


Definition: The ratio of standard normal variate to the
square root of Chi-square divided by its degree of
freedom is a t-variate defined as follows:
X 
X ~ N (  ,  ); Z ~ N (0,1) ; Z 
2

If Z ~ N (0,1) &  2 (n) then


Z follows t-distribution with n degrees of
t
2 freedom
n

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 )

Null Hypothesis (H0): The sample has been drawn


from population with mean() (i.e. there is no
significant difference between mean and population
mean)

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 n1, ; (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 n1,  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

Can it be concluded that drug will in general be


accompanied by an increase in sleeping hours?
Solution:
xi -4 5 2 8 -1 3 0 6 -3 1 5 0 4
xi-mean -6 3 0 6 -3 1 -2 4 -5 -1 3 -2 2
(xi-mean)2 36 9 0 36 9 1 4 16 25 1 9 4 4

mean  2;  ( xi  mean ) 2  154


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 n1,  t12,0.05  2.18

tcal  ttab

we accept the Null Hypothesis H0

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 (12)
Null Hypothesis (H0): The samples have been drawn
from the same normal population with mean(12)
then xy 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

where s12- Variance for sample 1


s 22 - Variance for sample 2
 ttab (v, ) accept null hypothesis H0 otherwise reject
If tcal
Degree of freedom v  n1 n2  2,  level of significance

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

You might also like