Student's t-Test for Matched Pairs

© 1998 by Dr. Thomas W. MacFarland -- All Rights Reserved


************
stu_pair.doc 
************
Background:  Student's t-test is a very common (and possibly
             overused) test for determining differences 
             between two groups.  The t-test (developed in 
             1915 by Gosset for the Guinness Breweries of 
             Dublin) is the appropriate test for small samples, 
             as opposed to samples with greater than 30 or 
             more observations.  And recall: 

             -- Student's t-test is still the appropriate test 
                with greater than 30 observations.

             -- With n => 30 observations, t approximates z.

             Student's t-test is typically used to determine
             if the difference between two independent groups 
             is indeed a true difference, or if the difference
             between the two groups is instead due only to chance. 

             It is not suggested, however, that the t-test is 
             only used to test the difference between separate
             groups.  On the contrary, Student's t-test can 
             also be used to determine differences among the
             same (or similar, i.e., matched) subjects for a
             specific phenomenon.  


Scenario:    This study examines if separating students who
             previously worked on programming assignments  
             as a pair has any impact on project quality  
             when:  

             -- One member of the pair is required to work 
                on their own.

             -- The other member of the pair is assigned a 
                new programming partner.

             Dr. Kieta teaches Cobol I and Cobol II at a 
             local community college.  There are 60 students 
             in Cobol I, with instruction offered in a 
             laboratory-type classroom setting with only 30 
             computers.  Logically, Dr. Kieta used random 
             assignment to segregate the 60 students into 
             30 sets of paired students.  

             During the 10-day break between Cobol I and Cobol
             II, more computers are brought into the classroom.
             Further, many of the students who enrolled in
             Cobol I immediately enrolled for Dr. Kieta's
             class in Cobol II.

             Seeing an opportunity for a research project on
             group vs. individual work with the introduction 
             of these new computers, Dr. Kieta makes new 
             assignments:
           
             -- 20 students who were enrolled in Cobol I, 
                working with an assigned partner, now have the 
                chance to work on their own in Cobol II.

             -- Their counterparts from Cobol I are now assigned
                a new partner for Cobol II.

             This test will determine if there are differences
             in the Cobol II final examination among these 40
             Cobol I and Cobol II students.

             Dr. Kieta previously examined this data set with
             the non-parametric Wilcoxon test.  However, he
             has since reviewed the final examination and now
             is convenienced that the data represent interval 
             data (i.e., the data are parametric, with the 
             difference between "89" and "90" equal to the 
             difference between "75" and "76").  

             Accordingly, Dr. Kieta will now use Student's
             t-Test for Matched Pairs to determine if there
             are differences, instead of the non-parametric
             Wilcoxon test.


             A summary of the study is presented in Table 1.


             Table 1

             Final Exam Scores in Cobol II of Students Who Were
             Previously Paired Together in Cobol I
             ===================================================    

                                Exam Score for Previously
                                     Paired Students 
                        ----------------------------------------      

                            Pair Member:     Pair Member:  
                            Worked on Own    Worked With a New
                 Pair       in Cobol II      Partner in Cobol II
             ---------------------------------------------------    

                   01            090            083 
                   02            084            089 
                   03            078            058 
                   04            079            093 
                   05            065            049 
                   06            049            082 
                   07            092            093 
                   08            071            100 
                   09            085            083 
                   10            076            055 
                   11            068            065 
                   12            071            083 
                   13            088            081 
                   14            089            088 
                   15            076            083 
                   16            061            078 
                   17            088            088 
                   18            058            080 
                   19            073            070 
                   20            082            083 
             _______________________________________________________


Ho:          Null Hypothesis:  There is no difference in final   
             examination test scores in Cobol II between students  
             who were previously paired together in Cobol I, with
             the pairs now redesigned so that one student in Cobol 
             II now works on their own and their matched counterpart 
             now works with another student in Cobol II (p <= .05).


Files:       1.  stu_pair.doc

             2.  stu_pair.dat

             3.  stu_pair.r01

             4.  stu_pair.o01

             5.  stu_pair.con

             6.  stu_pair.lis


Command:     At the Unix prompt (%), key:

             %spss -m < stu_pair.r01 > stu_pair.o01


************
stu_pair.dat
************
                   01            090            083 
                   02            084            089 
                   03            078            058 
                   04            079            093 
                   05            065            049 
                   06            049            082 
                   07            092            093 
                   08            071            100 
                   09            085            083 
                   10            076            055 
                   11            068            065 
                   12            071            083 
                   13            088            081 
                   14            089            088 
                   15            076            083 
                   16            061            078 
                   17            088            088 
                   18            058            080 
                   19            073            070 
                   20            082            083 


************
stu_pair.r01
************
SET WIDTH      = 80
SET LENGTH     = NONE
SET CASE       = UPLOW
SET HEADER     = NO
TITLE          = Student's t-Test for Matched Pairs 
COMMENT        = This file examines if separating students who
                 previously worked on programming assignments  
                 as a pair has any impact on project quality  
                 when:  one member of the pair is required to
                 work on their own and the other member of the
                 pair is assigned a new programming partner.

                 Dr. Kieta teaches Cobol I and Cobol II at a 
                 local community college.  There are 60 students 
                 in Cobol I, with instruction offered in a 
                 laboratory-type classroom setting with only 30 
                 computers.  Logically, Dr. Kieta used random 
                 assignment to segregate the 60 students into 
                 30 sets of paired students.  

                 During the 10-day break between Cobol I and Cobol
                 II more computers are brought into the classroom.
                 Further, many of the students who enrolled in
                 Cobol I immediately enrolled for Dr. Kieta's
                 class in Cobol II.

                 Seeing an opportunity for a research project on
                 group vs. individual work with the introduction 
                 of these new computers, Dr. Kieta makes new 
                 assignments:
           
                 -- 20 students who were enrolled in Cobol I, 
                    working with an assigned partner, now have the 
                    chance to work on their own in Cobol II

                 -- their counterparts from Cobol I are now assigned
                    a new partner for Cobol II

                 This test will determine if there are differences
                 in the Cobol II final examination among these 40
                 Cobol I and Cobol II students.

                 Dr. Kieta previously examined this data set with
                 the non-parametric Wilcoxon test.  However, he
                 has since reviewed the final examination and now
                 is convenienced that the data are represent 
                 interval data (i.e., the data are parametric, 
                 with the difference between "89" and "90" equal 
                 to the difference between "75" and "76").  

                 Accordingly, Dr. Kieta will now use Student's
                 t-Test for Matched Pairs to determine if there
                 are differences, instead of the non-parametric
                 Wilcoxon test.
DATA LIST FILE = 'stu_pair.dat' FIXED
     / Pair       20-21
       Wk_Own     34-36
       Wk_New     49-51

Variable Labels
       Pair       "Pair Number"  
     / Wk_Own     "Exam Score:  Student Who Worked on Their Own"
     / Wk_New     "Exam Score:  Student Assigned a New Partner"

T-TEST PAIRS    = Wk_Own, Wk_New


***********
reading.o01
***********
   1  SET WIDTH      = 80
   2  SET LENGTH     = NONE
   3  SET CASE       = UPLOW
   4  SET HEADER     = NO
   5  TITLE          = Student's t-Test for Matched Pairs
   6  COMMENT        = This file examines if separating students who
   7                   previously worked on programming assignments
   8                   as a pair has any impact on project quality
   9                   when:  one member of the pair is required to
  10                   work on their own and the other member of the
  11                   pair is assigned a new programming partner.
  12
  13                   Dr. Kieta teaches Cobol I and Cobol II at a
  14                   local community college.  There are 60 students
  15                   in Cobol I, with instruction offered in a
  16                   laboratory-type classroom setting with only 30
  17                   computers.  Logically, Dr. Kieta used random
  18                   assignment to segregate the 60 students into
  19                   30 sets of paired students.
  20
  21                   During the 10-day break between Cobol I and Cobol
  22                   II more computers are brought into the classroom.
  23                   Further, many of the students who enrolled in
  24                   Cobol I immediately enrolled for Dr. Kieta's
  25                   class in Cobol II.
  26
  27                   Seeing an opportunity for a research project on
  28                   group vs. individual work with the introduction
  29                   of these new computers, Dr. Kieta makes new
  30                   assignments:
  31
  32                   -- 20 students who were enrolled in Cobol I,
  33                      working with an assigned partner, now have the
  34                      chance to work on their own in Cobol II
  35
  36                   -- their counterparts from Cobol I are now assigned
  37                      a new partner for Cobol II
  38
  39                   This test will determine if there are differences
  40                   in the Cobol II final examination among these 40
  41                   Cobol I and Cobol II students.
  42
  43                   Dr. Kieta previously examined this data set with
  44                   the non-parametric Wilcoxon test.  However, he
  45                   has since reviewed the final examination and now
  46                   is convenienced that the data are represent
  47                   interval data (i.e., the data are parametric,
  48                   with the difference between "89" and "90" equal
  49                   to the difference between "75" and "76").
  50
  51                   Accordingly, Dr. Kieta will now use Student's
  52                   t-Test for Matched Pairs to determine if there
  53                   are differences, instead of the non-parametric
  54                   Wilcoxon test.
  55  DATA LIST FILE = 'stu_pair.dat' FIXED
  56       / Pair       20-21
  57         Wk_Own     34-36
  58         Wk_New     49-51
  59

This command will read 1 records from stu_pair.dat

Variable   Rec   Start     End         Format

PAIR         1      20      21         F2.0
WK_OWN       1      34      36         F3.0
WK_NEW       1      49      51         F3.0

  60  Variable Labels
  61         Pair       "Pair Number"
  62       / Wk_Own     "Exam Score:  Student Who Worked on Their Own"
  63       / Wk_New     "Exam Score:  Student Assigned a New Partner"
  64
  65  T-TEST PAIRS    = Wk_Own, Wk_New

T-TEST requires 104 bytes of workspace for execution.

t-tests for Paired Samples


                 Number of           2-tail
 Variable          pairs      Corr   Sig         Mean          SD     SE of
Mean

-------------------------------------------------------------------------------
 WK_OWN   Exam Score:  Student Who Worke      76.1500      11.753         
2.628
                    20        .312    .181
 WK_NEW   Exam Score:  Student Assigned       79.2000      13.344         
2.984

-------------------------------------------------------------------------------


          Paired Differences       |
    Mean          SD    SE of Mean |      t-value             df      2-tail
Sig

----------------------------------|--------------------------------------------
 -3.0500      14.781         3.305 |         -.92             19           
.368
 95% CI (-9.968, 3.868)            |


***********
stu_pair.con
***********

Outcome:     Computed t  = |-0.92|

             Criterion t = |-2.09| (alpha = .05, df = 19)

             Computed t |-0.92| < Criterion t |-2.09|

             Note.  The | and | characters are used to indicate
                    absolute value.

             Therefore, the null hypothesis is accepted and it can
             be claimed that there is no difference (p <= .05) in
             final examination test scores in Cobol II between 
             students  who were previously paired together in 
             Cobol I, with the pairs now redesigned so that one 
             student in Cobol II now works on their own and their 
             matched counterpart now works with another student in 
             Cobol II.

             The p value is another way to view differences in
             the three graded activities:

             -- The calculated p value is .368. 

             -- The delcared p value is .05.

             The calculated p value exceeds the declared p value 
             and there is, accordingly, no difference in final
             examination scores between the two groups of Cobol
             II students. 

             To be more exact:

             1.  Students from Cobol I who later worked on 
                 their own in Cobol II had a mean score of 
                 76.15 (SD = 11.75).

             2.  Students from Cobol I who later worked with
                 an assigned partner in Cobol II had a mean 
                 score of 79.20 (SD = 13.34).

             3.  There is no difference in these test scores
                 (p <= .05) and it can be claimed that pairing
                 and/or not pairing had no influence on test
                 scores.

             If final examination test scores are indeed a 
             measure of summative learning, then this study
             serves as a source of evidence that the practice
             of pairing students, when there are insufficient
             computers to allow one-on-one programming 
             assignments, can be defended.  Pairing does not
             influence final examination scores.

             Of course, this example is a "one-shot" 
             experiment.  Replication, including diverse 
             locations and variety in subjects, would be 
             needed before purporting the value of this
             teaching methodology. 


************
stu_pair.lis
************
% minitab

 MTB > outfile 'stu_pair.lis'
 Collecting Minitab session in file: stu_pair.lis
 MTB > # MINITAB addendum to 'stu_pair.dat'
 MTB > #
 MTB > read 'stu_pair.dat' c1 c2 c3
 Entering data from file: stu_pair.dat
      20 rows read.
 MTB > print c1 c2 c3
 
 
  ROW    C1    C2     C3
 
    1     1    90     83
    2     2    84     89
    3     3    78     58
    4     4    79     93
    5     5    65     49
    6     6    49     82
    7     7    92     93
    8     8    71    100
    9     9    85     83
   10    10    76     55
   11    11    68     65
   12    12    71     83
   13    13    88     81
   14    14    89     88
   15    15    76     83
   16    16    61     78
   17    17    88     88
   18    18    58     80
   19    19    73     70
   20    20    82     83
 
 MTB > describe c2 c3
 
                 N     MEAN   MEDIAN   TRMEAN    STDEV   SEMEAN
 C2             20    76.15    77.00    76.78    11.75     2.63
 C3             20    79.20    83.00    79.72    13.34     2.98
 
               MIN      MAX       Q1       Q3
 C2          49.00    92.00    68.75    87.25
 C3          49.00   100.00    72.00    88.00
 
 MTB > # In MINITAB, the task here is to demonstrate that 
 MTB > # the average population difference between the 
 MTB > # pairs is equal to zero.
 MTB > #
 MTB > name c6 = 'Differen'
 MTB > let 'Differen' = c2 - c3
 MTB > print c1-c6
 
 
  ROW    C1    C2     C3  Differen
 
    1     1    90     83         7
    2     2    84     89        -5
    3     3    78     58        20
    4     4    79     93       -14
    5     5    65     49        16
    6     6    49     82       -33
    7     7    92     93        -1
    8     8    71    100       -29
    9     9    85     83         2
   10    10    76     55        21
   11    11    68     65         3
   12    12    71     83       -12
   13    13    88     81         7
   14    14    89     88         1
   15    15    76     83        -7
   16    16    61     78       -17
   17    17    88     88         0
   18    18    58     80       -22
   19    19    73     70         3
   20    20    82     83        -1
 
 Continue? y
 * NOTE  * One or more variables are undefined.
 
 MTB > ttest 0 'Differen'
 
 TEST OF MU = 0.00 VS MU N.E. 0.00
 
              N      MEAN    STDEV   SE MEAN        T    P VALUE
 Differen    20     -3.05    14.78      3.31    -0.92       0.37
 
 MTB > #
 MTB > # And just as you saw with SPSS, the t-statistic is
 MTB > # equal to -0.92 and the p value is 0.37.
 MTB > #
 MTB > # There is no difference in final examination scores
 MTB > # between the paired subjects/students.
 MTB > stop

--------------------------
Disclaimer:  All care was used to prepare the information in this 
tutorial.  Even so, the author does not and cannot guarantee the 
accuracy of this information.  The author disclaims any and all 
injury that may come about from the use of this tutorial.  As 
always, students and all others should check with their advisor(s) 
and/or other appropriate professionals for any and all assistance 
on research design, analysis, selected levels of significance, and 
interpretation of output file(s).

The author is entitled to exclusive distribution of this tutorial. 
Readers have permission to print this tutorial for individual use, 
provided that the copyright statement appears and that there is no 
redistribution of this tutorial without permission.

Prepared 980316
Revised  980914
end-of-file 'stu_pair.ssi'

Please send comments or suggestions to Dr. Thomas W. MacFarland

There have been [an error occurred while processing this directive] visitors to this page since February 1, 1999.