X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Flanguage%2Fstats%2Ffactor.at;h=d40cd28e92c556159fdeded3730f4d310631620c;hb=refs%2Fbuilds%2F20130918030502%2Fpspp;hp=43825c86962fe2e169edd1ba24bca0b8dcc13285;hpb=e4ef4d0f708651807d91bd92d7ab92c1b5c6d675;p=pspp diff --git a/tests/language/stats/factor.at b/tests/language/stats/factor.at index 43825c8696..d40cd28e92 100644 --- a/tests/language/stats/factor.at +++ b/tests/language/stats/factor.at @@ -1499,6 +1499,22 @@ question21,.732,, question22,.613,, question23,.819,,.345 question24,.695,,.386 + +Table: Rotated Factor Matrix +,Factor,, +,1,2,3 +question13,.771,, +question14,.726,, +question15,.676,, +question16,.591,, +question17,.587,.446, +question18,,.739, +question19,,.727, +question20,,.540, +question21,.402,.533,.321 +question22,,.559, +question23,.449,.377,.668 +question24,.324,.321,.652 ]) AT_CLEANUP @@ -1734,8 +1750,8 @@ 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,.557,11.148,78.764,.557,11.148,78.764,,, +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,,,,,, @@ -1748,6 +1764,160 @@ write,.824,-.155 math,.844,.195 science,.801,.456 socst,.783,-.536 + +Table: Rotated Component Matrix +,Component, +,1,2 +read,.650,.559 +write,.508,.667 +math,.757,.421 +science,.900,.198 +socst,.222,.922 ]) +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,,.26,.00,.00,.10 +,TRAIT2,.26,,.48,.24,.01 +,TRAIT3,.00,.48,,.01,.39 +,TRAIT4,.00,.24,.01,,.10 +,TRAIT5,.10,.01,.39,.10, +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 \ No newline at end of file