Added test to check that REGRESSION works with multiple dependent variables
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 2 Jul 2013 17:37:08 +0000 (19:37 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 3 Jul 2013 16:53:40 +0000 (18:53 +0200)
tests/language/stats/regression.at

index a3f5e62f850299653e81caab8a7d5961c91496e0..f3b295adb6aa0c81eaf2d3fa349d9f0a5aed5fa4 100644 (file)
@@ -146,6 +146,40 @@ AT_CHECK([cat outdata-g0.txt outdata-g1.txt | diff outdata-split.txt - ], [0], [
 AT_CLEANUP
 
 
+# Test that the procedure behaves sensibly when presented with
+# multiple dependent variables
+AT_SETUP([LINEAR REGRESSION multiple dependent variables])
+AT_DATA([regression.sps], [dnl
+set seed = 2.
+input program.
+loop #c = 1 to 200.
+     compute x0 = rv.normal (0, 1).
+     compute x1 = rv.normal (0, 2).
+     compute err = rv.normal (0, 0.8).
+     compute y = 2 - 1.5 * x0 + 8.4 * x1 + err.
+     compute ycopy = y.
+     end case.
+end loop.
+end file.
+end input program.
+
+regression 
+          /variables = x0 x1
+          /dependent = y ycopy
+          /statistics = all
+])
+
+AT_CHECK([pspp -O format=csv regression.sps > output], [0], [ignore])
+
+
+AT_CHECK([head -16 output > first], [0], [])
+AT_CHECK([tail -16 output > second], [0], [])
+
+AT_CHECK([sed -e 's/ycopy/y/g' second | diff first -], [0], [])
+
+
+AT_CLEANUP
+
 # Tests the QR decomposition used by the REGRESSION command.
 AT_SETUP([LINEAR REGRESSION test of QR decomposition])
 AT_DATA([regression.sps], [dnl