Analysis with t-Test
T-Test for One Population mean and Two Population means
Background
 Introduced in 1908 by William Sealy Gosset for the quality
control of Beer.
 Gosset published his mathematical work under the
pseudonym “Student”.
The t-test assumes:
Types of t-test:
There are two main types of t-test:
 Independent-measures t-test: when samples are not matched.
 Matched-pair t-test: When samples appear in pairs (eg. before-
and-after).
 It is usually used with small (<30) samples that are normally
distributed.
One Sample t-Test
One sample t-test is a statistical procedure used to examine the
mean difference between the sample and the known value of
the population mean.
In one sample t-test, we know the population mean. We draw
a random sample from the population and then compare the
sample mean with the population mean and make a statistical
decision as to whether or not the sample mean is different from
the population mean.
The Assumptions of One-Sample t-Test
The data are continuous.
The data follow the Normal distribution.
The sample is a simple random sample from the
population.
0 0 0
0 0 0
0 0 0
: , :
: , :
: , :
A
A
A
H H
H H
H H
   
   
   
 
 
 
2
X
t
s
n


1df n 
With
Example of ONE-Sample t-Test
 When we take a sample from the city and we know the mean
of the country (population mean). If we want to know
whether the city mean differs from the country mean, we will
use the one sample t-test
Two Samples /Independent Samples t-test
Equal Variances
 The independent two-sample t-test is used to test whether
population means are significantly different from each other, using
the means from randomly drawn samples.
 Any statistical test that uses two samples drawn independently of
each other and using t-distribution, can be called a 'two-sample t-
test'.
The assumptions of Independent Sample t-Test
The data are continuous
The data follow the Normal distribution.
The variances of the two populations are equal
The two samples are independent
Both samples are simple random samples from their respective
populations.
0 1 2 1 2
0 1 2 1 2
0 1 2 1 2
: , :
: , :
: , :
A
A
A
H H
H H
H H
   
   
   
 
 
 
 
   
1 2 1 2
2 2
1 1 2 2
1 2 1
1 1 1 1
2 2
X X
t
n s n s
n n n n
   

    
 
   
1 2 2df n n  
With
Example
 Suppose that a school has two buildings - one for girls and the
other for boys. Suppose that the principal want to know if the
pupils of the two buildings are working equally hard, in the sense
that they put in equal number of hours in studies on the average.
 Statistically speaking, the principal is interested in testing
whether the average number of hours studied by boys
is significantly different from the average for girls.
Test name Situation Data type
One sample t-test We compare a group with
standard value
Quantitative
Independent sample t-
test
We compare the averages of two
independent groups
Quantitative
Summary

T-test

  • 1.
    Analysis with t-Test T-Testfor One Population mean and Two Population means
  • 2.
    Background  Introduced in1908 by William Sealy Gosset for the quality control of Beer.  Gosset published his mathematical work under the pseudonym “Student”.
  • 3.
    The t-test assumes: Typesof t-test: There are two main types of t-test:  Independent-measures t-test: when samples are not matched.  Matched-pair t-test: When samples appear in pairs (eg. before- and-after).  It is usually used with small (<30) samples that are normally distributed.
  • 4.
    One Sample t-Test Onesample t-test is a statistical procedure used to examine the mean difference between the sample and the known value of the population mean. In one sample t-test, we know the population mean. We draw a random sample from the population and then compare the sample mean with the population mean and make a statistical decision as to whether or not the sample mean is different from the population mean.
  • 5.
    The Assumptions ofOne-Sample t-Test The data are continuous. The data follow the Normal distribution. The sample is a simple random sample from the population.
  • 6.
    0 0 0 00 0 0 0 0 : , : : , : : , : A A A H H H H H H                   2 X t s n   1df n  With
  • 7.
    Example of ONE-Samplet-Test  When we take a sample from the city and we know the mean of the country (population mean). If we want to know whether the city mean differs from the country mean, we will use the one sample t-test
  • 8.
    Two Samples /IndependentSamples t-test Equal Variances  The independent two-sample t-test is used to test whether population means are significantly different from each other, using the means from randomly drawn samples.  Any statistical test that uses two samples drawn independently of each other and using t-distribution, can be called a 'two-sample t- test'.
  • 9.
    The assumptions ofIndependent Sample t-Test The data are continuous The data follow the Normal distribution. The variances of the two populations are equal The two samples are independent Both samples are simple random samples from their respective populations.
  • 10.
    0 1 21 2 0 1 2 1 2 0 1 2 1 2 : , : : , : : , : A A A H H H H H H                         1 2 1 2 2 2 1 1 2 2 1 2 1 1 1 1 1 2 2 X X t n s n s n n n n                 1 2 2df n n   With
  • 11.
    Example  Suppose thata school has two buildings - one for girls and the other for boys. Suppose that the principal want to know if the pupils of the two buildings are working equally hard, in the sense that they put in equal number of hours in studies on the average.  Statistically speaking, the principal is interested in testing whether the average number of hours studied by boys is significantly different from the average for girls.
  • 12.
    Test name SituationData type One sample t-test We compare a group with standard value Quantitative Independent sample t- test We compare the averages of two independent groups Quantitative Summary