Paired T-Test: Label first pair as 'Pair 1' instead of 'Pair 0'.
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 8 Jan 2014 08:49:17 +0000 (09:49 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 8 Jan 2014 08:49:17 +0000 (09:49 +0100)
Reported-By: Douglas Bonett <dgbonett@ucsc.edu>
src/language/stats/t-test-paired.c
tests/language/stats/t-test.at

index edeaa3827f0edf84f00e744ca6e4b4e3b28d7f88..02067190fb5d05618e998922c41911227c367388 100644 (file)
@@ -186,7 +186,7 @@ paired_summary (const struct tt *tt, struct paired_samp *os)
       int v = pp->posn;
       double cc, mean, sigma;
 
-      tab_text_format (t, 0, v * 2 + heading_rows, TAB_LEFT, _("Pair %d"), pp->posn);
+      tab_text_format (t, 0, v * 2 + heading_rows, TAB_LEFT, _("Pair %d"), pp->posn + 1);
 
       /* first var */
       moments_calculate (pp->mom0, &cc, &mean, &sigma, NULL, NULL);
@@ -241,7 +241,7 @@ paired_correlations (const struct tt *tt, struct paired_samp *os)
       double cc1, mean1, sigma1;
       int v = pp->posn;
 
-      tab_text_format (t, 0, v + heading_rows, TAB_LEFT, _("Pair %d"), pp->posn);
+      tab_text_format (t, 0, v + heading_rows, TAB_LEFT, _("Pair %d"), pp->posn + 1);
 
       tab_text_format (t, 1, v + heading_rows, TAB_LEFT, _("%s & %s"), 
                       var_to_string (pp->var0),
@@ -324,7 +324,7 @@ paired_test (const struct tt *tt, const struct paired_samp *os)
       moments_calculate (pp->mom_diff, &cc, &mean, &sigma, NULL, NULL);
 
       df = cc - 1.0;
-      tab_text_format (t, 0, v + heading_rows, TAB_LEFT, _("Pair %d"), v);
+      tab_text_format (t, 0, v + heading_rows, TAB_LEFT, _("Pair %d"), v + 1);
 
       tab_text_format (t, 1, v + heading_rows, TAB_LEFT, _("%s - %s"), 
                       var_to_string (pp->var0),
index d03a6ca9d5d34eb7abadd41ffa03b5f296a87bc2..c8b2b6aed083b828f924652cb0de3aa518be8de6 100644 (file)
@@ -23,18 +23,18 @@ B,F8.0
 
 Table: Paired Sample Statistics
 ,,Mean,N,Std. Deviation,S.E. Mean
-Pair 0,A,2.00,5,.71,.32
+Pair 1,A,2.00,5,.71,.32
 ,B,4.00,5,1.54,.69
 
 Table: Paired Samples Correlations
 ,,N,Correlation,Sig.
-Pair 0,A & B,5,.92,.03
+Pair 1,A & B,5,.92,.03
 
 Table: Paired Samples Test
 ,,Paired Differences,,,,,,,
 ,,,,,95% Confidence Interval of the Difference,,,,
 ,,Mean,Std. Deviation,Std. Error Mean,Lower,Upper,t,df,Sig. (2-tailed)
-Pair 0,A - B,-2.00,.94,.42,-3.16,-.84,-4.78,4,.01
+Pair 1,A - B,-2.00,.94,.42,-3.16,-.84,-4.78,4,.01
 ])
 AT_CLEANUP
 
@@ -62,22 +62,22 @@ d,F8.0
 
 Table: Paired Sample Statistics
 ,,Mean,N,Std. Deviation,S.E. Mean
-Pair 0,a,2.00,5,.71,.32
+Pair 1,a,2.00,5,.71,.32
 ,b,4.00,5,1.54,.69
-Pair 1,c,5.10,5,.69,.31
+Pair 2,c,5.10,5,.69,.31
 ,d,3.80,5,.16,.07
 
 Table: Paired Samples Correlations
 ,,N,Correlation,Sig.
-Pair 0,a & b,5,.92,.03
-Pair 1,c & d,5,-.92,.03
+Pair 1,a & b,5,.92,.03
+Pair 2,c & d,5,-.92,.03
 
 Table: Paired Samples Test
 ,,Paired Differences,,,,,,,
 ,,,,,95% Confidence Interval of the Difference,,,,
 ,,Mean,Std. Deviation,Std. Error Mean,Lower,Upper,t,df,Sig. (2-tailed)
-Pair 0,a - b,-2.00,.94,.42,-3.16,-.84,-4.78,4,.01
-Pair 1,c - d,1.30,.84,.37,.26,2.34,3.47,4,.03
+Pair 1,a - b,-2.00,.94,.42,-3.16,-.84,-4.78,4,.01
+Pair 2,c - d,1.30,.84,.37,.26,2.34,3.47,4,.03
 ])
 AT_CHECK([pspp -o ref.csv ref.sps])
 AT_CHECK([cat ref.csv], [0], [expout])
@@ -123,22 +123,22 @@ d,F8.0
 
 Table: Paired Sample Statistics
 ,,Mean,N,Std. Deviation,S.E. Mean
-Pair 0,a,2.00,5,.71,.32
+Pair 1,a,2.00,5,.71,.32
 ,c,5.10,5,.69,.31
-Pair 1,b,4.00,5,1.54,.69
+Pair 2,b,4.00,5,1.54,.69
 ,d,3.80,5,.16,.07
 
 Table: Paired Samples Correlations
 ,,N,Correlation,Sig.
-Pair 0,a & c,5,.41,.49
-Pair 1,b & d,5,-.87,.05
+Pair 1,a & c,5,.41,.49
+Pair 2,b & d,5,-.87,.05
 
 Table: Paired Samples Test
 ,,Paired Differences,,,,,,,
 ,,,,,95% Confidence Interval of the Difference,,,,
 ,,Mean,Std. Deviation,Std. Error Mean,Lower,Upper,t,df,Sig. (2-tailed)
-Pair 0,a - c,-3.10,.76,.34,-4.04,-2.16,-9.14,4,.00
-Pair 1,b - d,.20,1.68,.75,-1.89,2.29,.27,4,.80
+Pair 1,a - c,-3.10,.76,.34,-4.04,-2.16,-9.14,4,.00
+Pair 2,b - d,.20,1.68,.75,-1.89,2.29,.27,4,.80
 ])
 AT_CHECK([pspp -o ref.csv ref.sps])
 AT_CHECK([cat ref.csv], [0], [expout])
@@ -183,18 +183,18 @@ B,F8.0
 
 Table: Paired Sample Statistics
 ,,Mean,N,Std. Deviation,S.E. Mean
-Pair 0,A,4.333,3,5.774,3.333
+Pair 1,A,4.333,3,5.774,3.333
 ,B,1.333,3,.577,.333
 
 Table: Paired Samples Correlations
 ,,N,Correlation,Sig.
-Pair 0,A & B,3,1.000,.000
+Pair 1,A & B,3,1.000,.000
 
 Table: Paired Samples Test
 ,,Paired Differences,,,,,,,
 ,,,,,95% Confidence Interval of the Difference,,,,
 ,,Mean,Std. Deviation,Std. Error Mean,Lower,Upper,t,df,Sig. (2-tailed)
-Pair 0,A - B,3.000,5.196,3.000,-9.908,15.908,1.000,2,.423
+Pair 1,A - B,3.000,5.196,3.000,-9.908,15.908,1.000,2,.423
 ])
 AT_CLEANUP