output: Introduce pivot tables.
[pspp] / tests / language / stats / factor.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl 
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl 
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl 
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl
17 AT_BANNER([FACTOR procedure])
18
19 AT_SETUP([FACTOR extraction=paf method=correlation])
20 dnl This example is based on data from http://www.ats.ucla.edu/stat/Spss/output/factor1.htm
21
22 AT_DATA([factor.sps],
23   [set format = F11.3.
24
25 data list notable fixed /question13 to question24 1-12.
26 begin data.
27 555555535543
28 544453434443
29 545555544444
30 444442444433
31 554545554554
32 554455454455
33 555554555244
34 554455544443
35 555554434344
36 544454544344
37 555545555555
38 555454544455
39 555445544455
40 455544443343
41 544454344344
42 555555555455
43 555554454455
44 555555554445
45 555555554555
46 545534553343
47 555555535554
48 555544444445
49 545544334433
50 554555434443
51 555555544454
52 555445545453
53 555554434244
54 444444433233
55 545555454443
56 554443434243
57 444534334333
58 454534444332
59 555455353444
60 555544443243
61 555554543243
62 555544444343
63 445444434443
64 555555555544
65 444444434340
66 455044434334
67 555555533433
68 554554535040
69 434533334232
70 443232444432
71 555555555555
72 555555554544
73 555544444445
74 444224343344
75 444554454355
76 444434332433
77 555555555555
78 043243432433
79 444443334333
80 453443433434
81 443342332232
82 554434434533
83 444344434443
84 444444434443
85 554552434133
86 453334332432
87 444445554444
88 431232332223
89 555555555544
90 544445543443
91 444455535543
92 444444444433
93 444444543243
94 555431443333
95 444443433433
96 444433433443
97 454334444433
98 111111111544
99 444423442433
100 555443333353
101 555543334344
102 055454400000
103 555454444355
104 555555555555
105 055544533333
106 555554555554
107 555555535554
108 555555545355
109 555555555455
110 555544545543
111 555554404455
112 555454435454
113 555555535554
114 555555555555
115 555443433544
116 555554435454
117 555555545344
118 555555535454
119 555445535453
120 444444333544
121 555554434444
122 455454434454
123 555555535555
124 554545534455
125 555555555443
126 454443434444
127 555553334444
128 555554545454
129 555555555555
130 555554554454
131 555555555555
132 544545534544
133 555555534454
134 555555555455
135 555554535544
136 555555535555
137 555451234443
138 555444444544
139 555544434354
140 555545533444
141 555554534443
142 545554434554
143 554433444433
144 544432233524
145 411111111111
146 445423442233
147 555543433344
148 444443342233
149 555555534455
150 545442434223
151 554553352333
152 544554554445
153 555555435455
154 444334304234
155 455453444434
156 444443443245
157 555552232132
158 555434324345
159 544444434344
160 534344344444
161 445555555344
162 444343442132
163 444444434344
164 444444554334
165 444545444333
166 434442343224
167 443443433233
168 555551555554
169 544544434444
170 454544434433
171 555555535434
172 555555555555
173 455544444444
174 454444434233
175 555555544344
176 454445544445
177 444444554434
178 555455455443
179 555454425444
180 444454434443
181 544443433233
182 444543434433
183 555553545354
184 544444444433
185 444445434433
186 555533353333
187 555434234333
188 444314222411
189 555555555555
190 455545534443
191 455045534433
192 555545444444
193 455544243543
194 444421113343
195 554444534444
196 555555544554
197 555334434452
198 555544543455
199 555554434554
200 555445554454
201 555555545344
202 555555555555
203 554543334245
204 554441233333
205 555554334545
206 555555535544
207 555555554554
208 555445444543
209 444424544432
210 444425544333
211 555434344443
212 555533233223
213 544433442343
214 555555555555
215 555445452234
216 555444555444
217 555444544455
218 555544354554
219 545445555555
220 555555555555
221 455443342232
222 555555544454
223 455534443455
224 555555555055
225 444554333244
226 444445434543
227 555554544455
228 444443444434
229 444444434445
230 334231314323
231 444444434433
232 555554444443
233 444444434443
234 555455434444
235 444444444444
236 555455435455
237 444444434344
238 444543433232
239 544443334454
240 555544433244
241 534443324224
242 555555544444
243 444443434444
244 555553444344
245 443434443333
246 444444434333
247 554445444343
248 444443344434
249 445555544543
250 555554443443
251 322232403322
252 444444444433
253 444445444443
254 444454534445
255 544344444344
256 554445534544
257 555555555554
258 555544432333
259 444444444443
260 555555555554
261 455555555554
262 555555555543
263 555555555544
264 555554445555
265 444335544455
266 555555555555
267 555454444454
268 555455544454
269 444445444444
270 555555555555
271 555455454554
272 555454544554
273 555555555455
274 555555554444
275 444444544434
276 334334443333
277 422224222211
278 121512011111
279 443444432332
280 434335533344
281 444443543433
282 554454443453
283 555555545454
284 555555555344
285 555555555554
286 555555334555
287 454445554444
288 454545534444
289 555554555444
290 455444534455
291 555544554544
292 444444444444
293 555424423133
294 222433443224
295 544544532344
296 545554544544
297 555532544144
298 444432343433
299 434545554545
300 444344505443
301 555555555544
302 555554555344
303 444531113112
304 555554333133
305 455433233233
306 354354434345
307 454534433433
308 433112332321
309 555445433333
310 454343434143
311 555554445555
312 455423334322
313 443333332222
314 444443444443
315 553432224134
316 444223432233
317 454324425444
318 344434514443
319 555552415255
320 354332543353
321 444531333233
322 443433334133
323 444444444433
324 444444445533
325 445133212223
326 343433432213
327 442333333332
328 345455535244
329 443211121122
330 555445444444
331 555555544344
332 453243332232
333 443543422533
334 554444434344
335 554444333444
336 555555335343
337 444231121133
338 454433332233
339 455524434244
340 554433224354
341 555455555444
342 454444424444
343 554242232134
344 555553315443
345 555553333454
346 455421434211
347 111111151111
348 454443203123
349 454243334132
350 355332213144
351 554534334134
352 555543434355
353 555543433255
354 444441223334
355 555443143255
356 444444444454
357 444442323544
358 454443434343
359 445453434444
360 454455554433
361 554532342234
362 444442243233
363 444442343334
364 555443433444
365 555543253444
366 554554444455
367 555543355344
368 555444445444
369 434443204222
370 444432444234
371 222142441111
372 111111141111
373 334334454433
374 555354552543
375 433411122112
376 455534504444
377 543211224233
378 344333332532
379 344443233333
380 444424432434
381 555555544454
382 555555554544
383 555444444444
384 555443533443
385 555554544344
386 555554444444
387 544543433343
388 444445434444
389 555555555555
390 555443333233
391 545444534454
392 555454434343
393 555453434544
394 544334444333
395 555443443444
396 555555534544
397 444444444433
398 555543433343
399 555444445334
400 555543442433
401 455444334443
402 554443434443
403 555254500544
404 555444433344
405 555555535544
406 444443532232
407 544443433433
408 555555535544
409 555455454444
410 555455445544
411 544444534433
412 555555555554
413 555553533444
414 555555555554
415 555554434343
416 555455544443
417 555554444443
418 555454444445
419 333222333223
420 444443544233
421 543443534433
422 555545454533
423 444444404033
424 455454504543
425 455555555454
426 454443344343
427 555553435244
428 555543544444
429 555553343044
430 444443444433
431 445543434434
432 555554433545
433 555554455445
434 455553333234
435 555552344243
436 444141212213
437 444443504234
438 445544253444
439 555554354555
440 534552234543
441 555554544544
442 444233404224
443 555554534444
444 444443444344
445 422442434324
446 554434434344
447 444444434334
448 443433432444
449 555454435344
450 252423332214
451 454544434434
452 444444444244
453 555554544445
454 443222432333
455 555544444332
456 545555543445
457 554544334444
458 555445555544
459 554343434433
460 555555535554
461 444554444333
462 553544343534
463 555553254433
464 555555554554
465 544443443344
466 555443444344
467 544432144123
468 555555555555
469 555555555354
470 555555535545
471 455454434444
472 455455534445
473 455555554455
474 555553545445
475 445545544444
476 545345553555
477 444445444433
478 443435433433
479 555554545353
480 444443232223
481 444444434433
482 555555545454
483 555554444343
484 555554444443
485 434544333422
486 444443434343
487 555555455443
488 555544434343
489 455545534444
490 555555555553
491 444443343434
492 555555555445
493 433444444434
494 344221512132
495 333421132223
496 333444443444
497 435544545533
498 444335544443
499 333323223323
500 334434332333
501 444422323213
502 324433443423
503 555555554555
504 555452424444
505 555544434444
506 555544443343
507 555445545453
508 555555344453
509 555544545550
510 454443434334
511 444332233344
512 555554332344
513 554444433444
514 555554555554
515 555555543544
516 444442443132
517 555555545555
518 544553435533
519 044044444444
520 444443434533
521 555454433434
522 555555555454
523 555555555555
524 454544434444
525 444444434333
526 554555455554
527 555555543444
528 423331124132
529 445445534455
530 555555555554
531 444535554434
532 555555555554
533 354443422232
534 555545535443
535 555555555555
536 555455444453
537 455434443333
538 455444443233
539 343322434411
540 555555555534
541 453442432333
542 445554434544
543 345444443333
544 454554554355
545 444434453434
546 555555454443
547 555443343341
548 545553343433
549 222343222201
550 444433434443
551 535555555544
552 552541442423
553 545433343334
554 455445433443
555 444444433433
556 455543343433
557 434444432333
558 444545444444
559 555554534444
560 452444434433
561 454443432533
562 555453334433
563 444442233432
564 555555553433
565 545555545445
566 335543222333
567 554554344445
568 243424442212
569 133222432411
570 343434534233
571 222222212211
572 445455554434
573 455554453344
574 223334424434
575 555355555544
576 455544554434
577 544455555444
578 444444444444
579 444444444344
580 444334444444
581 444444444434
582 555455534243
583 555555545555
584 555555555555
585 444443534343
586 555554544444
587 555555555454
588 444434433433
589 455445544444
590 555544544455
591 444333433333
592 455443445343
593 444432442444
594 443334451543
595 555554455555
596 555444444444
597 555555555455
598 555555555554
599 555454345154
600 555555555555
601 555555555455
602 555554454544
603 454444454544
604 554443334544
605 455555402535
606 555554531534
607 455545544554
608 444423444223
609 555444334533
610 455554445243
611 453444334344
612 555555555554
613 555555555455
614 555555555554
615 455443334344
616 555555253555
617 555554433454
618 555444344455
619 550030034433
620 555444233343
621 555343222133
622 555555555554
623 555555243243
624 555555555355
625 555554345555
626 555443434454
627 545543133133
628 555443334154
629 444444344454
630 555555242254
631 555554444344
632 545443334454
633 554444132454
634 555455143154
635 555554453044
636 555555555455
637 555534335454
638 555555245555
639 545543333444
640 555555355454
641 555353145133
642 555553043454
643 555555354554
644 555543434454
645 555444324454
646 444444203443
647 555552233355
648 555555445455
649 555500034354
650 555354354444
651 555555555555
652 555543334144
653 555555005254
654 454444344254
655 555555555554
656 555555555255
657 555555555455
658 444444242243
659 555554445154
660 444444234333
661 555555553455
662 444422224243
663 555545443344
664 545552133143
665 555455044344
666 555555455555
667 555555545454
668 454433343144
669 555555555555
670 555455255155
671 555555454455
672 555555424455
673 555555355555
674 555444444455
675 555555454455
676 544411211314
677 223322441123
678 444223434233
679 444441121232
680 555555535555
681 454445533444
682 434442434433
683 545355554454
684 555542544333
685 445545555444
686 321000001011
687 444444444444
688 333223321322
689 444232433233
690 425432523122
691 455555555544
692 555555545555
693 555555534354
694 554554444243
695 555554343443
696 444443434333
697 555224252443
698 555544433433
699 344544434423
700 555554434344
701 555542134233
702 444344434444
703 445443433233
704 455343333434
705 455443333445
706 355344434433
707 234234433333
708 445444444445
709 455535535545
710 443423234443
711 455544334544
712 345441333323
713 445444533433
714 455554443355
715 445444433243
716 455454453444
717 444244444444
718 554244544154
719 555555555555
720 454343444444
721 555444444344
722 545455534454
723 555555555555
724 555554534454
725 555254555444
726 544354544453
727 553454534445
728 555454445355
729 545253554454
730 433342322233
731 544444444443
732 555455445544
733 424322433233
734 444424222233
735 555355555544
736 000000000000
737 555455345344
738 000055505450
739 434333444333
740 444445444444
741 555555555545
742 555554455545
743 555455435533
744 544544444243
745 444331232323
746 555555554444
747 443332323233
748 444224342433
749 555555555544
750 433443342333
751 555445504554
752 555545555544
753 555555535555
754 555555535345
755 454443433333
756 555444444555
757 444443232435
758 555433444443
759 555443434543
760 555555535555
761 555555533544
762 555543234444
763 433432332221
764 443433544233
765 443443333334
766 444424433444
767 552444333123
768 233332232211
769 223422221122
770 434433414133
771 332323333102
772 552544223222
773 542423343232
774 555552534132
775 455554544134
776 433523533132
777 433333433433
778 435434543333
779 434553433444
780 555544434345
781 443543443433
782 555555542344
783 544444553144
784 555544544243
785 535443441342
786 344555444333
787 444444443333
788 443443433432
789 545554534544
790 443533433433
791 333443432223
792 333333433123
793 322432122213
794 555555555555
795 554555444433
796 444543443234
797 444444433433
798 452555534433
799 244444444233
800 433442422232
801 555555535555
802 555555554455
803 555554545244
804 555555355455
805 555555555555
806 555555555555
807 444433323233
808 555455455455
809 434445444433
810 555554444455
811 454444543445
812 555555535455
813 555545554455
814 555555555555
815 555555555555
816 555443344353
817 455543304132
818 444443444433
819 555555555355
820 434433443333
821 444434444433
822 444444444433
823 555555555555
824 445553443323
825 445444444444
826 555554444054
827 455555554543
828 555555535555
829 555554445454
830 555444444443
831 555555555454
832 555554344455
833 555555454454
834 554444444454
835 555555555353
836 555545544454
837 553545332223
838 444424444332
839 545555543433
840 555444433444
841 555555444445
842 444444424433
843 444444543434
844 124113531311
845 555554534543
846 555343333333
847 545444544344
848 555444534444
849 555544543444
850 555455544443
851 444324402121
852 555554534544
853 555455544444
854 555555544454
855 444334404433
856 555443534444
857 555545554444
858 555555555555
859 455333233433
860 455444433433
861 455444444444
862 444235442443
863 555443343433
864 444445453444
865 454345453432
866 555555453444
867 344433322323
868 444443444244
869 444442343133
870 554445432233
871 555555544444
872 555555534444
873 555554455554
874 454443334244
875 544443333233
876 444445534445
877 444432134121
878 555555332243
879 555555544433
880 555554434444
881 454543534233
882 454432432343
883 444424432433
884 545553335344
885 555443434344
886 454443433333
887 555553534444
888 554544434355
889 552532421235
890 454543433434
891 544544343234
892 555552334125
893 555543455555
894 443442334222
895 554443444344
896 555554543334
897 555552342444
898 554443433333
899 443444434445
900 555554533344
901 442412242121
902 454543343244
903 445554433344
904 444443333433
905 444443433333
906 444433333334
907 444444334444
908 432321102223
909 444444434443
910 444444434343
911 454531432331
912 445543433434
913 554554434554
914 334253232333
915 444443434244
916 444433443234
917 444433334334
918 444443433333
919 553434303222
920 454443434244
921 444445544444
922 443441133433
923 444432232133
924 444444404344
925 444444333243
926 455543124243
927 555544532344
928 444432333132
929 554553434244
930 454443443333
931 433111121111
932 555555555544
933 444432433222
934 444443433233
935 443332332133
936 445344453243
937 444444405434
938 554554434343
939 455344534443
940 444444400434
941 444444344344
942 544554533443
943 555554443455
944 555555544544
945 555554534444
946 323123232311
947 444344344443
948 555554555544
949 343323332333
950 444443434444
951 444442214340
952 555434434444
953 455543343444
954 445432434433
955 455553434455
956 243321332322
957 444422332332
958 555533454444
959 555544443433
960 354422431422
961 333322421211
962 444443432434
963 344422431322
964 333342222321
965 444443454433
966 443443444433
967 553434531334
968 554434552343
969 545455553544
970 554455554443
971 555555555533
972 555555554543
973 454454544433
974 555444532143
975 554545544443
976 444233442434
977 544444434234
978 554344432233
979 555345533355
980 554554544433
981 455444444344
982 555554554554
983 555554545555
984 444433534434
985 444444421134
986 334333333333
987 334443443343
988 122333441413
989 434444333333
990 444344433233
991 444333332143
992 555154344133
993 324344333223
994 244444402233
995 454443433543
996 444344433344
997 455555445555
998 555555544433
999 454544434443
1000 344535554533
1001 333435443433
1002 444444554544
1003 343434443333
1004 544553544455
1005 555444444455
1006 244333332222
1007 333441232233
1008 544433433433
1009 555544343344
1010 344211142124
1011 442442232113
1012 433432332223
1013 333424322222
1014 444443333233
1015 344321232223
1016 442434342422
1017 545555535555
1018 455454434454
1019 455355544444
1020 454444444445
1021 555554432430
1022 555444344144
1023 455534342234
1024 555555554354
1025 213332443111
1026 555545434433
1027 555554424444
1028 443434443433
1029 555555554443
1030 555555555544
1031 435535554433
1032 555455545443
1033 555555554533
1034 554545443455
1035 555553333233
1036 434432232323
1037 443443333433
1038 443544231534
1039 434533334334
1040 555555535544
1041 555544444445
1042 555555555555
1043 555555555555
1044 555555555555
1045 555555555555
1046 544555544544
1047 555555545555
1048 545555534354
1049 445444344344
1050 555555555555
1051 444443343334
1052 555444440000
1053 555555555554
1054 555555545455
1055 454434444345
1056 555445544443
1057 555554535433
1058 454445555555
1059 555444444355
1060 555555555555
1061 555555555555
1062 555555555555
1063 555555554555
1064 555455554455
1065 454435544255
1066 545543342243
1067 555544355345
1068 555555455354
1069 435553244333
1070 555555443454
1071 444444433445
1072 121422433111
1073 555554543244
1074 555444554444
1075 444203444433
1076 344342553322
1077 554445554344
1078 545445454454
1079 444245504233
1080 334335555533
1081 554355544444
1082 444445545444
1083 555555555344
1084 454544543233
1085 444455532434
1086 555544354243
1087 535444554433
1088 444444444444
1089 455555553243
1090 244442343235
1091 554544504043
1092 444435553433
1093 455553434354
1094 555444343314
1095 555553344453
1096 555555555544
1097 544444444433
1098 434434550033
1099 555455544444
1100 455445534344
1101 454445444554
1102 555555555555
1103 555555555555
1104 555555555454
1105 555455545412
1106 334433343132
1107 555454455455
1108 555554454443
1109 555555555555
1110 555555553433
1111 555555555555
1112 555555445555
1113 555545445455
1114 555555545554
1115 555555555555
1116 445455554443
1117 555445554433
1118 555555554445
1119 555553333144
1120 555554455143
1121 554454445444
1122 555555554533
1123 334422433422
1124 555554434444
1125 433531133222
1126 443432342224
1127 555544554433
1128 553434333333
1129 555543334443
1130 444443344323
1131 555555555555
1132 555554545344
1133 555555545554
1134 555342434333
1135 444443333233
1136 444544435444
1137 555555555555
1138 555455554354
1139 555555405054
1140 555555555555
1141 554555545545
1142 555555555544
1143 555545454344
1144 555555455555
1145 433444444343
1146 454555554444
1147 453555554544
1148 444445554444
1149 544455555455
1150 555343434343
1151 555553444454
1152 555444434443
1153 555555555444
1154 555555545443
1155 555444534455
1156 555555555555
1157 444443443434
1158 555445533543
1159 555555555444
1160 555544444354
1161 445444544243
1162 555554555455
1163 555555455444
1164 555555555544
1165 555555555454
1166 554445545454
1167 555555555543
1168 344444434443
1169 555555454453
1170 455444443433
1171 344244434433
1172 355234452132
1173 555445545455
1174 444444444444
1175 455444454433
1176 555555555555
1177 344233341155
1178 333334433233
1179 444433434333
1180 444233443334
1181 454344544444
1182 555554245253
1183 444444333344
1184 554544434333
1185 555444443343
1186 555554555445
1187 005555555544
1188 554444445244
1189 555455555555
1190 555555555444
1191 444444444433
1192 555555555444
1193 555555544454
1194 555555555544
1195 444444434444
1196 555555535553
1197 545534543334
1198 554554534533
1199 555555555554
1200 554554544544
1201 454541231221
1202 555555535544
1203 445344334432
1204 444444344333
1205 555555534444
1206 555555545555
1207 443434544232
1208 545544433343
1209 343234434333
1210 444444443233
1211 555454444455
1212 555455535455
1213 554433442243
1214 444444544454
1215 554545554544
1216 454444444444
1217 554455534455
1218 555555544355
1219 555445555555
1220 555444534444
1221 455454534444
1222 555555555544
1223 444444444455
1224 454455554344
1225 443244442233
1226 350554554434
1227 455444535343
1228 344233443433
1229 454444535545
1230 244222232232
1231 245345554344
1232 355344444443
1233 555455555444
1234 444434444233
1235 334323444322
1236 333234443233
1237 455455554454
1238 555554544434
1239 555355555444
1240 444444544443
1241 555554555544
1242 344231224131
1243 444443434433
1244 454344444431
1245 555554555553
1246 454544444443
1247 444443443532
1248 334323423222
1249 455555545554
1250 555542434443
1251 554444444443
1252 554444534344
1253 555443454555
1254 555555534554
1255 444434443343
1256 444234432233
1257 334323311333
1258 444443443233
1259 355424552242
1260 233335323322
1261 234233443333
1262 123353532334
1263 444345555244
1264 332222433422
1265 545445555443
1266 555555555555
1267 555554444443
1268 455445554455
1269 455455555455
1270 555555555555
1271 444443433445
1272 555455555544
1273 355453434232
1274 555555554344
1275 444433433433
1276 434322242112
1277 444444433433
1278 444445444544
1279 555444535444
1280 544444444443
1281 454544344334
1282 454444334333
1283 434433433332
1284 334434423423
1285 444455552233
1286 442442342233
1287 445433433343
1288 555555444355
1289 555555555555
1290 455554555545
1291 555445544444
1292 544444434443
1293 555555535333
1294 554444444344
1295 555554554445
1296 345433334121
1297 555555555554
1298 545444444233
1299 555555544455
1300 555554545555
1301 555555455555
1302 555555545555
1303 555554544455
1304 444444444333
1305 544544544445
1306 555445544544
1307 555455444455
1308 555455555454
1309 554455535444
1310 453423442244
1311 444443444444
1312 454444333333
1313 555555555542
1314 555555555543
1315 555555555544
1316 555555535534
1317 555555555444
1318 444443423333
1319 555444444444
1320 555445544453
1321 444444444443
1322 555555443444
1323 444443444333
1324 554554154344
1325 555543353333
1326 554445443333
1327 555555553455
1328 554534444243
1329 554555554545
1330 555544443443
1331 555554555555
1332 555425552422
1333 555555555555
1334 454421121321
1335 555454453433
1336 555555554443
1337 244224431223
1338 455444453444
1339 454345544455
1340 344235545044
1341 555555555544
1342 555553325554
1343 554554444244
1344 555545544544
1345 454555554545
1346 444444545444
1347 545544444455
1348 454344445443
1349 545555554453
1350 444444444443
1351 545554554453
1352 555453434444
1353 005434434454
1354 455555455544
1355 555555555554
1356 455542444433
1357 545543444555
1358 445545445444
1359 555553325454
1360 555554555554
1361 444544444443
1362 555555444454
1363 443332443222
1364 454444443444
1365 344333433332
1366 555455444455
1367 555555555445
1368 555555534454
1369 445433432343
1370 555554434444
1371 555555545444
1372 544545434455
1373 454435543444
1374 555555555555
1375 555455554555
1376 555555544554
1377 555553554455
1378 555555555555
1379 545454545444
1380 555555445555
1381 554534343444
1382 555545443343
1383 545454334444
1384 554445544544
1385 555455354344
1386 555555555355
1387 554445544354
1388 455554444444
1389 555555553543
1390 555554444444
1391 555543233444
1392 555554344433
1393 333334441223
1394 543554344434
1395 055541243244
1396 555555555544
1397 555555533444
1398 555445444544
1399 444335343433
1400 544434344333
1401 544435533333
1402 444444443333
1403 555555555554
1404 555552343233
1405 444444444433
1406 544444434444
1407 555555545555
1408 555555555554
1409 445244434444
1410 445444434444
1411 445555554521
1412 443444543343
1413 444433343434
1414 355444433442
1415 555543444455
1416 555444334544
1417 555555555555
1418 554555545555
1419 555555554555
1420 555555555555
1421 454444343445
1422 444444433444
1423 354445443444
1424 555334242132
1425 455445555543
1426 254153343433
1427 354244443333
1428 554455444344
1429 343255535444
1430 455454555553
1431 555455545555
1432 444343433343
1433 343323443323
1434 455444444424
1435 555544444455
1436 343434543444
1437 555555555544
1438 555554534243
1439 555554543344
1440 555455555544
1441 555443344343
1442 444445533133
1443 555543534555
1444 444554444444
1445 444002323320
1446 444232322222
1447 244344424441
1448 555443344334
1449 555555555555
1450 555444534443
1451 555555555555
1452 555555555550
1453 455555554555
1454 555555555555
1455
1456 end data.
1457
1458 missing values 
1459         question13 question14 question15 question16 question17 question18 question19 question20 question21 question22 question23 question24 (0).
1460
1461 factor
1462  /variables question13 question14 question15 question16 question17 question18 question19 question20 question21 question22 question23 question24
1463  /analysis all
1464  /print univariate det correlation
1465  /format blank(.30)
1466  /plot eigen
1467  /criteria factors(3)
1468  /extraction paf
1469  /method = correlation.
1470 ])
1471
1472 AT_CHECK([pspp -O format=csv factor.sps], [0],
1473   [Table: Descriptive Statistics
1474 ,Mean,Std. Deviation,Analysis N
1475 question13,4.462,.729,1365
1476 question14,4.525,.700,1365
1477 question15,4.445,.732,1365
1478 question16,4.281,.829,1365
1479 question17,4.166,.895,1365
1480 question18,3.930,1.034,1365
1481 question19,4.077,.963,1365
1482 question20,3.777,.909,1365
1483 question21,3.774,.984,1365
1484 question22,3.607,1.116,1365
1485 question23,3.813,.957,1365
1486 question24,3.666,.926,1365
1487
1488 Table: Correlation Matrix
1489 ,,question13,question14,question15,question16,question17,question18,question19,question20,question21,question22,question23,question24
1490 Correlation,question13,1.000,.661,.600,.566,.577,.409,.286,.304,.476,.333,.564,.454
1491 ,question14,.661,1.000,.635,.500,.552,.433,.320,.315,.449,.333,.565,.443
1492 ,question15,.600,.635,1.000,.505,.587,.457,.359,.356,.509,.369,.582,.435
1493 ,question16,.566,.500,.505,1.000,.586,.405,.335,.317,.452,.363,.459,.430
1494 ,question17,.577,.552,.587,.586,1.000,.555,.449,.417,.595,.450,.613,.521
1495 ,question18,.409,.433,.457,.405,.555,1.000,.627,.521,.554,.536,.569,.474
1496 ,question19,.286,.320,.359,.335,.449,.627,1.000,.446,.499,.484,.444,.374
1497 ,question20,.304,.315,.356,.317,.417,.521,.446,1.000,.425,.383,.410,.357
1498 ,question21,.476,.449,.509,.452,.595,.554,.499,.425,1.000,.507,.598,.500
1499 ,question22,.333,.333,.369,.363,.450,.536,.484,.383,.507,1.000,.493,.444
1500 ,question23,.564,.565,.582,.459,.613,.569,.444,.410,.598,.493,1.000,.705
1501 ,question24,.454,.443,.435,.430,.521,.474,.374,.357,.500,.444,.705,1.000
1502 Caption: Determinant: 0.00
1503
1504 Table: Factor Matrix
1505 ,Factor,,
1506 ,1,2,3
1507 question13,.713,.398,
1508 question14,.703,.339,
1509 question15,.721,,
1510 question16,.648,,
1511 question17,.783,,
1512 question18,.740,-.345,
1513 question19,.616,-.415,
1514 question20,.550,,
1515 question21,.732,,
1516 question22,.613,,
1517 question23,.819,,.345
1518 question24,.695,,.386
1519  
1520 Table: Rotated Factor Matrix
1521 ,Factor,,
1522 ,1,2,3
1523 question13,.771,,
1524 question14,.726,,
1525 question15,.676,,
1526 question16,.591,,
1527 question17,.587,.446,
1528 question18,,.739,
1529 question19,,.727,
1530 question20,,.540,
1531 question21,.402,.533,.321
1532 question22,,.559,
1533 question23,.449,.377,.668
1534 question24,.324,.321,.652
1535 ])
1536
1537 AT_CLEANUP
1538
1539 AT_SETUP([FACTOR extraction=pc method=correlation])
1540 dnl This example is from http://www.ats.ucla.edu/stat/spss/whatstat/whatstat.htm        
1541
1542 AT_DATA([factor2.sps],
1543   [set format = F11.3.
1544
1545
1546 data list notable list /id female race ses schtyp prog read write math science socst.
1547 begin data.
1548  70.00      .00  4.00     1.00     1.00     1.00    57.00    52.00    41.00    47.00    57.00
1549 121.00     1.00  4.00     2.00     1.00     3.00    68.00    59.00    53.00    63.00    61.00
1550  86.00      .00  4.00     3.00     1.00     1.00    44.00    33.00    54.00    58.00    31.00
1551 141.00      .00  4.00     3.00     1.00     3.00    63.00    44.00    47.00    53.00    56.00
1552 172.00      .00  4.00     2.00     1.00     2.00    47.00    52.00    57.00    53.00    61.00
1553 113.00      .00  4.00     2.00     1.00     2.00    44.00    52.00    51.00    63.00    61.00
1554  50.00      .00  3.00     2.00     1.00     1.00    50.00    59.00    42.00    53.00    61.00
1555  11.00      .00  1.00     2.00     1.00     2.00    34.00    46.00    45.00    39.00    36.00
1556  84.00      .00  4.00     2.00     1.00     1.00    63.00    57.00    54.00    58.00    51.00
1557  48.00      .00  3.00     2.00     1.00     2.00    57.00    55.00    52.00    50.00    51.00
1558  75.00      .00  4.00     2.00     1.00     3.00    60.00    46.00    51.00    53.00    61.00
1559  60.00      .00  4.00     2.00     1.00     2.00    57.00    65.00    51.00    63.00    61.00
1560  95.00      .00  4.00     3.00     1.00     2.00    73.00    60.00    71.00    61.00    71.00
1561 104.00      .00  4.00     3.00     1.00     2.00    54.00    63.00    57.00    55.00    46.00
1562  38.00      .00  3.00     1.00     1.00     2.00    45.00    57.00    50.00    31.00    56.00
1563 115.00      .00  4.00     1.00     1.00     1.00    42.00    49.00    43.00    50.00    56.00
1564  76.00      .00  4.00     3.00     1.00     2.00    47.00    52.00    51.00    50.00    56.00
1565 195.00      .00  4.00     2.00     2.00     1.00    57.00    57.00    60.00    58.00    56.00
1566 114.00      .00  4.00     3.00     1.00     2.00    68.00    65.00    62.00    55.00    61.00
1567  85.00      .00  4.00     2.00     1.00     1.00    55.00    39.00    57.00    53.00    46.00
1568 167.00      .00  4.00     2.00     1.00     1.00    63.00    49.00    35.00    66.00    41.00
1569 143.00      .00  4.00     2.00     1.00     3.00    63.00    63.00    75.00    72.00    66.00
1570  41.00      .00  3.00     2.00     1.00     2.00    50.00    40.00    45.00    55.00    56.00
1571  20.00      .00  1.00     3.00     1.00     2.00    60.00    52.00    57.00    61.00    61.00
1572  12.00      .00  1.00     2.00     1.00     3.00    37.00    44.00    45.00    39.00    46.00
1573  53.00      .00  3.00     2.00     1.00     3.00    34.00    37.00    46.00    39.00    31.00
1574 154.00      .00  4.00     3.00     1.00     2.00    65.00    65.00    66.00    61.00    66.00
1575 178.00      .00  4.00     2.00     2.00     3.00    47.00    57.00    57.00    58.00    46.00
1576 196.00      .00  4.00     3.00     2.00     2.00    44.00    38.00    49.00    39.00    46.00
1577  29.00      .00  2.00     1.00     1.00     1.00    52.00    44.00    49.00    55.00    41.00
1578 126.00      .00  4.00     2.00     1.00     1.00    42.00    31.00    57.00    47.00    51.00
1579 103.00      .00  4.00     3.00     1.00     2.00    76.00    52.00    64.00    64.00    61.00
1580 192.00      .00  4.00     3.00     2.00     2.00    65.00    67.00    63.00    66.00    71.00
1581 150.00      .00  4.00     2.00     1.00     3.00    42.00    41.00    57.00    72.00    31.00
1582 199.00      .00  4.00     3.00     2.00     2.00    52.00    59.00    50.00    61.00    61.00
1583 144.00      .00  4.00     3.00     1.00     1.00    60.00    65.00    58.00    61.00    66.00
1584 200.00      .00  4.00     2.00     2.00     2.00    68.00    54.00    75.00    66.00    66.00
1585  80.00      .00  4.00     3.00     1.00     2.00    65.00    62.00    68.00    66.00    66.00
1586  16.00      .00  1.00     1.00     1.00     3.00    47.00    31.00    44.00    36.00    36.00
1587 153.00      .00  4.00     2.00     1.00     3.00    39.00    31.00    40.00    39.00    51.00
1588 176.00      .00  4.00     2.00     2.00     2.00    47.00    47.00    41.00    42.00    51.00
1589 177.00      .00  4.00     2.00     2.00     2.00    55.00    59.00    62.00    58.00    51.00
1590 168.00      .00  4.00     2.00     1.00     2.00    52.00    54.00    57.00    55.00    51.00
1591  40.00      .00  3.00     1.00     1.00     1.00    42.00    41.00    43.00    50.00    41.00
1592  62.00      .00  4.00     3.00     1.00     1.00    65.00    65.00    48.00    63.00    66.00
1593 169.00      .00  4.00     1.00     1.00     1.00    55.00    59.00    63.00    69.00    46.00
1594  49.00      .00  3.00     3.00     1.00     3.00    50.00    40.00    39.00    49.00    47.00
1595 136.00      .00  4.00     2.00     1.00     2.00    65.00    59.00    70.00    63.00    51.00
1596 189.00      .00  4.00     2.00     2.00     2.00    47.00    59.00    63.00    53.00    46.00
1597   7.00      .00  1.00     2.00     1.00     2.00    57.00    54.00    59.00    47.00    51.00
1598  27.00      .00  2.00     2.00     1.00     2.00    53.00    61.00    61.00    57.00    56.00
1599 128.00      .00  4.00     3.00     1.00     2.00    39.00    33.00    38.00    47.00    41.00
1600  21.00      .00  1.00     2.00     1.00     1.00    44.00    44.00    61.00    50.00    46.00
1601 183.00      .00  4.00     2.00     2.00     2.00    63.00    59.00    49.00    55.00    71.00
1602 132.00      .00  4.00     2.00     1.00     2.00    73.00    62.00    73.00    69.00    66.00
1603  15.00      .00  1.00     3.00     1.00     3.00    39.00    39.00    44.00    26.00    42.00
1604  67.00      .00  4.00     1.00     1.00     3.00    37.00    37.00    42.00    33.00    32.00
1605  22.00      .00  1.00     2.00     1.00     3.00    42.00    39.00    39.00    56.00    46.00
1606 185.00      .00  4.00     2.00     2.00     2.00    63.00    57.00    55.00    58.00    41.00
1607   9.00      .00  1.00     2.00     1.00     3.00    48.00    49.00    52.00    44.00    51.00
1608 181.00      .00  4.00     2.00     2.00     2.00    50.00    46.00    45.00    58.00    61.00
1609 170.00      .00  4.00     3.00     1.00     2.00    47.00    62.00    61.00    69.00    66.00
1610 134.00      .00  4.00     1.00     1.00     1.00    44.00    44.00    39.00    34.00    46.00
1611 108.00      .00  4.00     2.00     1.00     1.00    34.00    33.00    41.00    36.00    36.00
1612 197.00      .00  4.00     3.00     2.00     2.00    50.00    42.00    50.00    36.00    61.00
1613 140.00      .00  4.00     2.00     1.00     3.00    44.00    41.00    40.00    50.00    26.00
1614 171.00      .00  4.00     2.00     1.00     2.00    60.00    54.00    60.00    55.00    66.00
1615 107.00      .00  4.00     1.00     1.00     3.00    47.00    39.00    47.00    42.00    26.00
1616  81.00      .00  4.00     1.00     1.00     2.00    63.00    43.00    59.00    65.00    44.00
1617  18.00      .00  1.00     2.00     1.00     3.00    50.00    33.00    49.00    44.00    36.00
1618 155.00      .00  4.00     2.00     1.00     1.00    44.00    44.00    46.00    39.00    51.00
1619  97.00      .00  4.00     3.00     1.00     2.00    60.00    54.00    58.00    58.00    61.00
1620  68.00      .00  4.00     2.00     1.00     2.00    73.00    67.00    71.00    63.00    66.00
1621 157.00      .00  4.00     2.00     1.00     1.00    68.00    59.00    58.00    74.00    66.00
1622  56.00      .00  4.00     2.00     1.00     3.00    55.00    45.00    46.00    58.00    51.00
1623   5.00      .00  1.00     1.00     1.00     2.00    47.00    40.00    43.00    45.00    31.00
1624 159.00      .00  4.00     3.00     1.00     2.00    55.00    61.00    54.00    49.00    61.00
1625 123.00      .00  4.00     3.00     1.00     1.00    68.00    59.00    56.00    63.00    66.00
1626 164.00      .00  4.00     2.00     1.00     3.00    31.00    36.00    46.00    39.00    46.00
1627  14.00      .00  1.00     3.00     1.00     2.00    47.00    41.00    54.00    42.00    56.00
1628 127.00      .00  4.00     3.00     1.00     2.00    63.00    59.00    57.00    55.00    56.00
1629 165.00      .00  4.00     1.00     1.00     3.00    36.00    49.00    54.00    61.00    36.00
1630 174.00      .00  4.00     2.00     2.00     2.00    68.00    59.00    71.00    66.00    56.00
1631   3.00      .00  1.00     1.00     1.00     2.00    63.00    65.00    48.00    63.00    56.00
1632  58.00      .00  4.00     2.00     1.00     3.00    55.00    41.00    40.00    44.00    41.00
1633 146.00      .00  4.00     3.00     1.00     2.00    55.00    62.00    64.00    63.00    66.00
1634 102.00      .00  4.00     3.00     1.00     2.00    52.00    41.00    51.00    53.00    56.00
1635 117.00      .00  4.00     3.00     1.00     3.00    34.00    49.00    39.00    42.00    56.00
1636 133.00      .00  4.00     2.00     1.00     3.00    50.00    31.00    40.00    34.00    31.00
1637  94.00      .00  4.00     3.00     1.00     2.00    55.00    49.00    61.00    61.00    56.00
1638  24.00      .00  2.00     2.00     1.00     2.00    52.00    62.00    66.00    47.00    46.00
1639 149.00      .00  4.00     1.00     1.00     1.00    63.00    49.00    49.00    66.00    46.00
1640  82.00     1.00  4.00     3.00     1.00     2.00    68.00    62.00    65.00    69.00    61.00
1641   8.00     1.00  1.00     1.00     1.00     2.00    39.00    44.00    52.00    44.00    48.00
1642 129.00     1.00  4.00     1.00     1.00     1.00    44.00    44.00    46.00    47.00    51.00
1643 173.00     1.00  4.00     1.00     1.00     1.00    50.00    62.00    61.00    63.00    51.00
1644  57.00     1.00  4.00     2.00     1.00     2.00    71.00    65.00    72.00    66.00    56.00
1645 100.00     1.00  4.00     3.00     1.00     2.00    63.00    65.00    71.00    69.00    71.00
1646   1.00     1.00  1.00     1.00     1.00     3.00    34.00    44.00    40.00    39.00    41.00
1647 194.00     1.00  4.00     3.00     2.00     2.00    63.00    63.00    69.00    61.00    61.00
1648  88.00     1.00  4.00     3.00     1.00     2.00    68.00    60.00    64.00    69.00    66.00
1649  99.00     1.00  4.00     3.00     1.00     1.00    47.00    59.00    56.00    66.00    61.00
1650  47.00     1.00  3.00     1.00     1.00     2.00    47.00    46.00    49.00    33.00    41.00
1651 120.00     1.00  4.00     3.00     1.00     2.00    63.00    52.00    54.00    50.00    51.00
1652 166.00     1.00  4.00     2.00     1.00     2.00    52.00    59.00    53.00    61.00    51.00
1653  65.00     1.00  4.00     2.00     1.00     2.00    55.00    54.00    66.00    42.00    56.00
1654 101.00     1.00  4.00     3.00     1.00     2.00    60.00    62.00    67.00    50.00    56.00
1655  89.00     1.00  4.00     1.00     1.00     3.00    35.00    35.00    40.00    51.00    33.00
1656  54.00     1.00  3.00     1.00     2.00     1.00    47.00    54.00    46.00    50.00    56.00
1657 180.00     1.00  4.00     3.00     2.00     2.00    71.00    65.00    69.00    58.00    71.00
1658 162.00     1.00  4.00     2.00     1.00     3.00    57.00    52.00    40.00    61.00    56.00
1659   4.00     1.00  1.00     1.00     1.00     2.00    44.00    50.00    41.00    39.00    51.00
1660 131.00     1.00  4.00     3.00     1.00     2.00    65.00    59.00    57.00    46.00    66.00
1661 125.00     1.00  4.00     1.00     1.00     2.00    68.00    65.00    58.00    59.00    56.00
1662  34.00     1.00  1.00     3.00     2.00     2.00    73.00    61.00    57.00    55.00    66.00
1663 106.00     1.00  4.00     2.00     1.00     3.00    36.00    44.00    37.00    42.00    41.00
1664 130.00     1.00  4.00     3.00     1.00     1.00    43.00    54.00    55.00    55.00    46.00
1665  93.00     1.00  4.00     3.00     1.00     2.00    73.00    67.00    62.00    58.00    66.00
1666 163.00     1.00  4.00     1.00     1.00     2.00    52.00    57.00    64.00    58.00    56.00
1667  37.00     1.00  3.00     1.00     1.00     3.00    41.00    47.00    40.00    39.00    51.00
1668  35.00     1.00  1.00     1.00     2.00     1.00    60.00    54.00    50.00    50.00    51.00
1669  87.00     1.00  4.00     2.00     1.00     1.00    50.00    52.00    46.00    50.00    56.00
1670  73.00     1.00  4.00     2.00     1.00     2.00    50.00    52.00    53.00    39.00    56.00
1671 151.00     1.00  4.00     2.00     1.00     3.00    47.00    46.00    52.00    48.00    46.00
1672  44.00     1.00  3.00     1.00     1.00     3.00    47.00    62.00    45.00    34.00    46.00
1673 152.00     1.00  4.00     3.00     1.00     2.00    55.00    57.00    56.00    58.00    61.00
1674 105.00     1.00  4.00     2.00     1.00     2.00    50.00    41.00    45.00    44.00    56.00
1675  28.00     1.00  2.00     2.00     1.00     1.00    39.00    53.00    54.00    50.00    41.00
1676  91.00     1.00  4.00     3.00     1.00     3.00    50.00    49.00    56.00    47.00    46.00
1677  45.00     1.00  3.00     1.00     1.00     3.00    34.00    35.00    41.00    29.00    26.00
1678 116.00     1.00  4.00     2.00     1.00     2.00    57.00    59.00    54.00    50.00    56.00
1679  33.00     1.00  2.00     1.00     1.00     2.00    57.00    65.00    72.00    54.00    56.00
1680  66.00     1.00  4.00     2.00     1.00     3.00    68.00    62.00    56.00    50.00    51.00
1681  72.00     1.00  4.00     2.00     1.00     3.00    42.00    54.00    47.00    47.00    46.00
1682  77.00     1.00  4.00     1.00     1.00     2.00    61.00    59.00    49.00    44.00    66.00
1683  61.00     1.00  4.00     3.00     1.00     2.00    76.00    63.00    60.00    67.00    66.00
1684 190.00     1.00  4.00     2.00     2.00     2.00    47.00    59.00    54.00    58.00    46.00
1685  42.00     1.00  3.00     2.00     1.00     3.00    46.00    52.00    55.00    44.00    56.00
1686   2.00     1.00  1.00     2.00     1.00     3.00    39.00    41.00    33.00    42.00    41.00
1687  55.00     1.00  3.00     2.00     2.00     2.00    52.00    49.00    49.00    44.00    61.00
1688  19.00     1.00  1.00     1.00     1.00     1.00    28.00    46.00    43.00    44.00    51.00
1689  90.00     1.00  4.00     3.00     1.00     2.00    42.00    54.00    50.00    50.00    52.00
1690 142.00     1.00  4.00     2.00     1.00     3.00    47.00    42.00    52.00    39.00    51.00
1691  17.00     1.00  1.00     2.00     1.00     2.00    47.00    57.00    48.00    44.00    41.00
1692 122.00     1.00  4.00     2.00     1.00     2.00    52.00    59.00    58.00    53.00    66.00
1693 191.00     1.00  4.00     3.00     2.00     2.00    47.00    52.00    43.00    48.00    61.00
1694  83.00     1.00  4.00     2.00     1.00     3.00    50.00    62.00    41.00    55.00    31.00
1695 182.00     1.00  4.00     2.00     2.00     2.00    44.00    52.00    43.00    44.00    51.00
1696   6.00     1.00  1.00     1.00     1.00     2.00    47.00    41.00    46.00    40.00    41.00
1697  46.00     1.00  3.00     1.00     1.00     2.00    45.00    55.00    44.00    34.00    41.00
1698  43.00     1.00  3.00     1.00     1.00     2.00    47.00    37.00    43.00    42.00    46.00
1699  96.00     1.00  4.00     3.00     1.00     2.00    65.00    54.00    61.00    58.00    56.00
1700 138.00     1.00  4.00     2.00     1.00     3.00    43.00    57.00    40.00    50.00    51.00
1701  10.00     1.00  1.00     2.00     1.00     1.00    47.00    54.00    49.00    53.00    61.00
1702  71.00     1.00  4.00     2.00     1.00     1.00    57.00    62.00    56.00    58.00    66.00
1703 139.00     1.00  4.00     2.00     1.00     2.00    68.00    59.00    61.00    55.00    71.00
1704 110.00     1.00  4.00     2.00     1.00     3.00    52.00    55.00    50.00    54.00    61.00
1705 148.00     1.00  4.00     2.00     1.00     3.00    42.00    57.00    51.00    47.00    61.00
1706 109.00     1.00  4.00     2.00     1.00     1.00    42.00    39.00    42.00    42.00    41.00
1707  39.00     1.00  3.00     3.00     1.00     2.00    66.00    67.00    67.00    61.00    66.00
1708 147.00     1.00  4.00     1.00     1.00     2.00    47.00    62.00    53.00    53.00    61.00
1709  74.00     1.00  4.00     2.00     1.00     2.00    57.00    50.00    50.00    51.00    58.00
1710 198.00     1.00  4.00     3.00     2.00     2.00    47.00    61.00    51.00    63.00    31.00
1711 161.00     1.00  4.00     1.00     1.00     2.00    57.00    62.00    72.00    61.00    61.00
1712 112.00     1.00  4.00     2.00     1.00     2.00    52.00    59.00    48.00    55.00    61.00
1713  69.00     1.00  4.00     1.00     1.00     3.00    44.00    44.00    40.00    40.00    31.00
1714 156.00     1.00  4.00     2.00     1.00     2.00    50.00    59.00    53.00    61.00    61.00
1715 111.00     1.00  4.00     1.00     1.00     1.00    39.00    54.00    39.00    47.00    36.00
1716 186.00     1.00  4.00     2.00     2.00     2.00    57.00    62.00    63.00    55.00    41.00
1717  98.00     1.00  4.00     1.00     1.00     3.00    57.00    60.00    51.00    53.00    37.00
1718 119.00     1.00  4.00     1.00     1.00     1.00    42.00    57.00    45.00    50.00    43.00
1719  13.00     1.00  1.00     2.00     1.00     3.00    47.00    46.00    39.00    47.00    61.00
1720  51.00     1.00  3.00     3.00     1.00     1.00    42.00    36.00    42.00    31.00    39.00
1721  26.00     1.00  2.00     3.00     1.00     2.00    60.00    59.00    62.00    61.00    51.00
1722  36.00     1.00  3.00     1.00     1.00     1.00    44.00    49.00    44.00    35.00    51.00
1723 135.00     1.00  4.00     1.00     1.00     2.00    63.00    60.00    65.00    54.00    66.00
1724  59.00     1.00  4.00     2.00     1.00     2.00    65.00    67.00    63.00    55.00    71.00
1725  78.00     1.00  4.00     2.00     1.00     2.00    39.00    54.00    54.00    53.00    41.00
1726  64.00     1.00  4.00     3.00     1.00     3.00    50.00    52.00    45.00    58.00    36.00
1727  63.00     1.00  4.00     1.00     1.00     1.00    52.00    65.00    60.00    56.00    51.00
1728  79.00     1.00  4.00     2.00     1.00     2.00    60.00    62.00    49.00    50.00    51.00
1729 193.00     1.00  4.00     2.00     2.00     2.00    44.00    49.00    48.00    39.00    51.00
1730  92.00     1.00  4.00     3.00     1.00     1.00    52.00    67.00    57.00    63.00    61.00
1731 160.00     1.00  4.00     2.00     1.00     2.00    55.00    65.00    55.00    50.00    61.00
1732  32.00     1.00  2.00     3.00     1.00     3.00    50.00    67.00    66.00    66.00    56.00
1733  23.00     1.00  2.00     1.00     1.00     2.00    65.00    65.00    64.00    58.00    71.00
1734 158.00     1.00  4.00     2.00     1.00     1.00    52.00    54.00    55.00    53.00    51.00
1735  25.00     1.00  2.00     2.00     1.00     1.00    47.00    44.00    42.00    42.00    36.00
1736 188.00     1.00  4.00     3.00     2.00     2.00    63.00    62.00    56.00    55.00    61.00
1737  52.00     1.00  3.00     1.00     1.00     2.00    50.00    46.00    53.00    53.00    66.00
1738 124.00     1.00  4.00     1.00     1.00     3.00    42.00    54.00    41.00    42.00    41.00
1739 175.00     1.00  4.00     3.00     2.00     1.00    36.00    57.00    42.00    50.00    41.00
1740 184.00     1.00  4.00     2.00     2.00     3.00    50.00    52.00    53.00    55.00    56.00
1741  30.00     1.00  2.00     3.00     1.00     2.00    41.00    59.00    42.00    34.00    51.00
1742 179.00     1.00  4.00     2.00     2.00     2.00    47.00    65.00    60.00    50.00    56.00
1743  31.00     1.00  2.00     2.00     2.00     1.00    55.00    59.00    52.00    42.00    56.00
1744 145.00     1.00  4.00     2.00     1.00     3.00    42.00    46.00    38.00    36.00    46.00
1745 187.00     1.00  4.00     2.00     2.00     1.00    57.00    41.00    57.00    55.00    52.00
1746 118.00     1.00  4.00     2.00     1.00     1.00    55.00    62.00    58.00    58.00    61.00
1747 137.00     1.00  4.00     3.00     1.00     2.00    63.00    65.00    65.00    53.00    61.00
1748 end data.
1749
1750 factor
1751   /variables read write math science socst
1752   /analysis read write math science socst
1753   /extraction pc
1754   /plot eigen
1755   /criteria mineigen (.557)
1756   .
1757 ])
1758
1759 AT_CHECK([pspp -O format=csv factor2.sps], [0],
1760   [Table: Communalities
1761 ,Initial,Extraction
1762 read,1.000,.736
1763 write,1.000,.704
1764 math,1.000,.750
1765 science,1.000,.849
1766 socst,1.000,.900
1767
1768 Table: Total Variance Explained
1769 ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,,,Rotation Sums of Squared Loadings,,
1770 ,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %
1771 1,3.381,67.6%,67.6%,3.381,67.6%,67.6%,2.113,42.3%,42.3%
1772 2,.557,11.1%,78.8%,.557,11.1%,78.8%,1.825,36.5%,78.8%
1773 3,.407,8.1%,86.9%,,,,,,
1774 4,.356,7.1%,94.0%,,,,,,
1775 5,.299,6.0%,100.0%,,,,,,
1776
1777 Table: Component Matrix
1778 ,Component,
1779 ,1,2
1780 read,.858,.020
1781 write,.824,-.155
1782 math,.844,.195
1783 science,.801,.456
1784 socst,.783,-.536
1785
1786 Table: Rotated Component Matrix
1787 ,Component,
1788 ,1,2
1789 read,.650,.559
1790 write,.508,.667
1791 math,.757,.421
1792 science,.900,.198
1793 socst,.222,.922
1794 ])
1795
1796 AT_CLEANUP
1797
1798
1799
1800 AT_SETUP([FACTOR empty dataset])
1801 dnl Test that something sane happens when the dataset contains no complete observations
1802
1803 AT_DATA([factor-empty.sps],
1804   [data list notable list /x * y * z *.
1805 begin data.
1806 3.4        .     92.9
1807 .        32.09   34.2
1808 1.00     19.80     .
1809 2.00       .      3.6
1810 end data.
1811
1812 factor /variables = ALL.
1813 ])
1814
1815 AT_CHECK([pspp -O format=csv factor-empty.sps], [0], [ignore])
1816 AT_CLEANUP
1817
1818
1819 dnl Fixes a crash reported at
1820 dnl http://lists.gnu.org/archive/html/bug-gnu-pspp/2012-04/msg00001.html
1821 AT_SETUP([FACTOR /ROTATION=NOROTATE])
1822 AT_DATA([factor-norotate.sps], [dnl
1823 DATA LIST FREE / TRAIT1 TO TRAIT5 (F8.2).
1824 BEGIN DATA
1825 1 5 5 1 1
1826 8 9 7 9 8
1827 9 8 9 9 8
1828 9 9 9 9 9
1829 1 9 1 1 9
1830 9 7 7 9 9
1831 9 7 9 9 7
1832 END DATA
1833
1834 FACTOR /VARIABLES=TRAIT1 TO TRAIT5
1835     /ROTATION=NOROTATE /* NOROTATE may have caused the problem. */
1836     /EXTRACTION=PC
1837     /PRINT=DEFAULT DET UNIVARIATE ROTATION SIG CORRELATION.
1838 ])
1839
1840 AT_CHECK([pspp -O format=csv factor-norotate.sps], [0], [dnl
1841 Table: Descriptive Statistics
1842 ,Mean,Std. Deviation,Analysis N
1843 TRAIT1,6.57,3.54,7
1844 TRAIT2,7.71,1.39,7
1845 TRAIT3,6.71,2.71,7
1846 TRAIT4,6.71,3.61,7
1847 TRAIT5,7.29,2.66,7
1848
1849 Table: Correlation Matrix
1850 ,,TRAIT1,TRAIT2,TRAIT3,TRAIT4,TRAIT5
1851 Correlation,TRAIT1,1.000,.296,.881,.995,.545
1852 ,TRAIT2,.296,1.000,-.022,.326,.837
1853 ,TRAIT3,.881,-.022,1.000,.867,.130
1854 ,TRAIT4,.995,.326,.867,1.000,.544
1855 ,TRAIT5,.545,.837,.130,.544,1.000
1856 Sig. (1-tailed),TRAIT1,,.260,.004,.000,.103
1857 ,TRAIT2,.260,,.482,.238,.009
1858 ,TRAIT3,.004,.482,,.006,.390
1859 ,TRAIT4,.000,.238,.006,,.103
1860 ,TRAIT5,.103,.009,.390,.103,
1861 Caption: Determinant: 0.00
1862
1863 Table: Communalities
1864 ,Initial,Extraction
1865 TRAIT1,1.00,1.00
1866 TRAIT2,1.00,1.00
1867 TRAIT3,1.00,.99
1868 TRAIT4,1.00,.99
1869 TRAIT5,1.00,.99
1870
1871 Table: Total Variance Explained
1872 ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,,
1873 ,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %
1874 1,3.26,65.3%,65.3%,3.26,65.3%,65.3%
1875 2,1.54,30.8%,96.0%,1.54,30.8%,96.0%
1876 3,.17,3.4%,99.4%,.17,3.4%,99.4%
1877 4,.03,.6%,100.0%,.03,.6%,100.0%
1878 5,.00,.0%,100.0%,,,
1879
1880 Table: Component Matrix
1881 ,Component,,,
1882 ,1,2,3,4
1883 TRAIT1,.97,.23,-.08,.00
1884 TRAIT2,.52,-.81,.28,.00
1885 TRAIT3,.78,.59,.17,.00
1886 TRAIT4,.97,.21,-.04,.00
1887 TRAIT5,.70,-.67,-.23,.00
1888 ])
1889 AT_CLEANUP
1890
1891
1892
1893 dnl Fixes a bug in the way that the /CRITERIA = ITERATE option was interpreted.
1894 dnl http://lists.gnu.org/archive/html/bug-gnu-pspp/2013-09/msg00036.html
1895 AT_SETUP([FACTOR /CRITERIA=ITERATE])
1896 AT_DATA([factor-iterate.sps], [dnl
1897 set format = F20.3.
1898 data list notable list /x y z *.
1899 begin data.
1900 1.00    5.00    3.00
1901 2.00    2.00    2.00
1902 3.00    1.00    1.00
1903 4.00    4.00    5.00
1904 5.00    3.00    9.00
1905 6.00    6.00    4.00
1906 7.00    7.00    6.00
1907 8.00    8.00    8.00
1908 9.00    9.00    7.00
1909 end data.
1910
1911 FACTOR
1912  /VARIABLES= x y z
1913  /CRITERIA = MINEIGEN (1) ITERATE (25)
1914  /EXTRACTION =PAF
1915  /METHOD = CORRELATION
1916  /PRINT = INITIAL EXTRACTION
1917  /CRITERIA = ITERATE (0)
1918  /ROTATION = NOROTATE.
1919 ])
1920
1921 AT_CHECK([pspp -O format=csv factor-iterate.sps], [0], [dnl
1922 Table: Communalities
1923 ,Initial,Extraction
1924 x,.735,.979
1925 y,.640,.653
1926 z,.514,.523
1927
1928 Table: Total Variance Explained
1929 ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,,
1930 ,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %
1931 1,2.404,80.1%,80.1%,2.155,71.8%,71.8%
1932 2,.425,14.2%,94.3%,,,
1933 3,.171,5.7%,100.0%,,,
1934
1935 Table: Factor Matrix
1936 ,Factor
1937 ,1
1938 x,.990
1939 y,.808
1940 z,.723
1941 ])
1942 AT_CLEANUP
1943
1944
1945 AT_SETUP([FACTOR promax])
1946 AT_DATA([factor-promax.sps], [dnl
1947 set decimal=dot.
1948 set format=F22.3.
1949
1950 get file='llz.zsav'.
1951
1952 factor 
1953         /variables pz pn ps nz nn ns tz tn ts oz on os sz sn ss zz zn zs 
1954         /missing listwise 
1955         /print initial extraction rotation 
1956         /criteria mineigen(1) iterate(25) 
1957         /extraction paf 
1958         /method correlation
1959         /rotation promax (5).
1960 ])
1961
1962 AT_CHECK([ln -s $top_srcdir/tests/language/stats/llz.zsav .], [0], [ignore])
1963
1964 AT_CHECK([pspp -O format=csv factor-promax.sps], [0], [dnl
1965 Table: Communalities
1966 ,Initial,Extraction
1967 PZ,.191,.375
1968 PN,.042,.102
1969 PS,.458,.623
1970 NZ,.100,.163
1971 NN,.065,.079
1972 NS,.129,.148
1973 TZ,.181,.344
1974 TN,.102,.142
1975 TS,.310,.372
1976 OZ,.097,.158
1977 ON,.323,.410
1978 OS,.469,.617
1979 SZ,.104,.170
1980 SN,.154,.267
1981 SS,.081,.180
1982 ZZ,.123,.192
1983 ZN,.208,.412
1984 ZS,.130,.158
1985
1986 Table: Total Variance Explained
1987 ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,,,Rotation Sums of Squared Loadings,,
1988 ,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %
1989 1,2.968,16.5%,16.5%,2.411,13.4%,13.4%,.   ,.  ,.  @&t@
1990 2,2.026,11.3%,27.7%,1.271,7.1%,20.5%,.   ,.  ,-Infinity
1991 3,1.622,9.0%,36.8%,.948,5.3%,25.7%,.   ,.  ,-Infinity
1992 4,1.086,6.0%,42.8%,.283,1.6%,27.3%,.   ,.  ,-Infinity
1993 5,.996,5.5%,48.3%,,,,,,
1994 6,.923,5.1%,53.5%,,,,,,
1995 7,.873,4.9%,58.3%,,,,,,
1996 8,.856,4.8%,63.1%,,,,,,
1997 9,.836,4.6%,67.7%,,,,,,
1998 10,.816,4.5%,72.2%,,,,,,
1999 11,.785,4.4%,76.6%,,,,,,
2000 12,.740,4.1%,80.7%,,,,,,
2001 13,.713,4.0%,84.7%,,,,,,
2002 14,.653,3.6%,88.3%,,,,,,
2003 15,.633,3.5%,91.8%,,,,,,
2004 16,.604,3.4%,95.2%,,,,,,
2005 17,.484,2.7%,97.9%,,,,,,
2006 18,.386,2.1%,100.0%,,,,,,
2007
2008 Table: Factor Matrix
2009 ,Factor,,,
2010 ,1,2,3,4
2011 PZ,-.276,.154,.510,.124
2012 PN,.096,.129,-.091,.261
2013 PS,.746,-.085,.234,.063
2014 NZ,-.111,.323,.206,-.058
2015 NN,.007,.260,-.083,-.069
2016 NS,.366,.096,.046,.051
2017 TZ,-.228,.172,.509,.059
2018 TN,.131,.345,-.074,.029
2019 TS,.601,-.005,.098,.030
2020 OZ,-.145,.166,.322,-.081
2021 ON,.607,.082,.073,-.173
2022 OS,.757,-.059,.171,-.104
2023 SZ,-.142,.307,.226,-.066
2024 SN,.175,.436,-.183,.115
2025 SS,.199,.206,-.083,.302
2026 ZZ,-.074,.411,-.080,-.104
2027 ZN,.015,.580,-.252,-.114
2028 ZS,.365,.156,-.004,.015
2029
2030 Table: Pattern Matrix
2031 ,Factor,,,
2032 ,1,2,3,4
2033 PZ,-.063,-.126,.599,.085
2034 PN,-.035,.000,-.033,.325
2035 PS,.762,-.175,.058,.081
2036 NZ,.027,.230,.327,-.044
2037 NN,.008,.289,.008,-.026
2038 NS,.344,.044,.015,.091
2039 TZ,.004,-.074,.589,.020
2040 TN,.097,.307,.033,.103
2041 TS,.585,-.043,-.017,.062
2042 OZ,.046,.067,.382,-.109
2043 ON,.654,.151,-.029,-.145
2044 OS,.803,-.037,-.009,-.092
2045 SZ,.009,.213,.345,-.060
2046 SN,.065,.376,-.036,.227
2047 SS,.054,.042,-.013,.388
2048 ZZ,-.044,.434,.078,-.046
2049 ZN,-.025,.646,-.041,-.006
2050 ZS,.337,.133,-.013,.067
2051
2052 Table: Structure Matrix
2053 ,Factor,,,
2054 ,1,2,3,4
2055 PZ,-.177,-.058,.598,-.022
2056 PN,.068,.110,-.049,.317
2057 PS,.771,-.138,-.136,.240
2058 NZ,-.060,.236,.339,.019
2059 NN,.000,.281,.027,.076
2060 NS,.368,.080,-.068,.207
2061 TZ,-.127,-.028,.582,-.049
2062 TN,.122,.345,.023,.235
2063 TS,.607,-.018,-.160,.221
2064 OZ,-.074,.055,.384,-.101
2065 ON,.619,.104,-.160,.102
2066 OS,.778,-.064,-.190,.132
2067 SZ,-.086,.215,.361,-.009
2068 SN,.143,.453,-.044,.380
2069 SS,.171,.176,-.052,.420
2070 ZZ,-.073,.422,.120,.085
2071 ZN,-.013,.641,.008,.214
2072 ZS,.361,.158,-.088,.213
2073
2074 Table: Factor Correlation Matrix
2075 Factor,1,2,3,4
2076 1,1.000,.008,-.232,.294
2077 2,.008,1.000,.065,.347
2078 3,-.232,.065,1.000,-.076
2079 4,.294,.347,-.076,1.000
2080 ])
2081
2082
2083 AT_CLEANUP
2084
2085
2086
2087
2088
2089
2090 AT_SETUP([FACTOR covariance matrix])
2091
2092 AT_DATA([covariance-matrix.sps], [dnl
2093 set format = F10.3.
2094 matrix data
2095     variables = rowtype_  var01 var02 var03 var04 var05 var06 var07 var08
2096     / format = lower diagonal .
2097 begin data
2098 mean     24.3  5.4  69.7  20.1  13.4  2.7  27.9  3.7  
2099 sd        5.7  1.5  23.5  5.8    2.8  4.5   5.4  1.5  
2100 n        92   92    92   92     92   92    92   92   
2101 cov   32.490000 
2102 cov   1.539000 2.250000 
2103 cov   -29.469000 -5.992500 552.250000 
2104 cov   11.901600 2.697000 -19.082000 33.640000 
2105 cov   4.309200 0.672000 -7.896000 3.572800 7.840000 
2106 cov   8.464500 1.012500 -17.977500 6.264000 2.646000 20.250000 
2107 cov   15.390000 2.349000 -25.380000 10.022400 1.814400 9.234000 29.160000 
2108 cov   1.453500 0.652500 -1.762500 1.740000 1.134000 1.350000 0.324000 2.250000 
2109 end data.
2110
2111 factor matrix in (cov = *)
2112     / method = covariance
2113     / print = initial covariance
2114     / extraction = pc
2115     / rotation = norotate.
2116 ])
2117
2118 AT_CHECK([pspp -O format=csv covariance-matrix.sps], [0], [dnl
2119 Table: Covariance Matrix
2120 ,var01,var02,var03,var04,var05,var06,var07,var08
2121 var01,32.490,1.539,-29.469,11.902,4.309,8.464,15.390,1.454
2122 var02,1.539,2.250,-5.992,2.697,.672,1.013,2.349,.653
2123 var03,-29.469,-5.992,552.250,-19.082,-7.896,-17.977,-25.380,-1.763
2124 var04,11.902,2.697,-19.082,33.640,3.573,6.264,10.022,1.740
2125 var05,4.309,.672,-7.896,3.573,7.840,2.646,1.814,1.134
2126 var06,8.464,1.013,-17.977,6.264,2.646,20.250,9.234,1.350
2127 var07,15.390,2.349,-25.380,10.022,1.814,9.234,29.160,.324
2128 var08,1.454,.653,-1.763,1.740,1.134,1.350,.324,2.250
2129
2130 Table: Communalities
2131 ,Initial
2132 var01,32.490
2133 var02,2.250
2134 var03,552.250
2135 var04,33.640
2136 var05,7.840
2137 var06,20.250
2138 var07,29.160
2139 var08,2.250
2140
2141 Table: Total Variance Explained
2142 ,Initial Eigenvalues,,
2143 ,Total,% of Variance,Cumulative %
2144 1,556.895,81.9%,81.9%
2145 2,57.963,8.5%,90.4%
2146 3,23.576,3.5%,93.9%
2147 4,16.446,2.4%,96.3%
2148 5,14.603,2.1%,98.4%
2149 6,6.831,1.0%,99.4%
2150 7,2.375,.3%,99.8%
2151 8,1.440,.2%,100.0%
2152
2153 Table: Component Matrix
2154 ,Component,,,,,,
2155 ,1,2,3,4,5,6,7
2156 var01,1.394,4.388,1.513,-2.851,.849,.396,.033
2157 var02,.269,.460,-.173,.147,-.146,-.213,.872
2158 var03,-23.489,.725,.058,.003,.022,-.012,.006
2159 var04,.926,4.007,-4.068,.241,-.253,.218,-.026
2160 var05,.363,.829,-.172,-.255,.805,-2.492,.058
2161 var06,.843,2.354,.971,2.425,2.649,.392,.046
2162 var07,1.205,3.948,1.926,1.515,-2.450,-.317,-.087
2163 var08,.085,.319,-.157,-.011,.353,-.341,-.816
2164 ])
2165
2166 AT_CLEANUP
2167
2168
2169
2170 dnl A more realistic example of factor analysis usage.
2171 AT_SETUP([FACTOR correlation matrix])
2172
2173 AT_DATA([correlation-matrix.sps], [dnl
2174 set format = F10.3.
2175
2176 matrix data
2177     variables = rowtype_
2178     cdi_actws_16  cdi_maxzin_16  rdls_passws_16  rdls_actws_16  cdi_actws_20  cdi_maxzin_20  cdi_actws_26  cdi_maxzin_26  rdls_passws_26  rdls_actws_26
2179     nepsy_passws_36  morf_verv_36  bnt_actws_36  klankgr_id_36  snelnoe_36  letters_36  ppvt_passws_50  morf_verv_50
2180     nepsy_passws_56  bnt_actws_56  klank_gr_weg_56  snelnoe_56  letters_56
2181     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
2182     / format = upper diagonal .
2183 begin data
2184 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  
2185 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
2186 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 
2187 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
2188 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
2189 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
2190 corr    1.00  .708  .663  .509  .419  .434  .432  .267  .255  .342  .132  -.192  .142  .228  .203  .248  .260  .200  -.051  .254  .136  .156  .109  -.126  .172  -.004  .157  .268
2191 corr    1.00  .787  .710  .567  .402  .511  .274  .285  .332  .154  -.096  .247  .253  .235  .245  .257  .261  -.048  .243  .119  .194  .164  -.108  .184  .011  .157  .235
2192 corr    1.00  .590  .646  .449  .505  .313  .322  .405  .148  -.117  .152  .294  .322  .252  .321  .267  -.055  .255  .118  .178  .137  -.110  .182  .004  .146  .216
2193 corr    1.00  .548  .343  .619  .296  .260  .456  .149  -.098  .252  .279  .267  .342  .361  .186  -.066  .215  .107  .148  .059  -.114  .156  -.035  .095  .220
2194 corr    1.00  .406  .509  .397  .236  .416  .037  -.179  .192  .334  .293  .277  .367  .162  -.150  .306  .171  .307  .173  -.128  .255  .075  .224  .315
2195 corr    1.00  .410  .497  .560  .574  .240  -.301  .204  .508  .351  .457  .428  .242  -.117  .367  .136  .191  .191  -.102  .215  .053  .185  .273
2196 corr    1.00  .328  .258  .534  .236  -.202  .200  .333  .209  .352  .375  .302  -.119  .272  .062  .203  .042  -.092  .220  .020  .158  .227
2197 corr    1.00  .439  .488  .323  -.213  .287  .507  .427  .493  .522  .298  -.142  .371  .109  .215  .213  -.048  .228  .009  .133  .267
2198 corr    1.00  .437  .381  -.158  .153  .403  .430  .383  .379  .150  -.141  .303  .115  .131  .155  -.170  .206  .039  .193  .254
2199 corr    1.00  .247  -.143  .182  .521  .364  .415  .688  .304  -.185  .327  .188  .211  .202  -.111  .272  .122  .226  .301
2200 corr    1.00  -.150  .229  .296  .249  .329  .255  .210  -.036  .252  .141  .230  .112  -.195  .309  .135  .250  .195
2201 corr    1.00  -.132  -.204  -.162  -.284  -.166  -.189  .294  -.339  -.094  -.218  -.144  .153  -.246  -.128  -.192  -.239
2202 corr    1.00  .151  .132  .166  .195  .387  -.214  .476  .154  .187  .167  -.236  .410  .316  .370  .245
2203 corr    1.00  .388  .479  .591  .294  -.171  .351  .102  .245  .180  .003  .274  .059  .178  .236
2204 corr    1.00  .408  .437  .276  -.153  .353  .251  .318  .229  -.111  .263  .042  .203  .349
2205 corr    1.00  .467  .234  -.249  .382  .199  .313  .197  -.117  .263  .047  .215  .318
2206 corr    1.00  .368  -.199  .441  .198  .224  .197  -.099  .329  .105  .256  .322
2207 corr    1.00  -.211  .473  .233  .253  .268  -.198  .397  .229  .309  .277
2208 corr    1.00  -.310  -.217  -.312  -.203  .227  -.296  -.260  -.276  -.321
2209 corr    1.00  .368  .350  .311  -.313  .578  .338  .521  .458
2210 corr    1.00  .415  .580  -.588  .545  .497  .635  .683
2211 corr    1.00  .570  -.386  .494  .340  .538  .524
2212 corr    1.00  -.366  .427  .299  .498  .506
2213 corr    1.00  -.684  -.620  -.746  -.568
2214 corr    1.00  .759  .900  .555
2215 corr    1.00  .814  .400
2216 corr    1.00  .621
2217 corr    1.00
2218 end data .
2219
2220 factor  matrix in (cor = *) 
2221     / analysis = cdi_actws_16 rdls_actws_16 cdi_actws_20 cdi_actws_26 rdls_actws_26 bnt_actws_36 bnt_actws_56 
2222     / format = default
2223     / criteria = factors (1)
2224     / extraction = pc
2225     / rotation = norotate
2226     / print = initial extraction .
2227
2228 ])
2229
2230 AT_CHECK([pspp -O format=csv correlation-matrix.sps], [0], [dnl
2231 Table: Communalities
2232 ,Initial,Extraction
2233 cdi_actws_16,1.000,.614
2234 rdls_actws_16,1.000,.660
2235 cdi_actws_20,1.000,.695
2236 cdi_actws_26,1.000,.650
2237 rdls_actws_26,1.000,.536
2238 bnt_actws_36,1.000,.443
2239 bnt_actws_56,1.000,.316
2240
2241 Table: Total Variance Explained
2242 ,Initial Eigenvalues,,,Extraction Sums of Squared Loadings,,
2243 ,Total,% of Variance,Cumulative %,Total,% of Variance,Cumulative %
2244 1,3.914,55.9%,55.9%,3.914,55.9%,55.9%
2245 2,1.320,18.9%,74.8%,,,
2246 3,.716,10.2%,85.0%,,,
2247 4,.422,6.0%,91.0%,,,
2248 5,.278,4.0%,95.0%,,,
2249 6,.216,3.1%,98.1%,,,
2250 7,.135,1.9%,100.0%,,,
2251
2252 Table: Component Matrix
2253 ,Component
2254 ,1
2255 cdi_actws_16,.784
2256 rdls_actws_16,.812
2257 cdi_actws_20,.834
2258 cdi_actws_26,.806
2259 rdls_actws_26,.732
2260 bnt_actws_36,.666
2261 bnt_actws_56,.562
2262 ])
2263
2264 AT_CLEANUP
2265
2266
2267 AT_SETUP([FACTOR bad input])
2268
2269 dnl Test for a crash 
2270 AT_DATA([bad-input.sps], [dnl
2271 set format = F10.3.
2272 MATRIX DATA VARIABLES S1 ROWTYPE_ V1 TO V3 /SPLIT=S1.
2273 BEGIN DATA
2274 0 MEAN 2 4 3
2275 0 SD 1 2 3
2276 0 N 9 9 9
2277 0 KORR 1
2278 0 CORV .6 1
2279 0 CORR .7 .8 1
2280 1 MEAN 9 8 7
2281 1 SD 5 6 7
2282 1 N 9 9 9
2283 1 CORR 1
2284 X CORR .4 1
2285 1 CORR .3 .2 1
2286 END DATA.
2287
2288 EXECUTE.
2289
2290 FACTOR MATRIX IN (CORR =!*)
2291        /PRINT = CORRELATION
2292        .
2293 ])
2294
2295 AT_CHECK([pspp -O format=csv bad-input.sps], [1], [ignore])
2296
2297 AT_CLEANUP
2298
2299
2300 AT_SETUP([FACTOR anti-image matrix])
2301
2302 AT_DATA([anti-image-matrix.sps], [dnl
2303 SET FORMAT=F20.3 .
2304 matrix data
2305  variables = rowtype_ viq piq pa ran piatwr  piatc
2306  / n = 476
2307  / format = lower diagonal .
2308 begin data
2309 mean  96.88  100.51  -1.73  -0.94  -2.52 -1.85
2310 sd    10.97   11.19   1.19   0.88   0.85  0.97
2311 corr    1.00
2312 corr    0.38  1.00
2313 corr    0.26  0.24  1.00
2314 corr    0.16  0.17  0.34  1.00
2315 corr    0.25  0.07  0.46  0.38  1.00
2316 corr    0.37  0.22  0.39  0.30  0.59   1.00
2317 end data.
2318
2319 factor matrix = in (cor = *) 
2320  / analysis = viq piq pa ran piatwr piatc
2321  / format = sort 
2322  / extraction = pc
2323  / rotation = norotate
2324  / print = aic
2325 ])
2326
2327 AT_CHECK([pspp -O format=csv anti-image-matrix.sps], [0], [dnl
2328 Table: Anti-Image Matrices
2329 ,,viq,piq,pa,ran,piatwr,piatc
2330 Anti-image Covariance,viq,.762,-.248,-.048,.008,-.031,-.143
2331 ,piq,-.248,.807,-.117,-.081,.108,-.071
2332 ,pa,-.048,-.117,.711,-.125,-.173,-.060
2333 ,ran,.008,-.081,-.125,.808,-.143,-.035
2334 ,piatwr,-.031,.108,-.173,-.143,.551,-.265
2335 ,piatc,-.143,-.071,-.060,-.035,-.265,.581
2336 Anti-image Correlation,viq,.741,-.316,-.066,.011,-.048,-.215
2337 ,piq,-.316,.624,-.154,-.100,.163,-.103
2338 ,pa,-.066,-.154,.811,-.165,-.277,-.093
2339 ,ran,.011,-.100,-.165,.825,-.214,-.051
2340 ,piatwr,-.048,.163,-.277,-.214,.675,-.469
2341 ,piatc,-.215,-.103,-.093,-.051,-.469,.729
2342
2343 Table: Component Matrix
2344 ,Component,,,,
2345 ,1,2,3,4,5
2346 piatc,.774,.122,-.368,.365,-.322
2347 piatwr,.754,.418,.442,.219,-.115
2348 pa,.707,.124,-.117,-.161,.256
2349 piq,.456,-.733,.122,-.289,-.377
2350 viq,.589,-.539,.033,.298,.457
2351 ran,.592,.262,-.069,-.638,.096
2352 ])
2353
2354 AT_CLEANUP
2355
2356
2357 AT_SETUP([FACTOR Kaiser-Meyer-Olkin])
2358
2359 AT_DATA([kmo.sps], [dnl
2360 SET FORMAT=F20.3 .
2361 matrix data
2362  variables = rowtype_ viq piq pa ran piatwr  piatc
2363  / n = 476
2364  / format = lower diagonal .
2365 begin data
2366 mean  96.88  100.51  -1.73  -0.94  -2.52 -1.85
2367 sd    10.97   11.19   1.19   0.88   0.85  0.97
2368 corr    1.00
2369 corr    0.38  1.00
2370 corr    0.26  0.24  1.00
2371 corr    0.16  0.17  0.34  1.00
2372 corr    0.25  0.07  0.46  0.38  1.00
2373 corr    0.37  0.22  0.39  0.30  0.59   1.00
2374 end data.
2375
2376 factor matrix = in (cor = *) 
2377  / analysis = viq piq pa ran piatwr piatc
2378  / extraction = pc
2379  / rotation = norotate
2380  / print = kmo
2381 ])
2382
2383 AT_CHECK([pspp -O format=csv kmo.sps], [0], [dnl
2384 Table: KMO and Bartlett's Test
2385 Kaiser-Meyer-Olkin Measure of Sampling Adequacy,,.730
2386 Bartlett's Test of Sphericity,Approx. Chi-Square,602.673
2387 ,df,15
2388 ,Sig.,.000
2389
2390 Table: Component Matrix
2391 ,Component,,,,
2392 ,1,2,3,4,5
2393 viq,.589,-.539,.033,.298,.457
2394 piq,.456,-.733,.122,-.289,-.377
2395 pa,.707,.124,-.117,-.161,.256
2396 ran,.592,.262,-.069,-.638,.096
2397 piatwr,.754,.418,.442,.219,-.115
2398 piatc,.774,.122,-.368,.365,-.322
2399 ])
2400
2401 AT_CLEANUP