X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Fcrosstabs.at;h=31546677686d20425d837076019d8da6688a6394;hb=760656deed5c4b4d9d01281400e4bb87cd4b3c5a;hp=eb511ced68140f966d28ade35971fedac373f0a6;hpb=fe8dc2171009e90d2335f159d05f7e6660e24780;p=pspp diff --git a/tests/language/stats/crosstabs.at b/tests/language/stats/crosstabs.at index eb511ced68..3154667768 100644 --- a/tests/language/stats/crosstabs.at +++ b/tests/language/stats/crosstabs.at @@ -26,14 +26,14 @@ X * Y,1,100.0%,0,0.0%,1,100.0% Table: X * Y [count]. ,Y,,,,,,, X,1.00,2.00,3.00,4.00,5.00,6.00,7.00,Total -1.00,.0,.0,.0,.0,.0,.0,.0,.0 -2.00,.0,.0,.0,.0,.0,.0,.0,.0 -3.00,.0,.0,.0,.0,.0,.0,.0,.0 -4.00,.0,.0,.0,.0,1.0,.0,.0,1.0 -5.00,.0,.0,.0,.0,.0,.0,.0,.0 -6.00,.0,.0,.0,.0,.0,.0,.0,.0 -7.00,.0,.0,.0,.0,.0,.0,.0,.0 -Total,.0,.0,.0,.0,1.0,.0,.0,1.0 +1.00,.00,.00,.00,.00,.00,.00,.00,.00 +2.00,.00,.00,.00,.00,.00,.00,.00,.00 +3.00,.00,.00,.00,.00,.00,.00,.00,.00 +4.00,.00,.00,.00,.00,1.00,.00,.00,1.00 +5.00,.00,.00,.00,.00,.00,.00,.00,.00 +6.00,.00,.00,.00,.00,.00,.00,.00,.00 +7.00,.00,.00,.00,.00,.00,.00,.00,.00 +Total,.00,.00,.00,.00,1.00,.00,.00,1.00 ]]) AT_CLEANUP @@ -59,9 +59,9 @@ Variable,Format x,F8.0 y,A18 -"crosstabs.sps:4: warning: BEGIN DATA: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate." +"crosstabs.sps:4: warning: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate." -"crosstabs.sps:6: warning: BEGIN DATA: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate." +"crosstabs.sps:6: warning: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate." Table: Summary. ,Cases,,,,, @@ -72,10 +72,10 @@ x * y,4,66.7%,2,33.3%,6,100.0% Table: x * y [count]. ,y,,,, x,one unity ,three lots ,two duality ,zero none ,Total -1.00,1.0,.0,.0,1.0,2.0 -2.00,.0,.0,1.0,.0,1.0 -3.00,.0,1.0,.0,.0,1.0 -Total,1.0,1.0,1.0,1.0,4.0 +1.00,1.00,.00,.00,1.00,2.00 +2.00,.00,.00,1.00,.00,1.00 +3.00,.00,1.00,.00,.00,1.00 +Total,1.00,1.00,1.00,1.00,4.00 ]]) AT_CLEANUP @@ -131,9 +131,9 @@ y * z,9,100.0%,0,0.0%,9,100.0% Table: y * z [count]. ,z,, y,1,2,Total -1,4.0,3.0,7.0 -2,1.0,1.0,2.0 -Total,5.0,4.0,9.0 +1,4.00,3.00,7.00 +2,1.00,1.00,2.00 +Total,5.00,4.00,9.00 ]]) AT_CLEANUP @@ -168,16 +168,16 @@ x * y,4,100.0%,0,0.0%,4,100.0% Table: x * y [count]. ,y,, x,1.00,2.00,Total -2.00,.0,1.0,1.0 -3.00,1.0,.0,1.0 -4.00,1.0,1.0,2.0 -Total,2.0,2.0,4.0 +2.00,.00,1.00,1.00 +3.00,1.00,.00,1.00 +4.00,1.00,1.00,2.00 +Total,2.00,2.00,4.00 Table: Chi-square tests. Statistic,Value,df,Asymp. Sig. (2-tailed) -Pearson Chi-Square,2.00,2,.37 -Likelihood Ratio,2.77,2,.25 -Linear-by-Linear Association,.27,1,.60 +Pearson Chi-Square,2.00,2,.368 +Likelihood Ratio,2.77,2,.250 +Linear-by-Linear Association,.27,1,.602 N of Valid Cases,4,, ]]) AT_CLEANUP @@ -203,10 +203,11 @@ SPLIT FILE SEPARATE BY v0. CROSSTABS /TABLES= v1 BY v2 - /FORMAT=AVALUE LABELS TABLES PIVOT + /FORMAT=AVALUE TABLES PIVOT /STATISTICS=CHISQ /CELLS=COUNT ROW COLUMN TOTAL. ]) + AT_CHECK([pspp -O format=csv crosstabs.sps], [0], [[Variable,Value,Label v0,a , @@ -220,25 +221,25 @@ v1 * v2,6,100.0%,0,0.0%,6,100.0% "Table: v1 * v2 [count, row %, column %, total %]." ,v2,, v1,e ,f ,Total -c ,3.0,1.0,4.0 -,75.0%,25.0%,100.0% -,75.0%,50.0%,66.7% -,50.0%,16.7%,66.7% -d ,1.0,1.0,2.0 -,50.0%,50.0%,100.0% -,25.0%,50.0%,33.3% -,16.7%,16.7%,33.3% -Total,4.0,2.0,6.0 -,66.7%,33.3%,100.0% -,100.0%,100.0%,100.0% -,66.7%,33.3%,100.0% +c ,3.00,1.00,4.00 +,75.00%,25.00%,100.00% +,75.00%,50.00%,66.67% +,50.00%,16.67%,66.67% +d ,1.00,1.00,2.00 +,50.00%,50.00%,100.00% +,25.00%,50.00%,33.33% +,16.67%,16.67%,33.33% +Total,4.00,2.00,6.00 +,66.67%,33.33%,100.00% +,100.00%,100.00%,100.00% +,66.67%,33.33%,100.00% Table: Chi-square tests. Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed) -Pearson Chi-Square,.38,1,.54,, -Likelihood Ratio,.37,1,.54,, -Fisher's Exact Test,,,,1.00,.60 -Continuity Correction,.00,1,1.00,, +Pearson Chi-Square,.38,1,.540,, +Likelihood Ratio,.37,1,.545,, +Fisher's Exact Test,,,,1.000,.600 +Continuity Correction,.00,1,1.000,, N of Valid Cases,6,,,, Variable,Value,Label @@ -253,25 +254,25 @@ v1 * v2,4,100.0%,0,0.0%,4,100.0% "Table: v1 * v2 [count, row %, column %, total %]." ,v2,, v1,e ,f ,Total -c ,.0,1.0,1.0 -,.0%,100.0%,100.0% -,.0%,33.3%,25.0% -,.0%,25.0%,25.0% -d ,1.0,2.0,3.0 -,33.3%,66.7%,100.0% -,100.0%,66.7%,75.0% -,25.0%,50.0%,75.0% -Total,1.0,3.0,4.0 -,25.0%,75.0%,100.0% -,100.0%,100.0%,100.0% -,25.0%,75.0%,100.0% +c ,.00,1.00,1.00 +,.00%,100.00%,100.00% +,.00%,33.33%,25.00% +,.00%,25.00%,25.00% +d ,1.00,2.00,3.00 +,33.33%,66.67%,100.00% +,100.00%,66.67%,75.00% +,25.00%,50.00%,75.00% +Total,1.00,3.00,4.00 +,25.00%,75.00%,100.00% +,100.00%,100.00%,100.00% +,25.00%,75.00%,100.00% Table: Chi-square tests. Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed) -Pearson Chi-Square,.44,1,.50,, -Likelihood Ratio,.68,1,.41,, -Fisher's Exact Test,,,,1.00,.75 -Continuity Correction,.00,1,1.00,, +Pearson Chi-Square,.44,1,.505,, +Likelihood Ratio,.68,1,.410,, +Fisher's Exact Test,,,,1.000,.750 +Continuity Correction,.00,1,1.000,, N of Valid Cases,4,,,, ]]) AT_CLEANUP @@ -329,27 +330,27 @@ x * y * z,9,100.0%,0,0.0%,9,100.0% Table: x * y * z [count]. z,,y,, ,x,1,2,Total -1,1,1.0,.0,1.0 -,3,1.0,.0,1.0 -,5,.0,1.0,1.0 -,7,1.0,.0,1.0 -,8,1.0,.0,1.0 -Total,,4.0,1.0,5.0 -2,2,.0,1.0,1.0 -,4,1.0,.0,1.0 -,6,1.0,.0,1.0 -,9,1.0,.0,1.0 -Total,,3.0,1.0,4.0 +1,1,1.00,.00,1.00 +,3,1.00,.00,1.00 +,5,.00,1.00,1.00 +,7,1.00,.00,1.00 +,8,1.00,.00,1.00 +Total,,4.00,1.00,5.00 +2,2,.00,1.00,1.00 +,4,1.00,.00,1.00 +,6,1.00,.00,1.00 +,9,1.00,.00,1.00 +Total,,3.00,1.00,4.00 Table: Chi-square tests. z,Statistic,Value,df,Asymp. Sig. (2-tailed) -1,Pearson Chi-Square,5.00,4,.29 -,Likelihood Ratio,5.00,4,.29 -,Linear-by-Linear Association,.01,1,.94 +1,Pearson Chi-Square,5.00,4,.287 +,Likelihood Ratio,5.00,4,.287 +,Linear-by-Linear Association,.01,1,.938 ,N of Valid Cases,5,, -2,Pearson Chi-Square,4.00,3,.26 -,Likelihood Ratio,4.50,3,.21 -,Linear-by-Linear Association,1.58,1,.21 +2,Pearson Chi-Square,4.00,3,.261 +,Likelihood Ratio,4.50,3,.212 +,Linear-by-Linear Association,1.58,1,.209 ,N of Valid Cases,4,, Table: Symmetric measures. @@ -361,7 +362,7 @@ z,Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. ,,Kendall's tau-c,.00,.32,.00, ,,Gamma,.00,.50,.00, ,,Spearman Correlation,.00,.22,.00, -,Interval by Interval,Pearson's R,.04,.22,.18, +,Interval by Interval,Pearson's R,.04,.22,.07, ,N of Valid Cases,,5,,, 2,Nominal by Nominal,Phi,1.00,,, ,,Cramer's V,1.00,,, @@ -369,38 +370,38 @@ z,Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. ,Ordinal by Ordinal,Kendall's tau-b,-.71,.20,-1.73, ,,Kendall's tau-c,-.75,.43,-1.73, ,,Gamma,-1.00,.00,-1.73, -,,Spearman Correlation,-.77,.17,-6.77, -,Interval by Interval,Pearson's R,-.73,.18,-5.49, +,,Spearman Correlation,-.77,.17,-1.73, +,Interval by Interval,Pearson's R,-.73,.18,-1.49, ,N of Valid Cases,,4,,, Table: Directional measures. z,Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. -1,Nominal by Nominal,Lambda,Symmetric,.40,.28,1.02, -,,,x Dependent,.25,NaN,1.12, -,,,y Dependent,1.00,NaN,1.12, -,,Goodman and Kruskal tau,x Dependent,.25,,, -,,,y Dependent,1.00,,, -,,Uncertainty Coefficient,Symmetric,.47,.18,1.51, -,,,x Dependent,.31,.15,2.02, -,,,y Dependent,1.00,.00,2.02, -,Ordinal by Ordinal,Somers' d,Symmetric,.00,.09,.00, -,,,x Dependent,.00,.50,.00, -,,,y Dependent,.00,.20,.00, -,Nominal by Interval,Eta,x Dependent,.04,,, -,,,y Dependent,1.00,,, -2,Nominal by Nominal,Lambda,Symmetric,.50,.25,1.51, -,,,x Dependent,.33,NaN,1.15, -,,,y Dependent,1.00,NaN,1.15, -,,Goodman and Kruskal tau,x Dependent,.33,,, -,,,y Dependent,1.00,,, -,,Uncertainty Coefficient,Symmetric,.58,.17,1.56, -,,,x Dependent,.41,.17,2.36, -,,,y Dependent,1.00,.00,2.36, -,Ordinal by Ordinal,Somers' d,Symmetric,-.67,.04,-1.73, -,,,x Dependent,-1.00,.00,-1.73, -,,,y Dependent,-.50,.29,-1.73, -,Nominal by Interval,Eta,x Dependent,.73,,, -,,,y Dependent,1.00,,, +1,Nominal by Nominal,Lambda,Symmetric,.40,.28,1.12,.264 +,,,x Dependent,.25,.22,1.12,.264 +,,,y Dependent,1.00,.00,1.12,.264 +,,Goodman and Kruskal tau,x Dependent,.25,,,. @&t@ +,,,y Dependent,1.00,,,. @&t@ +,,Uncertainty Coefficient,Symmetric,.47,.18,,. @&t@ +,,,x Dependent,.31,.15,2.02,. @&t@ +,,,y Dependent,1.00,.00,2.02,. @&t@ +,Ordinal by Ordinal,Somers' d,Symmetric,.00,,.00,1.000 +,,,x Dependent,.00,.50,.00,1.000 +,,,y Dependent,.00,.20,.00,1.000 +,Nominal by Interval,Eta,x Dependent,.04,,,. @&t@ +,,,y Dependent,1.00,,,. @&t@ +2,Nominal by Nominal,Lambda,Symmetric,.50,.25,2.00,.046 +,,,x Dependent,.33,.27,1.15,.248 +,,,y Dependent,1.00,.00,1.15,.248 +,,Goodman and Kruskal tau,x Dependent,.33,,,. @&t@ +,,,y Dependent,1.00,,,. @&t@ +,,Uncertainty Coefficient,Symmetric,.58,.17,,. @&t@ +,,,x Dependent,.41,.17,2.36,. @&t@ +,,,y Dependent,1.00,.00,2.36,. @&t@ +,Ordinal by Ordinal,Somers' d,Symmetric,-.67,,-1.73,.083 +,,,x Dependent,-1.00,.00,-1.73,.083 +,,,y Dependent,-.50,.29,-1.73,.083 +,Nominal by Interval,Eta,x Dependent,.73,,,. @&t@ +,,,y Dependent,1.00,,,. @&t@ ]]) AT_CLEANUP @@ -433,10 +434,10 @@ x * y,6,100.0%,0,0.0%,6,100.0% Table: x * y [count]. ,y,, x,2.00,1.00,Total -4.00,.0,1.0,1.0 -3.00,2.0,1.0,3.0 -2.00,2.0,.0,2.0 -Total,4.0,2.0,6.0 +4.00,.00,1.00,1.00 +3.00,2.00,1.00,3.00 +2.00,2.00,.00,2.00 +Total,4.00,2.00,6.00 ]]) AT_CLEANUP @@ -462,3 +463,1076 @@ X1 * X2,0,0.0%,1,100.0%,1,100.0% crosstabs.sps:8: warning: CROSSTABS: Crosstabulation X1 * X2 contained no non-missing cases. ]) AT_CLEANUP + + + +dnl This example comes from http://www.ats.ucla.edu/stat/spss/whatstat/whatstat.htm#chisq +AT_SETUP([CROSSTABS Fisher Exact Test]) + +AT_DATA([fisher-exact.sps], [dnl +SET FORMAT F12.3. +SET DECIMAL DOT. + +DATA LIST notable LIST /schtyp (F9.2) female (F9.2) ses (F9.2) . +begin data. + 1.00 .00 1.00 + 1.00 1.00 2.00 + 1.00 .00 3.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 3.00 + 1.00 .00 1.00 + 1.00 .00 1.00 + 1.00 .00 3.00 + 2.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 2.00 .00 2.00 + 2.00 .00 3.00 + 1.00 .00 1.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 2.00 .00 3.00 + 1.00 .00 2.00 + 2.00 .00 3.00 + 1.00 .00 3.00 + 2.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 1.00 + 1.00 .00 2.00 + 2.00 .00 2.00 + 2.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 1.00 + 1.00 .00 3.00 + 1.00 .00 1.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 2.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 2.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 1.00 + 1.00 .00 2.00 + 2.00 .00 2.00 + 1.00 .00 2.00 + 2.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 1.00 + 1.00 .00 2.00 + 2.00 .00 3.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 1.00 + 1.00 .00 1.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 2.00 + 1.00 .00 1.00 + 1.00 .00 3.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 3.00 + 1.00 .00 1.00 + 2.00 .00 2.00 + 1.00 .00 1.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 3.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 1.00 .00 3.00 + 1.00 .00 2.00 + 1.00 .00 1.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 1.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 2.00 1.00 3.00 + 1.00 1.00 3.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 3.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 2.00 1.00 1.00 + 2.00 1.00 3.00 + 1.00 1.00 2.00 + 1.00 1.00 1.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 2.00 1.00 3.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 1.00 + 2.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 1.00 + 1.00 1.00 3.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 1.00 + 1.00 1.00 3.00 + 2.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 2.00 1.00 2.00 + 1.00 1.00 1.00 + 1.00 1.00 3.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 2.00 1.00 3.00 + 1.00 1.00 2.00 + 2.00 1.00 2.00 + 1.00 1.00 1.00 + 1.00 1.00 1.00 + 1.00 1.00 1.00 + 1.00 1.00 3.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 2.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 1.00 + 2.00 1.00 2.00 + 1.00 1.00 1.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 2.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 2.00 + 1.00 1.00 2.00 + 2.00 1.00 3.00 + 1.00 1.00 1.00 + 1.00 1.00 1.00 + 2.00 1.00 3.00 + 2.00 1.00 2.00 + 1.00 1.00 3.00 + 2.00 1.00 2.00 + 2.00 1.00 2.00 + 1.00 1.00 2.00 + 2.00 1.00 2.00 + 1.00 1.00 2.00 + 1.00 1.00 3.00 +end data. + +VARIABLE LABEL schtyp 'type of school'. +ADD VALUE LABELS female 0 male 1 female. +ADD VALUE LABELS ses 1 low 2 middle 3 high. +ADD VALUE LABELS schtyp 1 public 2 private. + +crosstabs /tables = schtyp by female /statistic = chisq. +crosstabs /tables = female by ses /statistic = chisq. +]) + +AT_CHECK([pspp -O format=csv fisher-exact.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +type of school * female,200,100.0%,0,0.0%,200,100.0% + +Table: type of school * female [[count]]. +,female,, +type of school,male,female,Total +public,77.000,91.000,168.000 +private,14.000,18.000,32.000 +Total,91.000,109.000,200.000 + +Table: Chi-square tests. +Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed) +Pearson Chi-Square,.047,1,.828,, +Likelihood Ratio,.047,1,.828,, +Fisher's Exact Test,,,,.849,.492 +Continuity Correction,.001,1,.981,, +Linear-by-Linear Association,.047,1,.829,, +N of Valid Cases,200,,,, + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +female * ses,200,100.0%,0,0.0%,200,100.0% + +Table: female * ses [[count]]. +,ses,,, +female,low,middle,high,Total +male,15.000,47.000,29.000,91.000 +female,32.000,48.000,29.000,109.000 +Total,47.000,95.000,58.000,200.000 + +Table: Chi-square tests. +Statistic,Value,df,Asymp. Sig. (2-tailed) +Pearson Chi-Square,4.577,2,.101 +Likelihood Ratio,4.679,2,.096 +Linear-by-Linear Association,3.110,1,.078 +N of Valid Cases,200,, +]) + +AT_CLEANUP + +AT_SETUP([CROSSTABS Pearson's R]) +# Test 1. +AT_DATA([pearson.sps], [dnl +SET FORMAT F8.3. + +* From http://www.statisticslectures.com/topics/pearsonr/. +DATA LIST FREE/x y. +BEGIN DATA. +1 4 +3 6 +5 10 +5 12 +6 13 +END DATA. +CROSSTABS x BY y/STATISTICS=CORR. +]) +AT_CHECK([pspp -O format=csv pearson.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,5,100.0%,0,0.0%,5,100.0% + +Table: x * y [[count]]. +,y,,,,, +x,4.000,6.000,10.000,12.000,13.000,Total +1.000,1.000,.000,.000,.000,.000,1.000 +3.000,.000,1.000,.000,.000,.000,1.000 +5.000,.000,.000,1.000,1.000,.000,2.000 +6.000,.000,.000,.000,.000,1.000,1.000 +Total,1.000,1.000,1.000,1.000,1.000,5.000 + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Spearman Correlation,.975,.022,7.550, +Interval by Interval,Pearson's R,.968,.017,6.708, +N of Valid Cases,,5,,, +]) + +# Test 2. +AT_DATA([pearson2.sps], [dnl +SET FORMAT F8.3. + +* Checked with http://www.socscistatistics.com/tests/pearson/Default2.aspx. +DATA LIST FREE/x y. +BEGIN DATA. +1 1.5 +2 1.5 +3 4 +4 6 +5 5 +6 7 +7 6.5 +8 9 +9 10.5 +10 11 +END DATA. +CROSSTABS x BY y/STATISTICS=CORR. +]) +AT_CHECK([pspp -O format=csv pearson2.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,10,100.0%,0,0.0%,10,100.0% + +Table: x * y [[count]]. +,y,,,,,,,,, +x,1.500,4.000,5.000,6.000,6.500,7.000,9.000,10.500,11.000,Total +1.000,1.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000 +2.000,1.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000 +3.000,.000,1.000,.000,.000,.000,.000,.000,.000,.000,1.000 +4.000,.000,.000,.000,1.000,.000,.000,.000,.000,.000,1.000 +5.000,.000,.000,1.000,.000,.000,.000,.000,.000,.000,1.000 +6.000,.000,.000,.000,.000,.000,1.000,.000,.000,.000,1.000 +7.000,.000,.000,.000,.000,1.000,.000,.000,.000,.000,1.000 +8.000,.000,.000,.000,.000,.000,.000,1.000,.000,.000,1.000 +9.000,.000,.000,.000,.000,.000,.000,.000,1.000,.000,1.000 +10.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000,1.000 +Total,2.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,10.000 + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Spearman Correlation,.973,.015,11.844, +Interval by Interval,Pearson's R,.971,.017,11.580, +N of Valid Cases,,10,,, +]) + +# Test 3. +AT_DATA([pearson3.sps], [dnl +SET FORMAT F8.3. + +* From http://learntech.uwe.ac.uk/da/Default.aspx?pageid=1442. +DATA LIST FREE/x y. +BEGIN DATA. +56 87 +56 91 +65 85 +65 91 +50 75 +25 28 +87 122 +44 66 +35 58 +END DATA. +CROSSTABS x BY y/STATISTICS=CORR. +]) +AT_CHECK([pspp -O format=csv pearson3.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,9,100.0%,0,0.0%,9,100.0% + +Table: x * y [[count]]. +,y,,,,,,,, +x,28.000,58.000,66.000,75.000,85.000,87.000,91.000,122.000,Total +25.000,1.000,.000,.000,.000,.000,.000,.000,.000,1.000 +35.000,.000,1.000,.000,.000,.000,.000,.000,.000,1.000 +44.000,.000,.000,1.000,.000,.000,.000,.000,.000,1.000 +50.000,.000,.000,.000,1.000,.000,.000,.000,.000,1.000 +56.000,.000,.000,.000,.000,.000,1.000,1.000,.000,2.000 +65.000,.000,.000,.000,.000,1.000,.000,1.000,.000,2.000 +87.000,.000,.000,.000,.000,.000,.000,.000,1.000,1.000 +Total,1.000,1.000,1.000,1.000,1.000,1.000,2.000,1.000,9.000 + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Spearman Correlation,.911,.068,5.860, +Interval by Interval,Pearson's R,.966,.017,9.915, +N of Valid Cases,,9,,, +]) + +# Test 4. +AT_DATA([pearson4.sps], [dnl +SET FORMAT F8.3. + +* From http://psychology.ucdavis.edu/faculty_sites/sommerb/sommerdemo/correlation/hand/pearson_hand.htm. +DATA LIST FREE/x y. +BEGIN DATA. +5 5 +10 20 +6 4 +8 15 +4 11 +4 9 +3 12 +10 18 +2 7 +6 2 +7 14 +9 17 +END DATA. +CROSSTABS x BY y/STATISTICS=CORR. +]) +AT_CHECK([pspp -O format=csv pearson4.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,12,100.0%,0,0.0%,12,100.0% + +Table: x * y [[count]]. +,y,,,,,,,,,,,, +x,2.000,4.000,5.000,7.000,9.000,11.000,12.000,14.000,15.000,17.000,18.000,20.000,Total +2.000,.000,.000,.000,1.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000 +3.000,.000,.000,.000,.000,.000,.000,1.000,.000,.000,.000,.000,.000,1.000 +4.000,.000,.000,.000,.000,1.000,1.000,.000,.000,.000,.000,.000,.000,2.000 +5.000,.000,.000,1.000,.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000 +6.000,1.000,1.000,.000,.000,.000,.000,.000,.000,.000,.000,.000,.000,2.000 +7.000,.000,.000,.000,.000,.000,.000,.000,1.000,.000,.000,.000,.000,1.000 +8.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000,.000,.000,.000,1.000 +9.000,.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000,.000,.000,1.000 +10.000,.000,.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000,1.000,2.000 +Total,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,12.000 + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Spearman Correlation,.657,.140,2.758, +Interval by Interval,Pearson's R,.667,.132,2.830, +N of Valid Cases,,12,,, +]) + +# Test 5. +AT_DATA([pearson5.sps], [dnl +SET FORMAT F8.3. + +* From http://www.statisticslectures.com/topics/pearsonr/. +DATA LIST FREE/x y. +BEGIN DATA. +18 15000 +25 29000 +57 68000 +45 52000 +26 32000 +64 80000 +37 41000 +40 45000 +24 26000 +33 33000 +END DATA. +CROSSTABS x BY y/STATISTICS=CORR. +]) +AT_CHECK([pspp -O format=csv pearson5.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,10,100.0%,0,0.0%,10,100.0% + +Table: x * y [[count]]. +,y,,,,,,,,,, +x,15000.000,26000.000,29000.000,32000.000,33000.000,41000.000,45000.000,52000.000,68000.000,80000.000,Total +18.000,1.000,.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000 +24.000,.000,1.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000 +25.000,.000,.000,1.000,.000,.000,.000,.000,.000,.000,.000,1.000 +26.000,.000,.000,.000,1.000,.000,.000,.000,.000,.000,.000,1.000 +33.000,.000,.000,.000,.000,1.000,.000,.000,.000,.000,.000,1.000 +37.000,.000,.000,.000,.000,.000,1.000,.000,.000,.000,.000,1.000 +40.000,.000,.000,.000,.000,.000,.000,1.000,.000,.000,.000,1.000 +45.000,.000,.000,.000,.000,.000,.000,.000,1.000,.000,.000,1.000 +57.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000,.000,1.000 +64.000,.000,.000,.000,.000,.000,.000,.000,.000,.000,1.000,1.000 +Total,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,10.000 + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Spearman Correlation,1.000,.000,+Infinity, +Interval by Interval,Pearson's R,.992,.004,22.638, +N of Valid Cases,,10,,, +]) +AT_CLEANUP + +AT_SETUP([CROSSTABS Goodman and Kruskal's lambda]) +AT_DATA([lambda.sps], [dnl +SET FORMAT F8.3. + +* From http://www.csupomona.edu/~jlkorey/POWERMUTT/Topics/contingency_tables.html. +DATA LIST LIST NOTABLE/x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 424 +1 2 213 +1 3 59 +3 1 55 +3 2 188 +3 3 357 +END DATA. + +CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA. + +* From http://vassarstats.net. +DATA LIST LIST NOTABLE/x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 19 +1 2 26 +1 3 8 +2 1 21 +2 2 13 +2 3 5 +3 1 6 +3 2 12 +3 3 27 +END DATA. + +CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA. + +* From Goodman, L.A., Kruskal, W.H. (1954) "Measures of association for + cross classifications". Part I. Journal of the American Statistical + Association, 49, 732-764. +DATA LIST LIST NOTABLE/x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 1768 +1 2 807 +1 3 189 +1 4 47 +2 1 946 +2 2 1387 +2 3 746 +2 4 53 +3 1 115 +3 2 438 +3 3 288 +3 4 16 +END DATA. +CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA. +]) +AT_CHECK([pspp -O format=csv lambda.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,1296.000,100.0%,.000,0.0%,1296.000,100.0% + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Lambda,Symmetric,.423,.021,16.875,.000 +,,x Dependent,.497,.024,15.986,.000 +,,y Dependent,.370,.020,16.339,.000 +,Goodman and Kruskal tau,x Dependent,.382,,,. @&t@ +,,y Dependent,.198,,,. @&t@ + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,137.000,100.0%,.000,0.0%,137.000,100.0% + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Lambda,Symmetric,.259,.081,2.902,.004 +,,x Dependent,.250,.089,2.479,.013 +,,y Dependent,.267,.085,2.766,.006 +,Goodman and Kruskal tau,x Dependent,.129,,,. @&t@ +,,y Dependent,.123,,,. @&t@ + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,6800.000,100.0%,.000,0.0%,6800.000,100.0% + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Lambda,Symmetric,.208,.010,18.793,.000 +,,x Dependent,.224,.013,16.076,.000 +,,y Dependent,.192,.012,14.438,.000 +,Goodman and Kruskal tau,x Dependent,.089,,,. @&t@ +,,y Dependent,.081,,,. @&t@ +]) +AT_CLEANUP + +AT_SETUP([CROSSTABS Goodman and Kruskal's lambda - treatment of ties]) +AT_DATA([lambda.sps], [dnl +SET FORMAT F8.3. + +* From Douglas Bonett. +DATA LIST LIST NOTABLE/x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 225 +1 2 43 +1 3 216 +2 1 3 +2 2 1 +2 3 12 +END DATA. + +CROSSTABS x BY y/CELLS=NONE/STATISTICS=LAMBDA. +]) +AT_CHECK([pspp -O format=csv lambda.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,500.000,100.0%,.000,0.0%,500.000,100.0% + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Lambda,Symmetric,.031,.013,2.336,.019 +,,x Dependent,.000,.000,NaN,NaN +,,y Dependent,.033,.014,2.336,.019 +,Goodman and Kruskal tau,x Dependent,.012,,,. @&t@ +,,y Dependent,.009,,,. @&t@ +]) +AT_CLEANUP + +AT_SETUP([CROSSTABS Somers' D, Tau-B, Tau-C, Gamma]) +AT_DATA([somersd.sps], [dnl +SET FORMAT F8.3. + +* From http://stats.stackexchange.com/questions/72203/problem-with-calculating-asymptotic-standard-error-for-somers-d. +DATA LIST LIST NOTABLE/x y * w (F10.6). +WEIGHT BY w. +BEGIN DATA. +1 1 0.000025 +1 2 0.0001 +1 3 0.001 +1 4 0.0025 +1 5 0.004 +1 6 0.0075 +1 7 0.0125 +2 1 0.049975 +2 2 0.0999 +2 3 0.199 +2 4 0.2475 +2 5 0.196 +2 6 0.1425 +2 7 0.0375 +END DATA. +CROSSTABS x BY y/STATISTICS=D/CELLS=NONE. + +* From http://uregina.ca/~gingrich/gamma.pdf. +DATA LIST LIST NOTABLE/x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 34 +1 2 24 +1 3 15 +2 1 42 +2 2 74 +2 3 67 +3 1 28 +3 2 111 +3 3 292 +END DATA. +CROSSTABS x BY y/STATISTICS=BTAU CTAU GAMMA D/CELLS=NONE. +]) +AT_CHECK([pspp -O format=csv somersd.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,1.000000,100.0%,.000000,0.0%,1.000000,100.0% + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Somers' d,Symmetric,-.084,,-.149,.882 +,,x Dependent,-.045,.300,-.149,.882 +,,y Dependent,-.684,2.378,-.149,.882 + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,687.000,100.0%,.000,0.0%,687.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Kendall's tau-b,.372,.033,10.669, +,Kendall's tau-c,.310,.029,10.669, +,Gamma,.591,.043,10.669, +N of Valid Cases,,687.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Somers' d,Symmetric,.371,,10.669,.000 +,,x Dependent,.351,.032,10.669,.000 +,,y Dependent,.394,.035,10.669,.000 +]) + +AT_DATA([ordinal.sps], [dnl +SET FORMAT F8.3. + +* From https://www.iup.edu/WorkArea/DownloadAsset.aspx?id=9829, "Case 1". +DATA LIST LIST NOTABLE /x y w. +WEIGHT BY w. +BEGIN DATA. +1 2 40 +2 3 80 +3 4 30 +END DATA. +CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE. + +* Same site, case 2. +DATA LIST LIST NOTABLE /x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 40 +2 3 80 +3 4 30 +END DATA. +CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE. + +* Same site, case 3. +DATA LIST LIST NOTABLE /x y w. +WEIGHT BY w. +BEGIN DATA. +1 4 40 +2 3 80 +3 2 30 +END DATA. +CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE. + +* Same site, case 4. +DATA LIST LIST NOTABLE /x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 20 +1 2 20 +2 3 80 +3 4 30 +END DATA. +CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE. + +* Same site, case 5. +DATA LIST LIST NOTABLE /x y w. +WEIGHT BY w. +BEGIN DATA. +1 2 40 +2 2 80 +3 2 29 +3 3 1 +END DATA. +CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE. + +* Same site, case 6. +DATA LIST LIST NOTABLE /x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 3 +1 2 6 +1 3 28 +1 4 61 +2 1 4 +2 2 5 +2 3 21 +2 4 20 +END DATA. +CROSSTABS x BY y/STATISTICS=GAMMA D BTAU/CELLS=NONE. + +* Same site, case 7. +DATA LIST LIST NOTABLE /x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 38 +1 2 6 +1 3 3 +1 4 51 +2 1 4 +2 2 20 +2 3 21 +2 4 5 +END DATA. +CROSSTABS x BY y/STATISTICS=LAMBDA D PHI GAMMA/CELLS=NONE. + +* Same site, case 8. +DATA LIST LIST NOTABLE /x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 2 +1 2 3 +1 3 5 +1 4 1 +2 1 2 +2 2 16 +2 3 3 +2 4 6 +3 1 3 +3 2 10 +3 3 35 +3 4 27 +4 1 6 +4 2 15 +4 3 33 +4 4 45 +END DATA. +CROSSTABS x BY y/STATISTICS=LAMBDA D PHI BTAU/CELLS=NONE. +]) +AT_CHECK([pspp -O format=csv ordinal.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,150.000,100.0%,.000,0.0%,150.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Kendall's tau-b,1.000,.000,24.841, +,Gamma,1.000,.000,24.841, +N of Valid Cases,,150.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Somers' d,Symmetric,1.000,,24.841,.000 +,,x Dependent,1.000,.000,24.841,.000 +,,y Dependent,1.000,.000,24.841,.000 + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,150.000,100.0%,.000,0.0%,150.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Kendall's tau-b,1.000,.000,24.841, +,Gamma,1.000,.000,24.841, +N of Valid Cases,,150.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Somers' d,Symmetric,1.000,,24.841,.000 +,,x Dependent,1.000,.000,24.841,.000 +,,y Dependent,1.000,.000,24.841,.000 + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,150.000,100.0%,.000,0.0%,150.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Kendall's tau-b,-1.000,.000,-24.841, +,Gamma,-1.000,.000,-24.841, +N of Valid Cases,,150.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Somers' d,Symmetric,-1.000,,-24.841,.000 +,,x Dependent,-1.000,.000,-24.841,.000 +,,y Dependent,-1.000,.000,-24.841,.000 + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,150.000,100.0%,.000,0.0%,150.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Kendall's tau-b,.972,.007,24.841, +,Gamma,1.000,.000,24.841, +N of Valid Cases,,150.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Somers' d,Symmetric,.971,,24.841,.000 +,,x Dependent,.944,.013,24.841,.000 +,,y Dependent,1.000,.000,24.841,.000 + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,150.000,100.0%,.000,0.0%,150.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Kendall's tau-b,.119,.059,1.009, +,Gamma,1.000,.000,1.009, +N of Valid Cases,,150.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Somers' d,Symmetric,.035,,1.009,.313 +,,x Dependent,.805,.032,1.009,.313 +,,y Dependent,.018,.017,1.009,.313 + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,148.000,100.0%,.000,0.0%,148.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Kendall's tau-b,-.208,.078,-2.641, +,Gamma,-.381,.130,-2.641, +N of Valid Cases,,148.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Ordinal by Ordinal,Somers' d,Symmetric,-.206,,-2.641,.008 +,,x Dependent,-.182,.069,-2.641,.008 +,,y Dependent,-.237,.089,-2.641,.008 + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,148.000,100.0%,.000,0.0%,148.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Phi,.731,,, +,Cramer's V,.731,,, +Ordinal by Ordinal,Gamma,-.110,.107,-1.022, +N of Valid Cases,,148.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Lambda,Symmetric,.338,.059,4.743,.000 +,,x Dependent,.640,.085,4.875,.000 +,,y Dependent,.174,.050,3.248,.001 +,Goodman and Kruskal tau,x Dependent,.534,,,. @&t@ +,,y Dependent,.167,,,. @&t@ +Ordinal by Ordinal,Somers' d,Symmetric,-.074,,-1.022,.307 +,,x Dependent,-.060,.059,-1.022,.307 +,,y Dependent,-.096,.094,-1.022,.307 + +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,212.000,100.0%,.000,0.0%,212.000,100.0% + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Phi,.432,,, +,Cramer's V,.249,,, +Ordinal by Ordinal,Kendall's tau-b,.209,.062,3.338, +N of Valid Cases,,212.000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Lambda,Symmetric,.102,.067,1.473,.141 +,,x Dependent,.027,.087,.302,.763 +,,y Dependent,.165,.065,2.349,.019 +,Goodman and Kruskal tau,x Dependent,.051,,,. @&t@ +,,y Dependent,.068,,,. @&t@ +Ordinal by Ordinal,Somers' d,Symmetric,.209,,3.338,.001 +,,x Dependent,.202,.060,3.338,.001 +,,y Dependent,.217,.064,3.338,.001 +]) +AT_CLEANUP + +AT_SETUP([CROSSTABS many statistics]) +AT_DATA([crosstabs.sps], [dnl +SET FORMAT=F8.4. + +* From http://www4.stat.ncsu.edu/~dzhang2/st744/table3.9.lst.txt. +DATA LIST LIST NOTABLE/x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 25 +1 2 25 +1 3 12 +2 2 1 +2 3 3 +END DATA. +CROSSTABS x BY y/STATISTICS=CHISQ PHI CC LAMBDA UC BTAU CTAU GAMMA D CORR/CELLS=NONE. +]) +AT_CHECK([pspp -O format=csv crosstabs.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,66.0000,100.0%,.0000,0.0%,66.0000,100.0% + +Table: Chi-square tests. +Statistic,Value,df,Asymp. Sig. (2-tailed) +Pearson Chi-Square,6.9562,2.0000,.031 +Likelihood Ratio,6.6901,2.0000,.035 +Linear-by-Linear Association,5.8450,1.0000,.016 +N of Valid Cases,66.0000,, + +Table: Symmetric measures. +Category,Statistic,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Phi,.3246,,, +,Cramer's V,.3246,,, +,Contingency Coefficient,.3088,,, +Ordinal by Ordinal,Kendall's tau-b,.2752,.0856,1.9920, +,Kendall's tau-c,.1497,.0751,1.9920, +,Gamma,.8717,.1250,1.9920, +,Spearman Correlation,.2908,.0906,2.4311, +Interval by Interval,Pearson's R,.2999,.0973,2.5147, +N of Valid Cases,,66.0000,,, + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Lambda,Symmetric,.0455,.1629,.2723,.785 +,,x Dependent,.0000,.0000,NaN,NaN +,,y Dependent,.0500,.1791,.2723,.785 +,Goodman and Kruskal tau,x Dependent,.1054,,,. @&t@ +,,y Dependent,.0434,,,. @&t@ +,Uncertainty Coefficient,Symmetric,.0780,.0474,,. @&t@ +,,x Dependent,.2217,.1062,1.5373,. @&t@ +,,y Dependent,.0473,.0306,1.5373,. @&t@ +Ordinal by Ordinal,Somers' d,Symmetric,.1960,,1.9920,.046 +,,x Dependent,.1152,.0572,1.9920,.046 +,,y Dependent,.6573,.1417,1.9920,.046 +]) +AT_CLEANUP + +AT_SETUP([CROSSTABS uncertainy coefficient]) +AT_DATA([uc.sps], [dnl +* From http://groups.chass.utoronto.ca/pol242/5bMeasuringAssociation.htm. +SET FORMAT=F8.3. + +DATA LIST LIST NOTABLE/x y w. +WEIGHT BY w. +BEGIN DATA. +1 1 416 +1 2 121 +2 1 335 +2 2 2 +3 1 112 +3 2 1 +END DATA. +CROSSTABS x BY y/STATISTICS=LAMBDA UC/CELLS=NONE. +]) +AT_CHECK([pspp -O format=csv uc.sps], [0], [dnl +Table: Summary. +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x * y,987.000,100.0%,.000,0.0%,987.000,100.0% + +Table: Directional measures. +Category,Statistic,Type,Value,Asymp. Std. Error,Approx. T,Approx. Sig. +Nominal by Nominal,Lambda,Symmetric,.000,.000,NaN,NaN +,,x Dependent,.000,.000,NaN,NaN +,,y Dependent,.000,.000,NaN,NaN +,Goodman and Kruskal tau,x Dependent,.076,,,. @&t@ +,,y Dependent,.108,,,. @&t@ +,Uncertainty Coefficient,Symmetric,.105,.012,,. @&t@ +,,x Dependent,.073,.009,7.890,. @&t@ +,,y Dependent,.184,.019,7.890,. @&t@ +]) +AT_CLEANUP