Corrected the Degrees of Freedom in the Regression Coefficient Significance
[pspp] / tests / language / stats / regression.at
index 0ea3efc8a256aabf1bbe963e38d1d80cfa818d70..eb978f51e42117751c255b43ba375db3f28c4ca1 100644 (file)
@@ -18,6 +18,7 @@ end data
 regression /variables=v0 v1 v2 /statistics defaults /dependent=v2 /method=enter /save=pred resid.
 list.
 ])
+
 AT_CHECK([pspp -o pspp.csv regression.sps])
 AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Reading free-form data from INLINE.
@@ -26,20 +27,20 @@ v0,F8.0
 v1,F8.0
 v2,F8.0
 
-Table: Model Summary
+Table: Model Summary (v2)
 ,R,R Square,Adjusted R Square,Std. Error of the Estimate
 ,.97,.94,.93,1.34
 
-Table: ANOVA
+Table: ANOVA (v2)
 ,,Sum of Squares,df,Mean Square,F,Significance
 ,Regression,202.75,2,101.38,56.75,.00
 ,Residual,12.50,7,1.79,,
 ,Total,215.26,9,,,
 
-Table: Coefficients
+Table: Coefficients (v2)
 ,,B,Std. Error,Beta,t,Significance
 ,(Constant),2.19,2.36,.00,.93,.38
-,v0,1.81,1.05,.17,1.72,.12
+,v0,1.81,1.05,.17,1.72,.13
 ,v1,-3.43,.33,-1.03,-10.33,.00
 ,,,,,,
 
@@ -1573,20 +1574,120 @@ Variable,Format
 v0,F8.0
 v1,F8.0
 
-Table: Model Summary
+Table: Model Summary (v0)
 ,R,R Square,Adjusted R Square,Std. Error of the Estimate
 ,.05,.00,.00,8.11
 
-Table: ANOVA
+Table: ANOVA (v0)
 ,,Sum of Squares,df,Mean Square,F,Significance
 ,Regression,235.23,1,235.23,3.58,.06
 ,Residual,98438.40,1498,65.71,,
 ,Total,98673.63,1499,,,
 
-Table: Coefficients
+Table: Coefficients (v0)
 ,,B,Std. Error,Beta,t,Significance
 ,(Constant),1.24,.42,.00,2.95,.00
 ,v1,1.37,.72,.05,1.89,.06
 ,,,,,,
 ])
 AT_CLEANUP
+
+AT_SETUP([REGRESSION no crash on all missing])
+AT_DATA([regcrash.sps], [dnl
+data list list /x * y.
+begin data.
+ . .
+ . .
+ . .
+ . .
+ . .
+ . .
+ . .
+ . .
+ . .
+ . .
+end data.
+
+
+regression /variables=x y /dependent=y.
+])
+
+AT_CHECK([pspp -o pspp.csv regcrash.sps], [1], [ignore], [ignore])
+
+AT_CLEANUP
+
+
+
+AT_SETUP([REGRESSION missing dependent variable])
+
+dnl Test for a bug where missing values in the dependent variable were not being
+dnl ignored like they should have been.
+AT_DATA([reg-mdv-ref.sps], [dnl
+data list notable list / v0 to v2.
+begin data
+ 0.65377128  7.735648 -23.97588
+-0.13087553  6.142625 -19.63854
+ 0.34880368  7.651430 -25.26557
+ 0.69249021  6.125125 -16.57090
+-0.07368178  8.245789 -25.80001
+-0.34404919  6.031540 -17.56743
+ 0.75981559  9.832291 -28.35977
+-0.46958313  5.343832 -16.79548
+-0.06108490  8.838262 -29.25689
+ 0.56154863  6.200189 -18.58219
+end data
+regression /variables=v0 v1
+            /statistics defaults
+            /dependent=v2
+            /method=enter.
+])
+
+AT_CHECK([pspp -o pspp-ref.csv reg-mdv-ref.sps])
+
+AT_DATA([reg-mdv.sps], [dnl
+data list notable list / v0 to v2.
+begin data
+ 0.65377128  7.735648 -23.97588
+-0.13087553  6.142625 -19.63854
+ 0.34880368  7.651430 -25.26557
+ 0.69249021  6.125125 -16.57090
+-0.07368178  8.245789 -25.80001
+-0.34404919  6.031540 -17.56743
+ 0.75981559  9.832291 -28.35977
+-0.46958313  5.343832 -16.79548
+-0.06108490  8.838262 -29.25689
+ 0.56154863  6.200189 -18.58219
+ 0.5         8         9
+end data
+
+missing values v2 (9).
+
+regression /variables=v0 v1
+            /statistics defaults
+            /dependent=v2
+            /method=enter.
+])
+
+AT_CHECK([pspp -o pspp.csv reg-mdv.sps])
+
+AT_CHECK([diff pspp.csv pspp-ref.csv])
+
+
+AT_CLEANUP
+
+AT_SETUP([REGRESSION with invalid syntax (and empty dataset)])
+
+AT_DATA([ss.sps], [dnl
+data list notable list / v0 to v2.
+begin data
+end data.
+
+regression /variables=v0 v1
+            /statistics r coeff anova
+            /dependent=v2
+            /method=enter v2.
+])
+
+AT_CHECK([pspp ss.sps], [1], [ignore])
+
+AT_CLEANUP