Added result_class parameter to tab_double and updated all callers. Removed tab_fixed
[pspp] / tests / language / stats / correlations.at
index f31d0593fd40db5e0a4645ab8719a32003cc6914..24fb63c6a69c975215a3c721323cb5bf2da51301 100644 (file)
@@ -116,3 +116,235 @@ AT_CHECK([pspp -O format=csv correlations1.sps], [0], [stdout])
 mv stdout expout
 AT_CHECK([pspp -O format=csv correlations2.sps], [0], [expout])
 AT_CLEANUP
+
+
+AT_SETUP([CORRELATIONS -- non-square])
+AT_DATA([corr-ns.sps], [dnl
+set format = F11.3.
+data list notable list /foo * bar * wiz *.
+begin data.
+1 1 6
+2 2 5 
+3 3 4
+4 4 3
+5 5 2
+6 6 1
+end data.
+
+correlations 
+       variables = foo with bar wiz
+       .
+])
+
+AT_CHECK([pspp -O format=csv corr-ns.sps], [0], [dnl
+Table: Correlations
+,,bar,wiz
+foo,Pearson Correlation,1.000,-1.000
+,Sig. (2-tailed),.000,.000
+,N,6,6
+])
+
+AT_CLEANUP
+
+dnl Checks for bug #38661.
+AT_SETUP([CORRELATIONS -- crash with WITH keyword])
+AT_DATA([correlations.sps], [dnl
+DATA LIST LIST NOTABLE /a b c d e f g h i.
+.
+BEGIN DATA.
+20 21 17 28 23 4.35 24 19 25
+28 18 29 30 23 4.55 17 23 28
+47 18 30 30 29 4.35 26 31 31
+20 7 19 22 22 4.80 24 16 27
+19 12 17 27 22 . 22 14 25
+22 9 19 30 33 5 29 30 27
+41 16 22 32 23 3.90 26 27 23
+18 18 20 26 22 5.80 17 20 39
+18 24 25 25 31 5.15 27 27 34
+19 22 26 23 37 6 41 32 27
+23 12 15 29 25 4.10 21 27 20
+21 4 28 37 31 5.65 27 18 42
+19 5 17 17 29 3.10 19 16 19
+21 17 20 35 31 . 28 30 22
+END DATA.
+
+CORRELATIONS VARIABLE=a f b WITH c g h i e d/STATISTICS=DESCRIPTIVES.
+])
+AT_CHECK([pspp -o pspp.csv correlations.sps])
+# Check the output, ignoring the actual correlations values since
+# they look pretty nonsensical to me for this input (they include NaNs).
+AT_CHECK([sed '/a,Pearson/,$s/,\([[^,]]*\),.*/,\1,.../' pspp.csv], [0], [dnl
+Table: Descriptive Statistics
+,Mean,Std. Deviation,N
+a,24.00,8.93,14.00
+f,4.73,.85,12.00
+b,14.50,6.41,14.00
+c,21.71,4.98,14.00
+g,24.86,6.09,14.00
+h,23.57,6.30,14.00
+i,27.79,6.73,14.00
+e,27.21,4.95,14.00
+d,27.93,5.23,14.00
+
+Table: Correlations
+,,c,g,h,i,e,d
+a,Pearson Correlation,...
+,Sig. (2-tailed),...
+,N,...
+f,Pearson Correlation,...
+,Sig. (2-tailed),...
+,N,...
+b,Pearson Correlation,...
+,Sig. (2-tailed),...
+,N,...
+])
+AT_CLEANUP
+
+
+
+dnl Checks for bug #40661
+AT_SETUP([CORRELATIONS -- incorrect subtable selection])
+AT_DATA([correlations.sps], [dnl
+set format = F12.4.
+set decimal = dot.
+data list notable list /var1 var2 var3 var4 var5 *.
+begin data.
+7,6,9,2,3
+9,12,8,5,8
+8,9,7,8,6
+8,8,9,10,8
+7,6,4,5,3
+7,9,8,2,1
+9,8,11,,10
+8,7,6,,5
+6,7,6,,8
+6,,3,,4
+6,,7,3,3
+5,4,2,7,8
+9,8,6,11,10
+5,6,2,2,4
+8,7,6,8,7
+10,13,8,12,10
+7,8,7,11,2
+8,7,7,9,6
+10,11,11,8,1
+5,8,6,9,9
+8,7,5,5,6
+5,7,2,1,8
+9,8,8,13,6
+5,8,5,6,4
+,7,5,4,5
+,8,4,4,3
+,6,4,9,5
+8,11,9,12,3
+9,11,8,10,6
+10,10,7,8,1
+6,6,3,8,9
+10,9,7,12,2
+6,8,,7,4
+6,8,3,2,9
+7,8,8,2,9
+5,6,5,5,5
+9,9,7,7,5
+9,10,11,7,8
+8,11,9,3,3
+5,4,4,0,5
+9,9,11,14,2
+5,6,2,4,4
+8,8,7,4,1
+9,9,8,14,
+6,8,7,2,
+10,9,9,6,
+8,8,10,9,
+7,8,4,12,
+6,6,6,7,1
+5,7,7,4,10
+9,10,10,13,4
+9,11,9,8,7
+10,13,12,6,8
+8,11,6,8,5
+7,8,7,12,2
+6,7,4,1,10
+5,4,5,6,10
+7,8,6,12,10
+6,5,3,9,2
+7,8,8,7,2
+5,4,4,9,8
+5,7,6,3,9
+10,10,9,13,1
+8,10,9,5,4
+8,9,8,8,7
+7,9,9,6,7
+10,9,7,12,6
+10,13,12,12,4
+7,10,9,7,2
+6,8,7,11,6
+8,11,5,13,2
+7,10,6,12,8
+10,10,9,7,9
+9,12,6,7,10
+6,6,8,2,9
+10,9,12,13,10
+8,9,8,3,6
+8,7,6,4,10
+8,7,10,12,2
+7,6,8,2,7
+8,11,6,9,4
+6,6,7,8,2
+6,7,3,11,4
+5,6,3,0,5
+10,10,11,15,6
+5,4,7,6,8
+5,4,4,1,3
+6,9,8,1,6
+10,11,10,15,8
+7,10,4,11,7
+9,12,8,6,3
+10,10,11,15,2
+10,9,9,15,3
+6,6,8,5,1
+5,7,7,0,3
+9,8,10,6,8
+9,8,11,11,4
+8,10,7,3,4
+7,8,7,3,3
+8,9,10,13,8
+end data.
+
+CORRELATION
+       /VARIABLES =  var1 var2 var3 WITH var4 var5
+       /PRINT = TWOTAIL NOSIG.
+
+CORRELATION
+       /VARIABLES =  var3 var4 var5 WITH var1 var2
+       /PRINT = TWOTAIL NOSIG.
+
+])
+
+AT_CHECK([pspp -O format=csv  correlations.sps], [0],
+[Table: Correlations
+,,var4,var5
+var1,Pearson Correlation,.5693,-.0519
+,Sig. (2-tailed),.000,.623
+,N,93,92
+var2,Pearson Correlation,.3792,-.0407
+,Sig. (2-tailed),.000,.698
+,N,95,93
+var3,Pearson Correlation,.3699,-.0543
+,Sig. (2-tailed),.000,.603
+,N,95,94
+
+Table: Correlations
+,,var1,var2
+var3,Pearson Correlation,.6964,.5615
+,Sig. (2-tailed),.000,.000
+,N,96,97
+var4,Pearson Correlation,.5693,.3792
+,Sig. (2-tailed),.000,.000
+,N,93,95
+var5,Pearson Correlation,-.0519,-.0407
+,Sig. (2-tailed),.623,.698
+,N,92,93
+])
+
+AT_CLEANUP