*     LABEL
CVOTCOR
C     SUBROUTINE TO CALCULATE CORRELATION OF ACTUAL WITH PREDICTED VOTE
C
      SUBROUTINE VOTCOR(K1,K2,F,V1,V2)
      DIMENSION V1(48),V2(48),F(48),EF(48)
      AVE=0.
      IRIGHT=0
      DO 399 IX=1,48
      AVE=AVE+ABSF((V1(IX)-V2(IX))/48.)
      X=(V1(IX)-.5)*(V2(IX)-.5)
      IF (X) 399,399,398
 398  IRIGHT=IRIGHT+1
 399  CONTINUE
      PRINT 69,IRIGHT,AVE
 69   FORMAT (1H I4 ,50HSTATES PREDICTED CORRECTLY.AVERAGE ABSOLUTE ERROR=
     1R=     F10.5)
      DO 333 IX=1,48
      V1(IX)=V1(IX)-.5
 333  V2(IX)=V2(IX)-.5
      PRINT 70
C
C     WEIGHTED OR UNWEIGHTED OPTION
C
      INDEX2 = K2
    1 IF (INDEX2-1) 4,2,4
    2 DO 3 I=1,48
    3 EF(I) = F(I)
      PRINT 73
      GO TO 6
    4 DO 5 I=1,48
    5 EF(I) = 1.0
      PRINT 74
C
C     INITIALIZE INDEX AND SUMS
C
    6 INDEX1 = K1
    7 EN = 0.0
      SV1 = 0.0
      SV2 = 0.0
      SV1SQ = 0.0
      SV2SQ = 0.0
      SV1V2 = 0.0
C
C     OPTION TO INCLUDE OR EXCLUDE SOUTH
C
   10 DO 30 IT=1,48
      IF (INDEX1-2) 20,11,20
   11 ITEM = IT
      IF (ITEM - 5) 30, 30, 14
  14   IF (ITEM - 15) 20, 12, 12
   12 IF (ITEM-25) 30,30,20
C
C     COMPUTE CORRELATION
C
   20 SV1 = SV1 + (EF(IT))*(V1(IT))
      SV2 = SV2 + (EF(IT))*(V2(IT))
      SV1SQ = SV1SQ + ((EF(IT))*((V1(IT))**2))
      SV2SQ = SV2SQ + ((EF(IT))*((V2(IT))**2))
      SV1V2 = SV1V2 + ((EF(IT))*(V1(IT))*(V2(IT)))
      EN = EN + EF(IT)
   30 CONTINUE
      COV = (SV1V2 - (((SV1)(SV2))/(EN)))**2
      SIG1 = SV1SQ - (((SV1)**2)/(EN))
      SIG2 = SV2SQ - (((SV2)**2)/(EN))
      RSQD = (COV)/((SIG1)*(SIG2))
      R = SQRTF(RSQD)
C
C     PRINT R AND REPEAT IF NECESSARY
C
      IF (INDEX1-2) 40,50,60
   40 PRINT 71, R
      GO TO 100
   50 PRINT 72, R
      GO TO 100
   60 PRINT 71, R
      INDEX1 = 2
      GO TO 7
  100 IF (INDEX2-1) 102,102,101
  101 INDEX2 = 1
      GO TO 1
   70 FORMAT (50H CORRELATION OF ACTUAL WITH PREDICTED KENNEDY VOTE)
   71 FORMAT (37H FOR ALL 48 STATES INCLUDING SOUTH ISF7.4)
   72 FORMAT(47H FOR THE 32 NON-SOUTHERN OR BORDER STATES IS...F7.4)
   73 FORMAT (33H WITH EACH STATE WEIGHTED BY SIZE)
   74 FORMAT (33H WITH EACH STATE WEIGHTED EQUALLY)
 102  DO 444 IX=1,48
      V1(IX)=V1(IX)+.5
 444  V2(IX)=V2(IX)+.5
      RETURN
      END
File Name: box5batch12.bin, Fingerprint: 8f207c-31c979
