X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Ffactor.at;h=9ac08b52c70a3e0d8ee2aefeb0cf334c3fe34988;hb=5ce0aa4323a1caafd709713671bae889e8410057;hp=f1d4b2360b6f798c78b9f67ecfba0ec30e8a204b;hpb=f550aee00a62fe1d8baf62d83cd7efef6cc2ee92;p=pspp diff --git a/tests/language/stats/factor.at b/tests/language/stats/factor.at index f1d4b2360b..9ac08b52c7 100644 --- a/tests/language/stats/factor.at +++ b/tests/language/stats/factor.at @@ -1444,6 +1444,7 @@ missing values factor /variables question13 question14 question15 question16 question17 question18 question19 question20 question21 question22 question23 question24 + /analysis all /print univariate det correlation /format blank(.30) /plot eigen @@ -1731,7 +1732,8 @@ begin data. end data. factor - /variables read write math science socst + /variables read write math science socst + /analysis read write math science socst /extraction pc /plot eigen /criteria mineigen (.557) @@ -1775,4 +1777,291 @@ science,.900,.198 socst,.222,.922 ]) -AT_CLEANUP \ No newline at end of file +AT_CLEANUP + + + +AT_SETUP([FACTOR empty dataset]) +dnl Test that something sane happens when the dataset contains no complete observations + +AT_DATA([factor-empty.sps], + [data list notable list /x * y * z *. +begin data. +3.4 . 92.9 +. 32.09 34.2 +1.00 19.80 . +2.00 . 3.6 +end data. + +factor /variables = ALL. +]) + +AT_CHECK([pspp -O format=csv factor-empty.sps], [0], [ignore]) +AT_CLEANUP + + +dnl Fixes a crash reported at +dnl http://lists.gnu.org/archive/html/bug-gnu-pspp/2012-04/msg00001.html +AT_SETUP([FACTOR /ROTATION=NOROTATE]) +AT_DATA([factor-norotate.sps], [dnl +DATA LIST FREE / TRAIT1 TO TRAIT5 (F8.2). +BEGIN DATA +1 5 5 1 1 +8 9 7 9 8 +9 8 9 9 8 +9 9 9 9 9 +1 9 1 1 9 +9 7 7 9 9 +9 7 9 9 7 +END DATA + +FACTOR /VARIABLES=TRAIT1 TO TRAIT5 + /ROTATION=NOROTATE /* NOROTATE may have caused the problem. */ + /EXTRACTION=PC + /PRINT=DEFAULT DET UNIVARIATE ROTATION SIG CORRELATION. +]) + +AT_CHECK([pspp -O format=csv factor-norotate.sps], [0], [dnl +Table: Descriptive Statistics +,Mean,Std. Deviation,Analysis N +TRAIT1,6.57,3.54,7 +TRAIT2,7.71,1.39,7 +TRAIT3,6.71,2.71,7 +TRAIT4,6.71,3.61,7 +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 +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,,,,, + +Table: Communalities +,Initial,Extraction +TRAIT1,1.00,1.00 +TRAIT2,1.00,1.00 +TRAIT3,1.00,.99 +TRAIT4,1.00,.99 +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,,, + +Table: Component Matrix +,Component,,, +,1,2,3,4 +TRAIT1,.97,.23,-.08,.00 +TRAIT2,.52,-.81,.28,.00 +TRAIT3,.78,.59,.17,.00 +TRAIT4,.97,.21,-.04,.00 +TRAIT5,.70,-.67,-.23,.00 +]) +AT_CLEANUP + + + +dnl Fixes a bug in the way that the /CRITERIA = ITERATE option was interpreted. +dnl http://lists.gnu.org/archive/html/bug-gnu-pspp/2013-09/msg00036.html +AT_SETUP([FACTOR /CRITERIA=ITERATE]) +AT_DATA([factor-iterate.sps], [dnl +set format = F20.3. +data list notable list /x y z *. +begin data. +1.00 5.00 3.00 +2.00 2.00 2.00 +3.00 1.00 1.00 +4.00 4.00 5.00 +5.00 3.00 9.00 +6.00 6.00 4.00 +7.00 7.00 6.00 +8.00 8.00 8.00 +9.00 9.00 7.00 +end data. + +FACTOR + /VARIABLES= x y z + /CRITERIA = MINEIGEN (1) ITERATE (25) + /EXTRACTION =PAF + /METHOD = CORRELATION + /PRINT = INITIAL EXTRACTION + /CRITERIA = ITERATE (0) + /ROTATION = NOROTATE. +]) + +AT_CHECK([pspp -O format=csv factor-iterate.sps], [0], [dnl +Table: Communalities +,Initial,Extraction +x,.735,.979 +y,.640,.653 +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,,, + +Table: Factor Matrix +,Factor +,1 +x,.990 +y,.808 +z,.723 +]) +AT_CLEANUP + + +AT_SETUP([FACTOR promax]) +AT_DATA([factor-promax.sps], [dnl +set decimal=dot. +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 + /method correlation + /rotation promax (5). +]) + +AT_CHECK([ln -s $top_srcdir/tests/language/stats/llz.zsav .], [0], [ignore]) + +AT_CHECK([pspp -O format=csv factor-promax.sps], [0], [dnl +Table: Communalities +,Initial,Extraction +PZ,.191,.375 +PN,.042,.102 +PS,.458,.623 +NZ,.100,.163 +NN,.065,.079 +NS,.129,.148 +TZ,.181,.344 +TN,.102,.142 +TS,.310,.372 +OZ,.097,.158 +ON,.323,.410 +OS,.469,.617 +SZ,.104,.170 +SN,.154,.267 +SS,.081,.180 +ZZ,.123,.192 +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,,,, + +Table: Factor Matrix +,Factor,,, +,1,2,3,4 +PZ,-.276,.154,.510,.124 +PN,.096,.129,-.091,.261 +PS,.746,-.085,.234,.063 +NZ,-.111,.323,.206,-.058 +NN,.007,.260,-.083,-.069 +NS,.366,.096,.046,.051 +TZ,-.228,.172,.509,.059 +TN,.131,.345,-.074,.029 +TS,.601,-.005,.098,.030 +OZ,-.145,.166,.322,-.081 +ON,.607,.082,.073,-.173 +OS,.757,-.059,.171,-.104 +SZ,-.142,.307,.226,-.066 +SN,.175,.436,-.183,.115 +SS,.199,.206,-.083,.302 +ZZ,-.074,.411,-.080,-.104 +ZN,.015,.580,-.252,-.114 +ZS,.365,.156,-.004,.015 + +Table: Pattern Matrix +,Factor,,, +,1,2,3,4 +PZ,-.063,-.126,.599,.085 +PN,-.035,.000,-.033,.325 +PS,.762,-.175,.058,.081 +NZ,.027,.230,.327,-.044 +NN,.008,.289,.008,-.026 +NS,.344,.044,.015,.091 +TZ,.004,-.074,.589,.020 +TN,.097,.307,.033,.103 +TS,.585,-.043,-.017,.062 +OZ,.046,.067,.382,-.109 +ON,.654,.151,-.029,-.145 +OS,.803,-.037,-.009,-.092 +SZ,.009,.213,.345,-.060 +SN,.065,.376,-.036,.227 +SS,.054,.042,-.013,.388 +ZZ,-.044,.434,.078,-.046 +ZN,-.025,.646,-.041,-.006 +ZS,.337,.133,-.013,.067 + +Table: Structure Matrix +,Factor,,, +,1,2,3,4 +PZ,-.177,-.058,.598,-.022 +PN,.068,.110,-.049,.317 +PS,.771,-.138,-.136,.240 +NZ,-.060,.236,.339,.019 +NN,.000,.281,.027,.076 +NS,.368,.080,-.068,.207 +TZ,-.127,-.028,.582,-.049 +TN,.122,.345,.023,.235 +TS,.607,-.018,-.160,.221 +OZ,-.074,.055,.384,-.101 +ON,.619,.104,-.160,.102 +OS,.778,-.064,-.190,.132 +SZ,-.086,.215,.361,-.009 +SN,.143,.453,-.044,.380 +SS,.171,.176,-.052,.420 +ZZ,-.073,.422,.120,.085 +ZN,-.013,.641,.008,.214 +ZS,.361,.158,-.088,.213 + +Table: Factor Correlation Matrix +Factor,1,2,3,4 +1,1.000,.008,-.232,.294 +2,.008,1.000,.065,.347 +3,-.232,.065,1.000,-.076 +4,.294,.347,-.076,1.000 +]) + + +AT_CLEANUP