X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Ffactor.at;h=c066dae52b14ea580ad79b1174295679f112a45b;hb=a306948c079462223c692225141b92a76801df03;hp=0b4565632604f5c187f5d82fb13ef362fcfa6572;hpb=d4ff0e074d703dbeb8af5aa3ac470ddda5ebe301;p=pspp diff --git a/tests/language/stats/factor.at b/tests/language/stats/factor.at index 0b45656326..c066dae52b 100644 --- a/tests/language/stats/factor.at +++ b/tests/language/stats/factor.at @@ -1,3 +1,19 @@ +dnl PSPP - a program for statistical analysis. +dnl Copyright (C) 2017 Free Software Foundation, Inc. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl AT_BANNER([FACTOR procedure]) AT_SETUP([FACTOR extraction=paf method=correlation]) @@ -1439,7 +1455,7 @@ begin data. end data. -missing values +missing values question13 question14 question15 question16 question17 question18 question19 question20 question21 question22 question23 question24 (0). factor @@ -1471,7 +1487,7 @@ question24,3.666,.926,1365 Table: Correlation Matrix ,,question13,question14,question15,question16,question17,question18,question19,question20,question21,question22,question23,question24 -Correlations,question13,1.000,.661,.600,.566,.577,.409,.286,.304,.476,.333,.564,.454 +Correlation,question13,1.000,.661,.600,.566,.577,.409,.286,.304,.476,.333,.564,.454 ,question14,.661,1.000,.635,.500,.552,.433,.320,.315,.449,.333,.565,.443 ,question15,.600,.635,1.000,.505,.587,.457,.359,.356,.509,.369,.582,.435 ,question16,.566,.500,.505,1.000,.586,.405,.335,.317,.452,.363,.459,.430 @@ -1483,7 +1499,7 @@ Correlations,question13,1.000,.661,.600,.566,.577,.409,.286,.304,.476,.333,.564, ,question22,.333,.333,.369,.363,.450,.536,.484,.383,.507,1.000,.493,.444 ,question23,.564,.565,.582,.459,.613,.569,.444,.410,.598,.493,1.000,.705 ,question24,.454,.443,.435,.430,.521,.474,.374,.357,.500,.444,.705,1.000 -Determinant,.002,,,,,,,,,,,, +Caption: Determinant: 0.00 Table: Factor Matrix ,Factor,, @@ -1500,7 +1516,7 @@ question21,.732,, question22,.613,, question23,.819,,.345 question24,.695,,.386 - + Table: Rotated Factor Matrix ,Factor,, ,1,2,3 @@ -1521,7 +1537,7 @@ question24,.324,.321,.652 AT_CLEANUP AT_SETUP([FACTOR extraction=pc method=correlation]) -dnl This example is from http://www.ats.ucla.edu/stat/spss/whatstat/whatstat.htm +dnl This example is from http://www.ats.ucla.edu/stat/spss/whatstat/whatstat.htm AT_DATA([factor2.sps], [set format = F11.3. @@ -1751,12 +1767,12 @@ socst,1.000,.900 Table: Total Variance Explained ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,,,Rotation Sums of Squared Loadings,, -Component,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % -1,3.381,67.616,67.616,3.381,67.616,67.616,2.113,42.267,42.267 -2,.557,11.148,78.764,.557,11.148,78.764,1.825,36.497,78.764 -3,.407,8.136,86.900,,,,,, -4,.356,7.123,94.023,,,,,, -5,.299,5.977,100.000,,,,,, +,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % +1,3.381,67.6%,67.6%,3.381,67.6%,67.6%,2.113,42.3%,42.3% +2,.557,11.1%,78.8%,.557,11.1%,78.8%,1.825,36.5%,78.8% +3,.407,8.1%,86.9%,,,,,, +4,.356,7.1%,94.0%,,,,,, +5,.299,6.0%,100.0%,,,,,, Table: Component Matrix ,Component, @@ -1815,6 +1831,7 @@ BEGIN DATA 9 7 9 9 7 END DATA +SET SMALL=0. FACTOR /VARIABLES=TRAIT1 TO TRAIT5 /ROTATION=NOROTATE /* NOROTATE may have caused the problem. */ /EXTRACTION=PC @@ -1832,17 +1849,17 @@ TRAIT5,7.29,2.66,7 Table: Correlation Matrix ,,TRAIT1,TRAIT2,TRAIT3,TRAIT4,TRAIT5 -Correlations,TRAIT1,1.00,.30,.88,1.00,.54 -,TRAIT2,.30,1.00,-.02,.33,.84 -,TRAIT3,.88,-.02,1.00,.87,.13 -,TRAIT4,1.00,.33,.87,1.00,.54 -,TRAIT5,.54,.84,.13,.54,1.00 +Correlation,TRAIT1,1.000,.296,.881,.995,.545 +,TRAIT2,.296,1.000,-.022,.326,.837 +,TRAIT3,.881,-.022,1.000,.867,.130 +,TRAIT4,.995,.326,.867,1.000,.544 +,TRAIT5,.545,.837,.130,.544,1.000 Sig. (1-tailed),TRAIT1,,.260,.004,.000,.103 ,TRAIT2,.260,,.482,.238,.009 ,TRAIT3,.004,.482,,.006,.390 ,TRAIT4,.000,.238,.006,,.103 ,TRAIT5,.103,.009,.390,.103, -Determinant,.00,,,,, +Caption: Determinant: 0.00 Table: Communalities ,Initial,Extraction @@ -1854,12 +1871,12 @@ TRAIT5,1.00,.99 Table: Total Variance Explained ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,, -Component,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % -1,3.26,65.26,65.26,3.26,65.26,65.26 -2,1.54,30.77,96.03,1.54,30.77,96.03 -3,.17,3.36,99.39,.17,3.36,99.39 -4,.03,.61,100.00,.03,.61,100.00 -5,.00,.00,100.00,,, +,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % +1,3.26,65.3%,65.3%,3.26,65.3%,65.3% +2,1.54,30.8%,96.0%,1.54,30.8%,96.0% +3,.17,3.4%,99.4%,.17,3.4%,99.4% +4,.03,.6%,100.0%,.03,.6%,100.0% +5,.00,.0%,100.0%,,, Table: Component Matrix ,Component,,, @@ -1911,10 +1928,10 @@ z,.514,.523 Table: Total Variance Explained ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,, -Factor,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % -1,2.404,80.124,80.124,2.155,71.847,71.847 -2,.425,14.166,94.290,,, -3,.171,5.710,100.000,,, +,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % +1,2.404,80.1%,80.1%,2.155,71.8%,71.8% +2,.425,14.2%,94.3%,,, +3,.171,5.7%,100.0%,,, Table: Factor Matrix ,Factor @@ -1933,12 +1950,12 @@ set format=F22.3. get file='llz.zsav'. -factor - /variables pz pn ps nz nn ns tz tn ts oz on os sz sn ss zz zn zs - /missing listwise - /print initial extraction rotation - /criteria mineigen(1) iterate(25) - /extraction paf +factor + /variables pz pn ps nz nn ns tz tn ts oz on os sz sn ss zz zn zs + /missing listwise + /print initial extraction rotation + /criteria mineigen(1) iterate(25) + /extraction paf /method correlation /rotation promax (5). ]) @@ -1968,26 +1985,26 @@ ZN,.208,.412 ZS,.130,.158 Table: Total Variance Explained -,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,,,Rotation Sums of Squared Loadings -Factor,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %,Total -1,2.968,16.491,16.491,2.411,13.393,13.393,2.355 -2,2.026,11.253,27.744,1.271,7.059,20.452,1.209 -3,1.622,9.011,36.756,.948,5.264,25.716,1.231 -4,1.086,6.032,42.788,.283,1.574,27.290,.770 -5,.996,5.533,48.321,,,, -6,.923,5.130,53.451,,,, -7,.873,4.852,58.303,,,, -8,.856,4.756,63.060,,,, -9,.836,4.644,67.703,,,, -10,.816,4.534,72.237,,,, -11,.785,4.359,76.596,,,, -12,.740,4.110,80.706,,,, -13,.713,3.964,84.670,,,, -14,.653,3.626,88.296,,,, -15,.633,3.519,91.815,,,, -16,.604,3.356,95.171,,,, -17,.484,2.687,97.858,,,, -18,.386,2.142,100.000,,,, +,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,,,Rotation Sums of Squared Loadings,, +,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % +1,2.968,16.5%,16.5%,2.411,13.4%,13.4%,. ,. ,. @&t@ +2,2.026,11.3%,27.7%,1.271,7.1%,20.5%,. ,. ,-Infinity +3,1.622,9.0%,36.8%,.948,5.3%,25.7%,. ,. ,-Infinity +4,1.086,6.0%,42.8%,.283,1.6%,27.3%,. ,. ,-Infinity +5,.996,5.5%,48.3%,,,,,, +6,.923,5.1%,53.5%,,,,,, +7,.873,4.9%,58.3%,,,,,, +8,.856,4.8%,63.1%,,,,,, +9,.836,4.6%,67.7%,,,,,, +10,.816,4.5%,72.2%,,,,,, +11,.785,4.4%,76.6%,,,,,, +12,.740,4.1%,80.7%,,,,,, +13,.713,4.0%,84.7%,,,,,, +14,.653,3.6%,88.3%,,,,,, +15,.633,3.5%,91.8%,,,,,, +16,.604,3.4%,95.2%,,,,,, +17,.484,2.7%,97.9%,,,,,, +18,.386,2.1%,100.0%,,,,,, Table: Factor Matrix ,Factor,,, @@ -2079,33 +2096,27 @@ matrix data variables = rowtype_ var01 var02 var03 var04 var05 var06 var07 var08 / format = lower diagonal . begin data -mean 24.3 5.4 69.7 20.1 13.4 2.7 27.9 3.7 -sd 5.7 1.5 23.5 5.8 2.8 4.5 5.4 1.5 -n 92 92 92 92 92 92 92 92 -cov 32.490000 -cov 1.539000 2.250000 -cov -29.469000 -5.992500 552.250000 -cov 11.901600 2.697000 -19.082000 33.640000 -cov 4.309200 0.672000 -7.896000 3.572800 7.840000 -cov 8.464500 1.012500 -17.977500 6.264000 2.646000 20.250000 -cov 15.390000 2.349000 -25.380000 10.022400 1.814400 9.234000 29.160000 -cov 1.453500 0.652500 -1.762500 1.740000 1.134000 1.350000 0.324000 2.250000 +mean 24.3 5.4 69.7 20.1 13.4 2.7 27.9 3.7 +sd 5.7 1.5 23.5 5.8 2.8 4.5 5.4 1.5 +n 92 92 92 92 92 92 92 92 +cov 32.490000 +cov 1.539000 2.250000 +cov -29.469000 -5.992500 552.250000 +cov 11.901600 2.697000 -19.082000 33.640000 +cov 4.309200 0.672000 -7.896000 3.572800 7.840000 +cov 8.464500 1.012500 -17.977500 6.264000 2.646000 20.250000 +cov 15.390000 2.349000 -25.380000 10.022400 1.814400 9.234000 29.160000 +cov 1.453500 0.652500 -1.762500 1.740000 1.134000 1.350000 0.324000 2.250000 end data. factor matrix in (cov = *) / method = covariance - / print = initial covariance kmo + / print = initial covariance / extraction = pc / rotation = norotate. ]) AT_CHECK([pspp -O format=csv covariance-matrix.sps], [0], [dnl -Table: KMO and Bartlett's Test -Kaiser-Meyer-Olkin Measure of Sampling Adequacy,,.741 -Bartlett's Test of Sphericity,Approx. Chi-Square,104.810 -,df,28 -,Sig.,.000 - Table: Covariance Matrix ,var01,var02,var03,var04,var05,var06,var07,var08 var01,32.490,1.539,-29.469,11.902,4.309,8.464,15.390,1.454 @@ -2130,15 +2141,15 @@ var08,2.250 Table: Total Variance Explained ,Initial Eigenvalues,, -Component,Total,% of Variance,Cumulative % -1,556.895,81.881,81.881 -2,57.963,8.522,90.403 -3,23.576,3.466,93.869 -4,16.446,2.418,96.288 -5,14.603,2.147,98.435 -6,6.831,1.004,99.439 -7,2.375,.349,99.788 -8,1.440,.212,100.000 +,Total,% of Variance,Cumulative % +1,556.895,81.9%,81.9% +2,57.963,8.5%,90.4% +3,23.576,3.5%,93.9% +4,16.446,2.4%,96.3% +5,14.603,2.1%,98.4% +6,6.831,1.0%,99.4% +7,2.375,.3%,99.8% +8,1.440,.2%,100.0% Table: Component Matrix ,Component,,,,,, @@ -2171,9 +2182,9 @@ matrix data leesacc_wo_owo_811 leesacc_tekst_811 leesacc_otekst_811 leessne_wo_owo_811 leesvl_tekst_811 leesvl_otekst_811 leessne_wo_811 spel_wo_owo_811 / format = upper diagonal . begin data -mean 64.44 1.74 15.30 11.50 269.03 5.37 441.90 8.57 36.59 33.99 11.68 14.74 18.67 6.70 71.57 2.28 70.45 51.82 18.82 34.57 11.68 45.63 12.94 35.08 92.60 79.28 2.78 61.71 29.44 9.46 13.17 +mean 64.44 1.74 15.30 11.50 269.03 5.37 441.90 8.57 36.59 33.99 11.68 14.74 18.67 6.70 71.57 2.28 70.45 51.82 18.82 34.57 11.68 45.63 12.94 35.08 92.60 79.28 2.78 61.71 29.44 9.46 13.17 sd 74.93 1.36 5.51 4.17 159.26 2.76 128.77 3.50 6.20 6.50 3.55 8.37 5.90 3.01 24.81 4.09 24.44 18.55 2.90 6.46 3.01 14.06 7.69 4.36 7.10 17.57 1.27 25.68 11.75 3.36 4.13 -n 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 +n 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 150 corr 1.00 .784 .397 .862 .692 .625 .490 .374 .406 .371 .260 .257 .306 .118 -.148 .072 .202 .234 .198 .241 .205 -.054 .246 .166 .143 .155 -.122 .144 -.010 .135 .241 corr 1.00 .333 .751 .549 .553 .447 .313 .304 .377 .204 .249 .258 .193 -.158 .119 .150 .216 .127 .209 .242 .046 .233 .120 .155 .107 -.126 .147 -.009 .134 .208 corr 1.00 .469 .433 .381 .442 .307 .462 .391 .378 .293 .369 .191 -.306 .238 .204 .215 .295 .285 .157 .069 .241 .029 .060 .054 -.043 .124 -.069 .054 .136 @@ -2207,8 +2218,8 @@ corr 1.00 .621 corr 1.00 end data . -factor matrix in (cor = *) - / analysis = cdi_actws_16 rdls_actws_16 cdi_actws_20 cdi_actws_26 rdls_actws_26 bnt_actws_36 bnt_actws_56 +factor matrix in (cor = *) + / analysis = cdi_actws_16 rdls_actws_16 cdi_actws_20 cdi_actws_26 rdls_actws_26 bnt_actws_36 bnt_actws_56 / format = default / criteria = factors (1) / extraction = pc @@ -2230,14 +2241,14 @@ bnt_actws_56,1.000,.316 Table: Total Variance Explained ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,, -Component,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % -1,3.914,55.908,55.908,3.914,55.908,55.908 -2,1.320,18.852,74.760,,, -3,.716,10.223,84.983,,, -4,.422,6.030,91.012,,, -5,.278,3.977,94.989,,, -6,.216,3.088,98.077,,, -7,.135,1.923,100.000,,, +,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative % +1,3.914,55.9%,55.9%,3.914,55.9%,55.9% +2,1.320,18.9%,74.8%,,, +3,.716,10.2%,85.0%,,, +4,.422,6.0%,91.0%,,, +5,.278,4.0%,95.0%,,, +6,.216,3.1%,98.1%,,, +7,.135,1.9%,100.0%,,, Table: Component Matrix ,Component @@ -2254,13 +2265,9 @@ bnt_actws_56,.562 AT_CLEANUP - - - - AT_SETUP([FACTOR bad input]) -dnl Test for a crash +dnl Test for a crash AT_DATA([bad-input.sps], [dnl set format = F10.3. MATRIX DATA VARIABLES S1 ROWTYPE_ V1 TO V3 /SPLIT=S1. @@ -2289,3 +2296,107 @@ FACTOR MATRIX IN (CORR =!*) AT_CHECK([pspp -O format=csv bad-input.sps], [1], [ignore]) AT_CLEANUP + + +AT_SETUP([FACTOR anti-image matrix]) + +AT_DATA([anti-image-matrix.sps], [dnl +SET FORMAT=F20.3 . +matrix data + variables = rowtype_ viq piq pa ran piatwr piatc + / n = 476 + / format = lower diagonal . +begin data +mean 96.88 100.51 -1.73 -0.94 -2.52 -1.85 +sd 10.97 11.19 1.19 0.88 0.85 0.97 +corr 1.00 +corr 0.38 1.00 +corr 0.26 0.24 1.00 +corr 0.16 0.17 0.34 1.00 +corr 0.25 0.07 0.46 0.38 1.00 +corr 0.37 0.22 0.39 0.30 0.59 1.00 +end data. + +factor matrix = in (cor = *) + / analysis = viq piq pa ran piatwr piatc + / format = sort + / extraction = pc + / rotation = norotate + / print = aic +]) + +AT_CHECK([pspp -O format=csv anti-image-matrix.sps], [0], [dnl +Table: Anti-Image Matrices +,,viq,piq,pa,ran,piatwr,piatc +Anti-image Covariance,viq,.762,-.248,-.048,.008,-.031,-.143 +,piq,-.248,.807,-.117,-.081,.108,-.071 +,pa,-.048,-.117,.711,-.125,-.173,-.060 +,ran,.008,-.081,-.125,.808,-.143,-.035 +,piatwr,-.031,.108,-.173,-.143,.551,-.265 +,piatc,-.143,-.071,-.060,-.035,-.265,.581 +Anti-image Correlation,viq,.741,-.316,-.066,.011,-.048,-.215 +,piq,-.316,.624,-.154,-.100,.163,-.103 +,pa,-.066,-.154,.811,-.165,-.277,-.093 +,ran,.011,-.100,-.165,.825,-.214,-.051 +,piatwr,-.048,.163,-.277,-.214,.675,-.469 +,piatc,-.215,-.103,-.093,-.051,-.469,.729 + +Table: Component Matrix +,Component,,,, +,1,2,3,4,5 +piatc,.774,.122,-.368,.365,-.322 +piatwr,.754,.418,.442,.219,-.115 +pa,.707,.124,-.117,-.161,.256 +piq,.456,-.733,.122,-.289,-.377 +viq,.589,-.539,.033,.298,.457 +ran,.592,.262,-.069,-.638,.096 +]) + +AT_CLEANUP + + +AT_SETUP([FACTOR Kaiser-Meyer-Olkin]) + +AT_DATA([kmo.sps], [dnl +SET FORMAT=F20.3 . +matrix data + variables = rowtype_ viq piq pa ran piatwr piatc + / n = 476 + / format = lower diagonal . +begin data +mean 96.88 100.51 -1.73 -0.94 -2.52 -1.85 +sd 10.97 11.19 1.19 0.88 0.85 0.97 +corr 1.00 +corr 0.38 1.00 +corr 0.26 0.24 1.00 +corr 0.16 0.17 0.34 1.00 +corr 0.25 0.07 0.46 0.38 1.00 +corr 0.37 0.22 0.39 0.30 0.59 1.00 +end data. + +factor matrix = in (cor = *) + / analysis = viq piq pa ran piatwr piatc + / extraction = pc + / rotation = norotate + / print = kmo +]) + +AT_CHECK([pspp -O format=csv kmo.sps], [0], [dnl +Table: KMO and Bartlett's Test +Kaiser-Meyer-Olkin Measure of Sampling Adequacy,,.730 +Bartlett's Test of Sphericity,Approx. Chi-Square,602.673 +,df,15 +,Sig.,.000 + +Table: Component Matrix +,Component,,,, +,1,2,3,4,5 +viq,.589,-.539,.033,.298,.457 +piq,.456,-.733,.122,-.289,-.377 +pa,.707,.124,-.117,-.161,.256 +ran,.592,.262,-.069,-.638,.096 +piatwr,.754,.418,.442,.219,-.115 +piatc,.774,.122,-.368,.365,-.322 +]) + +AT_CLEANUP