1TEST OF PERFECT UNIDIMENSIONAL SCALE                                           
C     MSA3                                                              MS3   1 
C     A GENERAL NONMETRIC TECHNIQUE FOR MULTIDIMENSIONAL SCALOGRAM      MS3   2 
C     ANALYSIS WITH PARALLEL OR NON-PARALLEL STRAIGHT LINE BOUNDARIES.  MS3   3 
C     THIS RESEARCH IN NONMETRIC METHODS IS SUPPORTED IN PART BY A GRANTMS3   4 
C     TO L. GUTTMAN & J.C. LINGOES FROM THE NATIONAL SCIENCE FOUNDATION MS3   5 
C     (GS-929).  PROGRAMMED FOR THE UNIVERSITY OF MICHIGAN IBM 360/67   MS3   6 
C     COMPUTER IN FORTRAN IV BY LINGOES (12/15/67).                     MS3   7 
C                                                                       MS3   8 
C     DECK SET-UP FOR G-L(MSA-III) -                                    MS3   9 
C                                                                       MS3  10 
C        1.   SYSTEM ID CARD/S.                                         MS3  11 
C        2.   BINARY PROGRAM.                                           MS3  12 
C        3.   TITLE CARD (PUNCH A 1 IN COLUMN 1 AND ANY BCD TITLE IN COLMS3  13 
C             -UMNS 2 TO 72, WHICH WILL BE PRINTED OUT FOR EACH PAGE OF MS3  14 
C             OUTPUT).                                                  MS3  15 
C        4.   PARAMETER CARD, 6 4-COLUMN FIELDS CONTAINING THE FOLLOW-  MS3  16 
C             ING INFORMATION SERIATUM -                                MS3  17 
C             A)  NS=NUMBER OF SUBJECTS,I.E.,ROWS OF MATRIX,            MS3  18 
C             B)  NV=NUMBER OF VARIABLES,I.E.,COLUMNS OF MATRIX,        MS3  19 
C             C)  NC=TOTAL NUMBER OF CATEGORIES OVER ALL VARIABLES      MS3  20 
C                 NC+NS .LE. 100,                                       MS3  21 
C             D)  MIND=0 IF PROGRAM IS TO DETERMINE MINIMUM DIMENSIONAL-MS3  22 
C                 ITY OF PROBLEM, OTHERWISE MIND=MINIMUM NUMBER OF DI-  MS3  23 
C                 MENSIONS DESIRED .LE. MAXD (V.I.),                    MS3  24 
C             E)  MAXD=MAXIMUM NUMBER OF DIMENSIONS DESIRED .LE. 10,    MS3  25 
C             F)  IFP=1 IF PARALLEL BOUNDARIES DESIRED, OTHERWISE LEAVE         
C                 BLANK OR SET TO ZERO.                                         
C        5.   FORMAT CARD (DESCRIBING IN I-NOTATION WHERE DATA APPEARS  MS3  26 
C             ON THE CARDS).                                            MS3  27 
C        6.   DATA (PUNCH THE CATEGORY NUMERIC CODE CORRESPONDING TO THEMS3  28 
C             CATEGORY IN WHICH THE S FALLS. A SET OF CARDS REPRESENTS  MS3  29 
C             ONE ROW AND FIELDS ON THE CARD/S REPRESENT COLUMNS OF     MS3  30 
C             DATA MATRIX. AT LEAST ONE SUBJECT MUST FALL IN EVERY CATE-MS3  31 
C             GORY. ONLY INTEGERS (.GE.1) ARE TO BE USED).              MS3  32 
C        7.   REPEAT ITEMS 3-6 FOR ADDITIONAL RUNS.                     MS3  33 
C                                                                       MS3  34 
C     *** REFERENCES - LINGOES, J.C.  AN IBM-7090 PROGRAM FOR GUTTMAN-  MS3  35 
C                        LINGOES MULTIDIMENSIONAL SCALOGRAM ANALYSIS    MS3  36 
C                        - II.  BEHAV.SCI.,1967,12,268-270.             MS3  37 
C                      LINGOES, J.C.  THE MULTIVARIATE ANALYSIS OF QUAL-MS3  38 
C                        ITATIVE DATA.  MULT. BEHAV. RES., 1968,3,61-94.MS3  39 
C                      LINGOES, J. C.  AN IBM 360/67 PROGRAM FOR GUTTMANMS3  40 
C                        -LINGOES MULTIDIMENSIONAL SCALOGRAM ANALYSIS - MS3  41 
C                        III.  BEHAV. SCI., 1968, 13,512-513.           MS3  42 
C                                                                       MS3  43 
      DIMENSION C(100,100), RHO(100,100), X(100,10), STR(100), FMT(18),DMS3  44 
     1IST(2500),INDI(2500),DSTR(2500),NAT(100,100),MAT(100,100),NERR(50)MS3  45 
      EQUIVALENCE (C,NAT), (RHO,MAT)                                    MS3  47 
C                                                                       MS3  48 
C     *** SUBROUTINES NEEDED=EIGEN, PLOT, AND MSL.                      MS3  49 
C                                                                       MS3  50 
C     TAPE ASSIGNMENTS                                                  MS3  51 
      ITAPE=5                                                           MS3  52 
      JTAPE=6                                                           MS3  53 
C     SUBROUTINE DIMENSIONING                                           MS3  54 
      MD=100                                                            MS3  55 
      MD3=3*MD+1                                                                
      MD4=MD3+MD                                                                
      MD5=MD4+MD                                                                
      MD6=MD5+MD                                                                
      MD7=MD6+MD                                                                
      ND=10                                                             MS3  56 
C     INPUT TITLE,PARAMETERS,AND DATA                                   MS3  57 
1     WRITE (JTAPE,96)                                                          
      READ (ITAPE,86)                                                   MS3  58 
      READ (ITAPE,87) NS,NV,NC,MIND,MAXD,IFP                            MS3  59 
      READ (ITAPE,88) (FMT(J),J=1,18)                                   MS3  60 
      DO 2 I=1,NS                                                       MS3  61 
2     READ (ITAPE,FMT) (MAT(I,J),J=1,NV)                                MS3  62 
C     DETERMINE IF CAPACITY EXCEEDED                                    MS3  63 
      NC=0                                                              MS3  64 
      DO 5 J=1,NV                                                       MS3  65 
      NERR(J)=0                                                         MS3  66 
      DO 4 I=1,NS                                                       MS3  67 
      IF (NERR(J)-MAT(I,J)) 3,4,4                                       MS3  68 
3     NERR(J)=MAT(I,J)                                                  MS3  69 
4     CONTINUE                                                          MS3  70 
5     NC=NC+NERR(J)                                                     MS3  71 
      IF (NC+NS-MD) 7,7,6                                               MS3  72 
C     *** CHANGE IN DIMENSION STATEMENT REQUIRES CHANGE IN FORMAT REF-          
C     ERENCED IN FOLLOWING STATEMENT ***                                        
6     WRITE (JTAPE,89)                                                  MS3  73 
      GO TO 1                                                           MS3  74 
C     CONSTRUCT MATRIX FOR FINDING INITIAL CONFIGURATION                MS3  75 
7     DO 11 I=1,NS                                                      MS3  76 
      DO 8 J=1,NC                                                       MS3  77 
8     NAT(1,J)=0                                                        MS3  78 
      JJ=0                                                              MS3  79 
      DO 9 K=1,NV                                                       MS3  80 
      LL=MAT(I,K)+JJ                                                    MS3  81 
      NAT(1,LL)=1                                                       MS3  82 
9     JJ=JJ+NERR(K)                                                     MS3  83 
      DO 10 L=1,NC                                                      MS3  84 
10    MAT(I,L)=NAT(1,L)                                                 MS3  85 
11    CONTINUE                                                          MS3  86 
C     INITIALIZATION                                                    MS3  87 
      KK=NC+NS                                                          MS3  88 
      NSP1=NS+1                                                         MS3  89 
      NCNS=NC*NS                                                        MS3  90 
      NCNSP1=NCNS+1                                                     MS3  91 
      NSNV=NS*NV                                                        MS3  92 
      NSNVP1=NSNV+1                                                     MS3  93 
      FNSNV=NSNV                                                        MS3  94 
      FNC=NC                                                            MS3  95 
      FNS=NS                                                            MS3  96 
      FN=KK                                                             MS3  97 
      LFACT=1                                                           MS3  98 
      ITER=100                                                          MS3  99 
      PRESTR=1.                                                         MS3 100 
      RHO(NSP1,1)=KK*(KK-1)                                             MS3 101 
      RHO(NSP1,2)=NSNVP1                                                MS3 102 
      RHO(NSP1,2)=1.-RHO(NSP1,2)/RHO(NSP1,1)                            MS3 103 
      RHO(NSP1,3)=NS*(NV+NC)+1                                          MS3 104 
      RHO(NSP1,3)=1.-RHO(NSP1,3)/RHO(NSP1,1)                            MS3 105 
      RHO(NSP1,4)=NCNSP1                                                MS3 106 
      RHO(NSP1,4)=.5-RHO(NSP1,4)/RHO(NSP1,1)                            MS3 107 
      JJ=NS-1                                                           MS3 108 
      DO 12 I=1,JJ                                                      MS3 109 
      IP1=I+1                                                           MS3 110 
      DO 12 J=IP1,NS                                                    MS3 111 
      C(I,J)=RHO(NSP1,4)                                                MS3 112 
12    C(J,I)=C(I,J)                                                     MS3 113 
      JJ=KK-1                                                           MS3 114 
      DO 13 I=NSP1,JJ                                                   MS3 115 
      IP1=I+1                                                           MS3 116 
      DO 13 J=IP1,KK                                                    MS3 117 
      C(I,J)=RHO(NSP1,4)                                                MS3 118 
13    C(J,I)=C(I,J)                                                     MS3 119 
      LL=0                                                              MS3 120 
      DO 16 I=1,NS                                                      MS3 121 
      DO 16 J=1,NC                                                      MS3 122 
      LL=LL+1                                                           MS3 123 
      JJ=NS+J                                                           MS3 124 
      IF (MAT(I,J)) 15,14,15                                            MS3 125 
14    C(I,JJ)=RHO(NSP1,3)                                               MS3 126 
      C(JJ,I)=C(I,JJ)                                                   MS3 127 
      INDI(LL)=0                                                        MS3 128 
      GO TO 16                                                          MS3 129 
15    C(I,JJ)=RHO(NSP1,2)                                               MS3 130 
      C(JJ,I)=C(I,JJ)                                                   MS3 131 
      INDI(LL)=1                                                        MS3 132 
16    CONTINUE                                                          MS3 133 
      DO 18 I=1,KK                                                      MS3 134 
      C(I,I)=FN                                                         MS3 135 
      DO 18 J=1,KK                                                      MS3 136 
      IF (I-J) 17,18,17                                                 MS3 137 
17    C(I,I)=C(I,I)-C(I,J)                                              MS3 138 
18    CONTINUE                                                          MS3 139 
C     CALL ON HOUSEHOLDER SUBROUTINE                                    MS3 140 
      JJ=MAXD+1                                                         MS3 141 
      CALL EIGEN (C,RHO,KK,STR,JJ,MD,X(1,1),X(1,4),X(1,5),X(1,6),X(1,7),MS3 142 
     1X(1,8))                                                           MS3 143 
      DO 19 J=2,JJ                                                      MS3 144 
      STR(J-1)=STR(J)                                                   MS3 145 
      DO 19 I=1,KK                                                      MS3 146 
19    X(I,J-1)=RHO(I,J)                                                 MS3 147 
C     DETERMINE IF UPPER-BOUND IS TO BE ESTIMATED                       MS3 148 
      IF (MIND) 27,20,27                                                MS3 149 
20    A0=FN/2.                                                          MS3 150 
      JJ=0                                                              MS3 151 
      DO 22 J=1,MAXD                                                    MS3 152 
      IF (STR(J)-A0) 23,21,21                                           MS3 153 
21    JJ=JJ+1                                                           MS3 154 
22    CONTINUE                                                          MS3 155 
23    IF (JJ) 25,24,25                                                  MS3 156 
24    MAXD=1                                                            MS3 157 
      GO TO 26                                                          MS3 158 
25    MAXD=JJ                                                           MS3 159 
26    MIND=MAXD                                                         MS3 160 
      LFACT=0                                                           MS3 161 
      ITER=25                                                           MS3 162 
27    M=MIND-1                                                          MS3 163 
C     LEAST-SQUARES-RANK-IMAGES ITERATIONS                              MS3 164 
28    NITER=0                                                           MS3 165 
      M=M+1                                                             MS3 166 
29    NITER=NITER+1                                                     MS3 167 
      ITCT=0                                                            MS3 168 
      M1=2                                                              MS3 169 
30    JJ=0                                                              MS3 170 
      IF (M.EQ.1.OR.ITCT.LT.5.OR.IFP.EQ.0) GO TO 31                     MS3 171 
C     DETERMINE MULTIDIMENSIONAL STRAIGHT LINE                          MS3 172 
      CALL MSL (X,C,C(1,11),NERR,M,KK,NV,NSP1)                          MS3 173 
C     COMPUTE DISTANCES                                                 MS3 174 
31    DO 33 I=1,NS                                                      MS3 175 
      DO 33 J=NSP1,KK                                                   MS3 176 
      JJ=JJ+1                                                           MS3 177 
      DIST(JJ)=0.                                                       MS3 178 
      DO 32 K=1,M                                                       MS3 179 
32    DIST(JJ)=DIST(JJ)+(X(I,K)-X(J,K))**2                              MS3 180 
33    DIST(JJ)=SQRT(DIST(JJ))                                           MS3 181 
C     COMPUTE ERRORS AND RANK IMAGES                                    MS3 182 
      MM=0                                                              MS3 183 
      JJ=0                                                              MS3 184 
      DO 39 I=1,NS                                                      MS3 185 
      DO 39 J=1,NV                                                      MS3 186 
      II=JJ+1                                                           MS3 187 
      JJ=JJ+NERR(J)                                                     MS3 188 
      A=10000.                                                          MS3 189 
      DO 36 K=II,JJ                                                     MS3 190 
      IF (INDI(K)) 34,35,34                                             MS3 191 
34    NN=K                                                              MS3 192 
35    IF (DIST(K).GE.A) GO TO 36                                        MS3 193 
      A=DIST(K)                                                         MS3 194 
      LL=K                                                              MS3 195 
36    CONTINUE                                                          MS3 196 
      DO 37 K=II,JJ                                                     MS3 197 
37    DSTR(K)=DIST(K)                                                   MS3 198 
      IF (INDI(LL)) 39,38,39                                            MS3 199 
38    DSTR(LL)=DIST(NN)                                                 MS3 200 
      DSTR(NN)=DIST(LL)                                                 MS3 201 
      MM=MM+1                                                           MS3 202 
39    CONTINUE                                                          MS3 203 
      GL=FLOAT(MM)                                                      MS3 204 
      ITCT=ITCT+1                                                       MS3 205 
      IF (ITCT-5) 42,42,40                                              MS3 206 
40    M1=1                                                              MS3 207 
      STR(NITER)=0.                                                     MS3 208 
C     COMPUTE LOSS FUNCTION                                             MS3 209 
      A=0.                                                              MS3 210 
      DO 41 J=1,NCNS                                                    MS3 211 
      A=A+DIST(J)**2                                                    MS3 212 
41    STR(NITER)=STR(NITER)+(DIST(J)-DSTR(J))**2                        MS3 213 
      STR(NITER)=STR(NITER)/(2.*A)                                      MS3 214 
      IF (NITER-6) 42,55,55                                             MS3 215 
C     COMPUTE C-MATRIX                                                  MS3 216 
42    JJ=0                                                              MS3 217 
      DO 43 J=1,NS                                                      MS3 218 
      DO 43 I=NSP1,KK                                                   MS3 219 
      JJ=JJ+1                                                           MS3 220 
43    C(I,J)=DSTR(JJ)/DIST(JJ)                                          MS3 221 
      DO 44 I=NSP1,KK                                                   MS3 222 
      C(I,I)=FNC                                                        MS3 223 
      DO 44 J=1,NS                                                      MS3 224 
44    C(I,I)=C(I,I)+C(I,J)                                              MS3 225 
      DO 45 J=1,NS                                                      MS3 226 
      C(J,J)=FNS                                                        MS3 227 
      DO 45 I=NSP1,KK                                                   MS3 228 
45    C(J,J)=C(J,J)+C(I,J)                                              MS3 229 
      DO 46 I=NSP1,KK                                                   MS3 230 
      DO 46 J=1,NS                                                      MS3 231 
46    C(I,J)=1.-C(I,J)                                                  MS3 232 
C     APPLY CORRECTIONS                                                 MS3 233 
      DO 54 K=1,M                                                       MS3 234 
      DO 53 I=1,KK                                                      MS3 235 
      RHO(I,1)=X(I,K)*C(I,I)                                            MS3 236 
      IF (I-NS) 47,47,50                                                MS3 237 
47    DO 49 J=NSP1,KK                                                   MS3 238 
      IF (C(J,I)) 48,49,48                                              MS3 239 
48    RHO(I,1)=RHO(I,1)+X(J,K)*C(J,I)                                   MS3 240 
49    CONTINUE                                                          MS3 241 
      GO TO 53                                                          MS3 242 
50    DO 52 L=1,NS                                                      MS3 243 
      IF (C(I,L)) 51,52,51                                              MS3 244 
51    RHO(I,1)=RHO(I,1)+X(L,K)*C(I,L)                                   MS3 245 
52    CONTINUE                                                          MS3 246 
53    RHO(I,1)=RHO(I,1)/FN                                              MS3 247 
      DO 54 N=1,KK                                                      MS3 248 
54    X(N,K)=RHO(N,1)                                                   MS3 249 
      GO TO (29,30), M1                                                 MS3 250 
C     DETERMINE IF FINISHED                                             MS3 251 
55    IF (STR(NITER-5)-STR(NITER)-1E-06) 57,57,56                       MS3 252 
56    IF (NITER-ITER) 42,57,42                                          MS3 253 
57    IF (LFACT) 58,60,58                                               MS3 254 
58    IF (PRESTR-STR(NITER)) 1,1,59                                     MS3 255 
59    PRESTR=STR(NITER)                                                 MS3 256 
C     CALCULATE STATISTICS AND PRINT TITLE                              MS3 257 
60    R=1.-GL/FNSNV                                                     MS3 258 
      CAL=SQRT(1.-(1.-STR(NITER))**2)                                   MS3 259 
      WRITE (JTAPE,86)                                                  MS3 260 
      WRITE (JTAPE,90) M,(MM,MM=1,10)                                   MS3 261 
      IF (M-1) 61,65,61                                                 MS3 262 
C     PRINCIPAL AXIS ROTATION OF FULL SPACE                             MS3 263 
61    DO 63 I=1,KK                                                      MS3 264 
      DO 63 J=I,KK                                                      MS3 265 
      C(I,J)=0.                                                         MS3 266 
      DO 62 K=1,M                                                       MS3 267 
62    C(I,J)=C(I,J)+X(I,K)*X(J,K)                                       MS3 268 
63    C(J,I)=C(I,J)                                                     MS3 269 
C     CALL ON HOUSEHOLDER SUBROUTINE                                    MS3 270 
      CALL EIGEN (C,RHO,KK,STR,M,MD,DSTR(1),DSTR(MD3),DSTR(MD4),DSTR(MD5MS3 271 
     1),DSTR(MD6),DSTR(MD7))                                            MS3 272 
      DO 64 K=1,M                                                       MS3 273 
      DO 64 I=1,KK                                                      MS3 274 
64    X(I,K)=RHO(I,K)                                                   MS3 275 
      GO TO 67                                                          MS3 276 
65    DO 66 I=1,KK                                                      MS3 277 
66    RHO(I,1)=X(I,1)                                                   MS3 278 
C     SCALE ROTATED VECTORS AND PRINT                                   MS3 279 
67    A0=0.                                                             MS3 280 
      DO 69 K=1,M                                                       MS3 281 
      C(1,K)=RHO(1,K)                                                   MS3 282 
      C(2,K)=RHO(1,K)                                                   MS3 283 
      DO 68 I=2,KK                                                      MS3 284 
      C(1,K)=AMIN1(C(1,K),RHO(I,K))                                     MS3 285 
68    C(2,K)=AMAX1(C(2,K),RHO(I,K))                                     MS3 286 
69    A0=AMAX1(A0,(C(2,K)-C(1,K)))                                      MS3 287 
      A0=2./A0                                                          MS3 288 
      DO 70 K=1,M                                                       MS3 289 
      DO 70 I=1,KK                                                      MS3 290 
70    RHO(I,K)=A0*(RHO(I,K)-C(1,K))-1.                                  MS3 291 
      DO 71 I=1,NS                                                      MS3 292 
71    WRITE (JTAPE,91) I,(RHO(I,K),K=1,M)                               MS3 293 
      WRITE (JTAPE,95)                                                  MS3 294 
      DO 72 K=NSP1,KK                                                   MS3 295 
72    WRITE (JTAPE,91) K,(RHO(K,J),J=1,M)                               MS3 296 
      WRITE (JTAPE,92) R,CAL,NITER                                      MS3 297 
C     REPRODUCE SCORE MATRIX AND PRINT                                  MS3 298 
      WRITE (JTAPE,93) (MM,MM=1,30)                                     MS3 299 
      JJ=0                                                              MS3 300 
      DO 76 I=1,NS                                                      MS3 301 
      DO 75 J=1,NV                                                      MS3 302 
      II=JJ+1                                                           MS3 303 
      JJ=JJ+NERR(J)                                                     MS3 304 
      A0=10000.                                                         MS3 305 
      LL=0                                                              MS3 306 
      DO 74 K=II,JJ                                                     MS3 307 
      LL=LL+1                                                           MS3 308 
      IF (DIST(K)-A0) 73,74,74                                          MS3 309 
73    A0=DIST(K)                                                        MS3 310 
      MM=LL                                                             MS3 311 
74    CONTINUE                                                          MS3 312 
75    NAT(J,1)=MM                                                       MS3 313 
76    WRITE (JTAPE,94) I,(NAT(L,1),L=1,NV)                              MS3 314 
      IF (M-1) 77,84,77                                                 MS3 315 
C     CALL PLOT SUBROUTINE                                              MS3 316 
77    CALL PLOT (RHO,C(1,1),C(1,2),C(1,3),C(1,4),C(1,5),KK,M,MD,ND)     MS3 317 
      IF (LFACT) 84,78,84                                               MS3 318 
C     IF GOING DOWN - DROP VECTORS                                      MS3 319 
78    JJ=1                                                              MS3 320 
      DO 80 J=2,M                                                       MS3 321 
      A1=STR(J)/STR(1)                                                  MS3 322 
      IF (A1-.3) 81,81,79                                               MS3 323 
79    JJ=JJ+1                                                           MS3 324 
80    CONTINUE                                                          MS3 325 
81    IF (M-JJ) 82,1,82                                                 MS3 326 
82    M=JJ-1                                                            MS3 327 
      MAXD=JJ                                                           MS3 328 
      IF (ITER-100) 83,28,83                                            MS3 329 
83    ITER=ITER+25                                                      MS3 330 
      GO TO 28                                                          MS3 331 
C     IF FINISHED - DO NEXT PROBLEM, OTHERWISE REPEAT WITH NEW M        MS3 332 
84    IF (M-MAXD) 85,1,85                                               MS3 333 
85    IF (1E-04-CAL) 28,1,1                                             MS3 334 
C     *** FORMAT STATEMENTS ***                                         MS3 335 
C                                                                       MS3 336 
86    FORMAT (72H                                                       MS3 337 
     1                 )                                                MS3 338 
87    FORMAT (6I4)                                                      MS3 339 
88    FORMAT (18A4)                                                     MS3 340 
89    FORMAT (55H0PROGRAM CAPACITY EXCEEDED.  NC + NS .G. 100. CHECK NC.MS3 341 
     1)                                                                 MS3 342 
90    FORMAT (33H0G-L(MSA-III) COORDINATES FOR M =,I3,1H./10H0DIMENSION,MS3 343 
     110I10/1H ,130(1H-)/9H0 PERSON )                                   MS3 344 
91    FORMAT (I5,5X2P10F10.3)                                           MS3 345 
92    FORMAT (33H0COEFFICIENT OF REPRODUCIBILITY =F6.3/28H COEFFICIENT OMS3 346 
     1F ALIENATION =E12.6,4H FOR,I4,12H ITERATIONS.)                    MS3 347 
93    FORMAT (1H1,50X31HMSA-III REPRODUCED SCORE MATRIX/58X17HV A R I A MS3 348 
     1B L E S/8H SUBJECT,2X30I4/1H ,131(1H-))                           MS3 349 
94    FORMAT (I5,5X30I4)                                                MS3 350 
95    FORMAT (9H0CATEGORY)                                              MS3 351 
96    FORMAT ('1')                                                              
      END                                                               MS3 352-
C     MSL                                                               MSL   1 
C     SUBROUTINE TO COMPUTE COORDINATES OF POINTS TO A BEST-FIT STRAIGHTMSL   2 
C     LINE IN M-DIMENSIONAL SPACE.  PROGRAMMED FOR THE IBM 360/67 AT THEMSL   3 
C     U. OF M. COMPUTING CENTER BY LINGOES/CHAPMAN - 12/15/67.          MSL   4 
C                                                                       MSL   5 
      SUBROUTINE MSL (X,Y,P,NCAT,M,N,NV,NSP1)                           MSL   6 
      DIMENSION X(100,10), Y(100,100), P(1), NCAT(1)                    MSL   7 
C                                                                       MSL   8 
      DO 1 J=1,M                                                        MSL   9 
      DO 1 I=NSP1,N                                                     MSL  10 
1     Y(I,J)=X(I,J)                                                     MSL  11 
      I1=NSP1                                                           MSL  12 
      I0=I1-1                                                           MSL  13 
      DO 12 II=1,NV                                                     MSL  14 
      I0=I0+NCAT(II)                                                    MSL  15 
      IF (NCAT(II).LT.3) GO TO 12                                       MSL  16 
      PSI=0.                                                            MSL  17 
      P(I1)=0.                                                          MSL  18 
      ITCT=0                                                            MSL  19 
      FN=NCAT(II)                                                       MSL  20 
      I2=I1+1                                                           MSL  21 
2     CHI=0.                                                            MSL  22 
      DO 10 L=1,M                                                       MSL  23 
      DO 4 I=I2,I0                                                      MSL  24 
      P(I)=0.                                                           MSL  25 
      DO 3 J=1,M                                                        MSL  26 
3     P(I)=P(I)+(Y(I1,J)-Y(I,J))**2                                     MSL  27 
4     P(I)=SQRT(P(I))                                                   MSL  28 
      SUMS=0.                                                           MSL  29 
      SUMSSQ=0.                                                         MSL  30 
      B=0.                                                              MSL  31 
      SUMSY=0.                                                          MSL  32 
      DO 5 K=I2,I0                                                      MSL  33 
      SUMS=SUMS+P(K)                                                    MSL  34 
      SUMSSQ=SUMSSQ+P(K)**2                                             MSL  35 
      B=B+Y(K,L)                                                        MSL  36 
5     SUMSY=SUMSY+Y(K,L)*P(K)                                           MSL  37 
      B=B+Y(I1,L)                                                       MSL  38 
      DEN=FN*SUMSSQ-SUMS**2                                             MSL  39 
      IF (DEN) 6,6,7                                                    MSL  40 
6     A=B/SUMS                                                          MSL  41 
      B=0.                                                              MSL  42 
      GO TO 8                                                           MSL  43 
7     A=(FN*SUMSY-SUMS*B)/DEN                                           MSL  44 
      B=(B*SUMSSQ-SUMS*SUMSY)/DEN                                       MSL  45 
8     DO 9 K=I2,I0                                                      MSL  46 
9     Y(K,L)=A*P(K)+B                                                   MSL  47 
      Y(I1,L)=B                                                         MSL  48 
10    CONTINUE                                                          MSL  49 
      DO 11 J=1,M                                                       MSL  50 
      DO 11 I=I1,I0                                                     MSL  51 
11    CHI=CHI+(X(I,J)-Y(I,J))**2                                        MSL  52 
      IF (ABS(CHI-PSI).LE.1E-04) GO TO 12                               MSL  53 
      PSI=CHI                                                           MSL  54 
      ITCT=ITCT+1                                                       MSL  55 
      IF (ITCT.LT.10) GO TO 2                                           MSL  56 
12    I1=I1+NCAT(II)                                                    MSL  57 
      DO 13 J=1,M                                                       MSL  58 
      DO 13 I=NSP1,N                                                    MSL  59 
13    X(I,J)=Y(I,J)                                                     MSL  60 
      RETURN                                                            MSL  61 
      END                                                               MSL  62-
   7   3   9   1   1                                                            
(3I1)                                                                           
333                                                                             
332                                                                             
322                                                                             
222                                                                             
221                                                                             
211                                                                             
111                                                                             
1TEST OF PERFECT UNIDIMENSIONAL SCALE                                           
   7   3   9   2   2   1                                                        
(3I1)                                                                           
333                                                                             
332                                                                             
322                                                                             
222                                                                             
221                                                                             
211                                                                             
111                                                                             
1MSA-III OF BELL-SIRJAMAKI STUDY OF TYPES OF GROUPS.                            
   7   5   1   2   2   1                                                        
(7I1)                                                                           
11211                                                                           
11122                                                                           
22222                                                                           
42423                                                                           
44423                                                                           
33312                                                                           
23322                                                                           
1MSA-II OF HALL AND LINDZEY THEORISTS.                                          
  17  18  54   4   4   3                                                        
(18I1)                                                                          
333213333212321321                                                      FREUD   
323333333332223333                                                      MURPHY  
112113312111111211                                                      EYSENCK 
121113313313111311                                                      SHELDON 
311223211313231313                                                      ALLPORT 
311121211321331311                                                      GOLDSTEI
123231133111112232                                                      D + M   
223233322112132313                                                      CATTELL 
321112333233233231                                                      ADLER   
321121112322332111                                                      ROGERS  
332122122222233131                                                      HORNEY  
322122222222223131                                                      FROMM   
332113321312221312                                                      JUNG    
322322223332333232                                                      SULLIVAN
321123213321331211                                                      ANGYAL  
312122111133323123                                                      LEWIN   
332113233332322333                                                      MURRAY  
