AT_BANNER([CORRELATIONS]) AT_SETUP([CORRELATIONS -- unweighted]) AT_DATA([correlations.sps], [dnl set format = F11.3. data list notable list /foo * bar * wiz * bang *. begin data. 1 0 3 1 3 9 -50 5 3 4 3 203 4 -9 0 -4 98 78 104 2 3 50 -49 200 . 4 4 4 5 3 0 . end data. correlations variables = foo bar wiz bang /print nosig /missing = listwise . correlations variables = bar wiz /print nosig /missing = listwise . correlations variables = foo bar wiz bang /print nosig /missing = pairwise . ]) AT_CHECK([pspp -o pspp.csv correlations.sps]) AT_CHECK([cat pspp.csv], [0], [dnl Table: Correlations ,,foo,bar,wiz,bang foo,Pearson Correlation,1.000,.802,.890,-.308 ,Sig. (2-tailed),,.055,.017,.553 bar,Pearson Correlation,.802,1.000,.519,.118 ,Sig. (2-tailed),.055,,.291,.824 wiz,Pearson Correlation,.890,.519,1.000,-.344 ,Sig. (2-tailed),.017,.291,,.505 bang,Pearson Correlation,-.308,.118,-.344,1.000 ,Sig. (2-tailed),.553,.824,.505, Table: Correlations ,,bar,wiz bar,Pearson Correlation,1.000,.497 ,Sig. (2-tailed),,.210 wiz,Pearson Correlation,.497,1.000 ,Sig. (2-tailed),.210, Table: Correlations ,,foo,bar,wiz,bang foo,Pearson Correlation,1.000,.805,.883,-.308 ,Sig. (2-tailed),,.029,.008,.553 ,N,7,7,7,6 bar,Pearson Correlation,.805,1.000,.497,.164 ,Sig. (2-tailed),.029,,.210,.725 ,N,7,8,8,7 wiz,Pearson Correlation,.883,.497,1.000,-.337 ,Sig. (2-tailed),.008,.210,,.460 ,N,7,8,8,7 bang,Pearson Correlation,-.308,.164,-.337,1.000 ,Sig. (2-tailed),.553,.725,.460, ,N,6,7,7,7 ]) AT_CLEANUP AT_SETUP([CORRELATIONS -- weighted]) AT_DATA([correlations1.sps], [dnl set format = F11.3. data list notable list /foo * bar * wiz * bang * w *. begin data. 1 0 3 1 1 3 9 -50 5 2 3 4 3 203 1 4 -9 0 -4 1 98 78 104 2 3 3 50 -49 200 1 end data. weight by w. correlations variables = foo bar wiz bang /statistics=descriptives xprod . ]) AT_DATA([correlations2.sps], [dnl set format = F11.3. data list notable list /foo * bar * wiz * bang * w *. begin data. 1 0 3 1 1 3 9 -50 5 1 3 9 -50 5 1 3 4 3 203 1 4 -9 0 -4 1 98 78 104 2 1 98 78 104 2 1 98 78 104 2 1 3 50 -49 200 1 end data. weight by w. correlations variables = foo bar wiz bang /statistics=descriptives xprod . ]) 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 ,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