1 AT_BANNER([CORRELATIONS])
3 AT_SETUP([CORRELATIONS -- unweighted])
4 AT_DATA([correlations.sps], [dnl
6 data list notable list /foo * bar * wiz * bang *.
19 variables = foo bar wiz bang
31 variables = foo bar wiz bang
36 AT_CHECK([pspp -o pspp.csv correlations.sps])
37 AT_CHECK([cat pspp.csv], [0], [dnl
40 foo,Pearson Correlation,1.000,.802,.890,-.308
41 ,Sig. (2-tailed),,.055,.017,.553
42 bar,Pearson Correlation,.802,1.000,.519,.118
43 ,Sig. (2-tailed),.055,,.291,.824
44 wiz,Pearson Correlation,.890,.519,1.000,-.344
45 ,Sig. (2-tailed),.017,.291,,.505
46 bang,Pearson Correlation,-.308,.118,-.344,1.000
47 ,Sig. (2-tailed),.553,.824,.505,
51 bar,Pearson Correlation,1.000,.497
52 ,Sig. (2-tailed),,.210
53 wiz,Pearson Correlation,.497,1.000
54 ,Sig. (2-tailed),.210,
58 foo,Pearson Correlation,1.000,.805,.883,-.308
59 ,Sig. (2-tailed),,.029,.008,.553
61 bar,Pearson Correlation,.805,1.000,.497,.164
62 ,Sig. (2-tailed),.029,,.210,.725
64 wiz,Pearson Correlation,.883,.497,1.000,-.337
65 ,Sig. (2-tailed),.008,.210,,.460
67 bang,Pearson Correlation,-.308,.164,-.337,1.000
68 ,Sig. (2-tailed),.553,.725,.460,
73 AT_SETUP([CORRELATIONS -- weighted])
74 AT_DATA([correlations1.sps], [dnl
76 data list notable list /foo * bar * wiz * bang * w *.
89 variables = foo bar wiz bang
90 /statistics=descriptives xprod
93 AT_DATA([correlations2.sps], [dnl
95 data list notable list /foo * bar * wiz * bang * w *.
111 variables = foo bar wiz bang
112 /statistics=descriptives xprod
115 AT_CHECK([pspp -O format=csv correlations1.sps], [0], [stdout])
117 AT_CHECK([pspp -O format=csv correlations2.sps], [0], [expout])
121 AT_SETUP([CORRELATIONS -- non-square])
122 AT_DATA([corr-ns.sps], [dnl
124 data list notable list /foo * bar * wiz *.
135 variables = foo with bar wiz
139 AT_CHECK([pspp -O format=csv corr-ns.sps], [0], [dnl
142 foo,Pearson Correlation,1.000,-1.000
143 ,Sig. (2-tailed),.000,.000
149 dnl Checks for bug #38661.
150 AT_SETUP([CORRELATIONS -- crash with WITH keyword])
151 AT_DATA([correlations.sps], [dnl
152 DATA LIST LIST NOTABLE /a b c d e f g h i.
155 20 21 17 28 23 4.35 24 19 25
156 28 18 29 30 23 4.55 17 23 28
157 47 18 30 30 29 4.35 26 31 31
158 20 7 19 22 22 4.80 24 16 27
159 19 12 17 27 22 . 22 14 25
160 22 9 19 30 33 5 29 30 27
161 41 16 22 32 23 3.90 26 27 23
162 18 18 20 26 22 5.80 17 20 39
163 18 24 25 25 31 5.15 27 27 34
164 19 22 26 23 37 6 41 32 27
165 23 12 15 29 25 4.10 21 27 20
166 21 4 28 37 31 5.65 27 18 42
167 19 5 17 17 29 3.10 19 16 19
168 21 17 20 35 31 . 28 30 22
171 CORRELATIONS VARIABLE=a f b WITH c g h i e d/STATISTICS=DESCRIPTIVES.
173 AT_CHECK([pspp -o pspp.csv correlations.sps])
174 # Check the output, ignoring the actual correlations values since
175 # they look pretty nonsensical to me for this input (they include NaNs).
176 AT_CHECK([sed '/a,Pearson/,$s/,\([[^,]]*\),.*/,\1,.../' pspp.csv], [0], [dnl
177 Table: Descriptive Statistics
178 ,Mean,Std. Deviation,N
191 a,Pearson Correlation,...
194 f,Pearson Correlation,...
197 b,Pearson Correlation,...
205 dnl Checks for bug #40661
206 AT_SETUP([CORRELATIONS -- incorrect subtable selection])
207 AT_DATA([correlations.sps], [dnl
210 data list notable list /var1 var2 var3 var4 var5 *.
315 /VARIABLES = var1 var2 var3 WITH var4 var5
316 /PRINT = TWOTAIL NOSIG.
319 /VARIABLES = var3 var4 var5 WITH var1 var2
320 /PRINT = TWOTAIL NOSIG.
324 AT_CHECK([pspp -O format=csv correlations.sps], [0],
327 var1,Pearson Correlation,.5693,-.0519
328 ,Sig. (2-tailed),.000,.623
330 var2,Pearson Correlation,.3792,-.0407
331 ,Sig. (2-tailed),.000,.698
333 var3,Pearson Correlation,.3699,-.0543
334 ,Sig. (2-tailed),.000,.603
339 var3,Pearson Correlation,.6964,.5615
340 ,Sig. (2-tailed),.000,.000
342 var4,Pearson Correlation,.5693,.3792
343 ,Sig. (2-tailed),.000,.000
345 var5,Pearson Correlation,-.0519,-.0407
346 ,Sig. (2-tailed),.623,.698
353 dnl Crash found by zzuf
354 AT_SETUP([CORRELATIONS -- empty dataset])
356 AT_DATA([correlations.sps], [dnl
357 data list list /a b c q g *.
358 CORRELATIONS 'VARIABLES = a b.]
361 AT_CHECK([pspp -o pspp.csv correlations.sps], [1], [ignore])
365 dnl Another Crash found by zzuf
366 AT_SETUP([CORRELATIONS -- empty dataset 2])
368 AT_DATA([correlations.sps], [dnl
369 data list notable list /foo * bar * wiz bang *.
379 variables = foo bar wiz bang
384 AT_CHECK([pspp -O format=csv correlations.sps], [1], [dnl
385 correlations.sps:13: error: CORRELATIONS: The data for the chosen variables are all missing or empty.