-/AT_BANNER([T-TEST])
+AT_BANNER([T-TEST])
AT_SETUP([T-TEST /PAIRS])
AT_DATA([t-test.sps], [dnl
t-test /PAIRS a with b (PAIRED).
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
ID,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,.028
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,.009
])
+
AT_CLEANUP
+
AT_SETUP([T-TEST /PAIRS with per-analysis missing values])
+
AT_DATA([ref.sps], [dnl
data list list /id * a * b * c * d *.
begin data.
t-test /PAIRS a c with b d (PAIRED).
])
+
AT_DATA([expout], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
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,.028
+Pair 2,c & d,5,-.92,.028
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,.009
+Pair 2,c - d,1.30,.84,.37,.26,2.34,3.47,4,.025
])
+
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
AT_DATA([missing.sps], [dnl
t-test /MISSING=analysis /PAIRS a c with b d (PAIRED) /CRITERIA=CIN(0.95).
])
+
AT_CHECK([pspp -o missing.csv missing.sps])
AT_CHECK([cat missing.csv], [0], [expout])
AT_CLEANUP
t-test /PAIRS a b with c d (PAIRED).
])
+
AT_DATA([expout], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
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,.493
+Pair 2,b & d,5,-.87,.054
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,.001
+Pair 2,b - d,.20,1.68,.75,-1.89,2.29,.27,4,.803
])
+
AT_CHECK([pspp -o ref.csv ref.sps])
+
AT_CHECK([cat ref.csv], [0], [expout])
+
AT_DATA([missing.sps], [dnl
data list list /id * a * b * c * d *.
begin data.
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
t-test /GROUPS=indep(1.1,2.1) /var=dep1 dep2.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
ID,F8.0
Table: Group Statistics
,INDEP,N,Mean,Std. Deviation,S.E. Mean
-DEP1,1.1,5,2.00,.71,.32
-,2.1,5,4.00,.71,.32
-DEP2,1.1,5,4.00,.71,.32
-,2.1,5,2.00,.71,.32
+DEP1,1.10,5,2.00,.71,.32
+,2.10,5,4.00,.71,.32
+DEP2,1.10,5,4.00,.71,.32
+,2.10,5,2.00,.71,.32
Table: Independent Samples Test
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-DEP1,Equal variances assumed,.00,1.00,-4.47,8.00,.00,-2.00,.45,-3.03,-.97
-,Equal variances not assumed,,,-4.47,8.00,.00,-2.00,.45,-3.03,-.97
-DEP2,Equal variances assumed,.00,1.00,4.47,8.00,.00,2.00,.45,.97,3.03
-,Equal variances not assumed,,,4.47,8.00,.00,2.00,.45,.97,3.03
+DEP1,Equal variances assumed,.00,1.000,-4.47,8.00,.002,-2.00,.45,-3.03,-.97
+,Equal variances not assumed,,,-4.47,8.00,.002,-2.00,.45,-3.03,-.97
+DEP2,Equal variances assumed,.00,1.000,4.47,8.00,.002,2.00,.45,.97,3.03
+,Equal variances not assumed,,,4.47,8.00,.002,2.00,.45,.97,3.03
])
+
AT_CLEANUP
AT_SETUP([T-TEST /GROUPS with one value for independent variable])
end data.
t-test /groups=indep(1.514) /var=dep.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
INDEP,F8.0
Table: Group Statistics
,INDEP,N,Mean,Std. Deviation,S.E. Mean
-DEP,>=1.514,11,9.00,3.82,1.15
-,<1.514,11,8.00,2.86,.86
+DEP,≥ 1.51,11,9.00,3.82,1.15
+,< 1.51,11,8.00,2.86,.86
Table: Independent Samples Test
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-DEP,Equal variances assumed,.17,.68,-.69,20.00,.50,-1.00,1.44,-4.00,2.00
-,Equal variances not assumed,,,-.69,18.54,.50,-1.00,1.44,-4.02,2.02
+DEP,Equal variances assumed,.17,.683,.69,20.00,.495,1.00,1.44,-2.00,4.00
+,Equal variances not assumed,,,.69,18.54,.496,1.00,1.44,-2.02,4.02
])
AT_CLEANUP
Table: Group Statistics
,indep,N,Mean,Std. Deviation,S.E. Mean
-dep1,1,3,2.50,.87,.50
-,2,2,3.25,.35,.25
-dep2,1,3,5.00,1.00,.58
-,2,2,2.00,1.41,1.00
+dep1,1.00,3,2.50,.87,.50
+,2.00,2,3.25,.35,.25
+dep2,1.00,3,5.00,1.00,.58
+,2.00,2,2.00,1.41,1.00
Table: Independent Samples Test
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-dep1,Equal variances assumed,3.75,.15,-1.12,3.00,.35,-.75,.56,-2.53,1.03
-,Equal variances not assumed,,,-1.34,2.78,.28,-.75,.56,-2.61,1.11
-dep2,Equal variances assumed,.60,.50,2.85,3.00,.07,3.00,1.15,-.67,6.67
-,Equal variances not assumed,,,2.60,1.68,.14,3.00,1.15,-2.98,8.98
+dep1,Equal variances assumed,3.75,.148,-1.12,3.00,.346,-.75,.67,-2.89,1.39
+,Equal variances not assumed,,,-1.34,2.78,.279,-.75,.56,-2.61,1.11
+dep2,Equal variances assumed,.60,.495,2.85,3.00,.065,3.00,1.05,-.35,6.35
+,Equal variances not assumed,,,2.60,1.68,.144,3.00,1.15,-2.98,8.98
])
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
t-test /group=indep /var=dep1 dep2.
])
+
AT_DATA([expout], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
Table: Group Statistics
,indep,N,Mean,Std. Deviation,S.E. Mean
-dep1,1,3,2.50,.87,.50
-,2,3,3.50,.50,.29
-dep2,1,3,5.00,1.00,.58
-,2,3,2.00,1.00,.58
+dep1,1.00,3,2.50,.87,.50
+,2.00,3,3.50,.50,.29
+dep2,1.00,3,5.00,1.00,.58
+,2.00,3,2.00,1.00,.58
Table: Independent Samples Test
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-dep1,Equal variances assumed,2.00,.23,-1.73,4.00,.16,-1.00,.58,-2.60,.60
-,Equal variances not assumed,,,-1.73,3.20,.18,-1.00,.58,-2.77,.77
-dep2,Equal variances assumed,.00,1.00,3.67,4.00,.02,3.00,.82,.73,5.27
-,Equal variances not assumed,,,3.67,4.00,.02,3.00,.82,.73,5.27
+dep1,Equal variances assumed,2.00,.230,-1.73,4.00,.158,-1.00,.58,-2.60,.60
+,Equal variances not assumed,,,-1.73,3.20,.176,-1.00,.58,-2.77,.77
+dep2,Equal variances assumed,.00,1.000,3.67,4.00,.021,3.00,.82,.73,5.27
+,Equal variances not assumed,,,3.67,4.00,.021,3.00,.82,.73,5.27
])
+
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
AT_DATA([missing.sps], [dnl
t-test /testval=2.0 /var=abc.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
ID,F8.0
,Test Value = 2.000000,,,,,
,,,,,95% Confidence Interval of the Difference,
,t,df,Sig. (2-tailed),Mean Difference,Lower,Upper
-ABC,2.93,5,.03,1.00,.12,1.88
+ABC,2.93,5,.033,1.00,.12,1.88
])
AT_CLEANUP
,Test Value = 3.000000,,,,,
,,,,,95% Confidence Interval of the Difference,
,t,df,Sig. (2-tailed),Mean Difference,Lower,Upper
-x1,.00,5,1.00,.00,-.88,.88
-x2,2.18,5,.08,29.67,-5.39,64.72
+x1,.00,5,1.000,.00,-.88,.88
+x2,2.18,5,.082,29.67,-5.39,64.72
])
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
,Test Value = 3.000000,,,,,
,,,,,95% Confidence Interval of the Difference,
,t,df,Sig. (2-tailed),Mean Difference,Lower,Upper
-x1,-.59,4,.59,-.20,-1.14,.74
-x2,2.22,4,.09,34.60,-8.63,77.83
+x1,-.59,4,.587,-.20,-1.14,.74
+x2,2.22,4,.090,34.60,-8.63,77.83
])
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
Table: Group Statistics
,ind,N,Mean,Std. Deviation,S.E. Mean
-x,1,3,2.50,.87,.50
-,2,3,3.50,.50,.29
+x,1.00,3,2.50,.87,.50
+,2.00,3,3.50,.50,.29
Table: Independent Samples Test
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-x,Equal variances assumed,2.00,.23,-1.73,4.00,.16,-1.00,.58,-2.60,.60
-,Equal variances not assumed,,,-1.73,3.20,.18,-1.00,.58,-2.77,.77
+x,Equal variances assumed,2.00,.230,-1.73,4.00,.158,-1.00,.58,-2.60,.60
+,Equal variances not assumed,,,-1.73,3.20,.176,-1.00,.58,-2.77,.77
])
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
T-TEST /groups=id(3) .
])
AT_CHECK([pspp -O format=csv t-test.sps], [1], [dnl
-t-test.sps:11: error: T-TEST: One or more VARIABLES must be specified.
+t-test.sps:11: error: T-TEST: Required subcommand VARIABLES was not specified.
-t-test.sps:12: error: T-TEST: One or more VARIABLES must be specified.
+t-test.sps:12: error: T-TEST: Required subcommand VARIABLES was not specified.
])
AT_CLEANUP
t-test /GROUPS=indep('a','b') /var=dep1 dep2.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
ID,F8.0
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-DEP1,Equal variances assumed,.00,1.00,-4.47,8.00,.00,-2.00,.45,-3.03,-.97
-,Equal variances not assumed,,,-4.47,8.00,.00,-2.00,.45,-3.03,-.97
-DEP2,Equal variances assumed,.00,1.00,4.47,8.00,.00,2.00,.45,.97,3.03
-,Equal variances not assumed,,,4.47,8.00,.00,2.00,.45,.97,3.03
+DEP1,Equal variances assumed,.00,1.000,-4.47,8.00,.002,-2.00,.45,-3.03,-.97
+,Equal variances not assumed,,,-4.47,8.00,.002,-2.00,.45,-3.03,-.97
+DEP2,Equal variances assumed,.00,1.000,4.47,8.00,.002,2.00,.45,.97,3.03
+,Equal variances not assumed,,,4.47,8.00,.002,2.00,.45,.97,3.03
])
AT_CLEANUP
t-test group=gv('One', 'Two')
/variables = x.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
x,F8.0
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-x,Equal variances assumed,1.13,.33,-2.32,6.00,.06,-.90,.38,-1.83,.03
-,Equal variances not assumed,,,-2.38,4.70,.07,-.90,.38,-1.89,.09
+x,Equal variances assumed,1.13,.329,-2.32,6.00,.060,-.90,.39,-1.85,.05
+,Equal variances not assumed,,,-2.38,4.70,.067,-.90,.38,-1.89,.09
])
AT_CLEANUP
+
+
+dnl Tests for a bug assert failed when the group variables were not of either class
+AT_SETUP([T-TEST wrong group])
+AT_DATA([t-test-crs.sps], [dnl
+data list list /x * g *.
+begin data.
+1 2
+2 2
+3 2
+4 2
+5 2
+end data.
+
+t-test /variables = x group=g(1,3).
+])
+
+AT_CHECK([pspp t-test-crs.sps], [0],[ignore], [ignore])
+
+AT_CLEANUP