POLS 6386 MEASUREMENT THEORY
Ninth Assignment
Due 1 April 2003
WALLACE 1.2646 0.5154 217.4823 0.5541 1242.0000 HUMPHREY -0.5559 0.3738 114.7892 0.6968 1252.0000 NIXON 0.1480 -0.5415 123.2209 0.5319 1250.0000 MCCARTHY -0.6251 -0.4938 151.8926 0.3854 1204.0000 REAGAN 0.3080 -0.8895 131.8091 0.4380 1212.0000 ROCKEFELLER -0.5579 -0.5995 148.1413 0.3724 1229.0000 LBJ -0.5223 0.4905 147.0334 0.5573 1253.0000 ROMNEY -0.4736 -0.7866 111.3147 0.3434 1167.0000 R.KENNEDY -0.4245 0.2351 148.8571 0.5418 1242.0000 MUSKIE -0.6611 0.1660 126.0836 0.4862 1177.0000 AGNEW 0.2341 -0.8706 114.1418 0.4675 1180.0000 LEMAY 1.1901 0.4267 174.3242 0.4601 1188.0000 1681 -0.0285 0.2555 0.7918 0.6824 12.0000 1124 -0.1768 0.2692 1.4788 0.6992 12.0000 78 0.5707 -0.1514 3.5611 0.2141 12.0000 553 0.1376 0.1064 0.1597 0.7047 9.0000 7 0.2542 0.1235 1.2634 0.0116 12.0000 412 0.2781 0.0867 0.1024 0.6197 12.0000 631 0.5017 0.1088 1.1196 0.0742 12.0000 1316 0.2175 -0.5842 1.1568 0.8577 12.0000 etc etc etc etc etc etc And the first 20 lines of the coordinate output file for the 2000 election were: CLINTON -0.7879 -0.0317 153.1404 0.7198 1477.0000 GORE -0.7133 -0.1701 112.1776 0.7061 1468.0000 BUSH 0.8234 -0.2492 149.4325 0.5889 1458.0000 BUCHANAN 0.4576 1.0536 178.0645 0.3114 1246.0000 NADER -0.2737 0.7599 174.6307 0.2645 1094.0000 MCCAIN 0.2850 -0.6498 122.5794 0.3691 1182.0000 BRADLEY -0.0780 -0.7509 106.1498 0.3689 1088.0000 LIEBERMAN -0.3428 -0.6394 107.1314 0.4758 1096.0000 CHENEY 0.7002 -0.4687 107.9753 0.5099 1147.0000 HILLARY -0.8617 0.0625 203.7540 0.6459 1466.0000 DEMPARTY -0.6788 -0.1713 112.8208 0.6861 1453.0000 REPUBPARTY 0.8235 -0.3286 142.8395 0.5546 1447.0000 REFORMPTY 0.1644 1.0398 132.9094 0.3140 1128.0000 PARTIES 0.1949 -0.7946 158.0865 0.2290 1413.0000 1 0.3666 -0.0534 1.2943 0.3584 12.0000 2 -0.2740 0.6767 2.5447 0.5465 12.0000 4 0.0094 0.0645 0.8008 0.0000 14.0000 5 0.5073 -0.0010 1.3888 0.6249 14.0000 7 0.2719 0.0294 0.3600 0.5458 14.0000 8 -0.6582 -0.2931 1.8168 0.7683 14.0000 etc etc etc etc etc etc
idno Respondent ID Number partyid strength of party id -- 0 to 6 income raw income category race 0 = white, 1 = black, 2 and above, other sex 0 = male, 1 = female south 0 = north, 1 = south education 1 = HS, 2 = SC, 3 = College age age in years married 0 = Not Married, 1 = Married voted 1 = Voted, 5 = Not Voted --------------------------------------- voted for 1968 1 = Humphrey, 2 = Nixon, 3 = Wallace 66 "roll calls" -- wallace-humphrey, wallace-nixon, ... , muskie-agnew, muskie-lemay, agnew-lemay. Yea = first thermometer of a pair is higher than the second; Nay = first thermometer of a pair lower than the second; if tied, treated as non-voting --------------------------------------- voted for 2000 1 = Gore, 2 = Bush, 3 = Other 91 "roll calls" -- clinton-gore, clinton-bush, ... , repubpparty-reformpty, repubparty-parties, reformpty-parties. Yea = first thermometer of a pair is higher than the second; Nay = first thermometer of a pair lower than the second; if tied, treated as non-voting
22 MARCH 2003 17.02.59.18. RANDOM NUMBER SEED 65400 VOTE_THERM_1968.ORD NON-PARAMETRIC MULTIDIMENSIONAL UNFOLDING OF THERMOMETER DATA 2 66 20 40 1 (40A1,3900I1) (I5,1X,40A1,2I5,50F8.3) ****************************************************************************** 1 ROLL CALLS 2 9923 65406 0.15171 0.84829 0.48009 0.00000 LEGISLATORS 2 7419 65406 0.11343 0.88657 0.61129 0.00000 2 ROLL CALLS 2 7412 65406 0.11332 0.88668 0.61165 0.99993 LEGISLATORS 2 7347 65406 0.11233 0.88767 0.61506 0.99009 3 ROLL CALLS 2 7345 65406 0.11230 0.88770 0.61516 0.99998 LEGISLATORS 2 7308 65406 0.11173 0.88827 0.61710 0.99161 4 ROLL CALLS 2 7304 65406 0.11167 0.88833 0.61731 0.99996 LEGISLATORS 2 7279 65406 0.11129 0.88871 0.61862 0.99528 5 ROLL CALLS 2 7276 65406 0.11124 0.88876 0.61878 0.99999 LEGISLATORS 2 7265 65406 0.11108 0.88892 0.61935 0.99521 6 ROLL CALLS 2 7263 65406 0.11104 0.88896 0.61946 0.99999 LEGISLATORS 2 7264 65406 0.11106 0.88894 0.61941 0.99734 7 ROLL CALLS 2 7262 65406 0.11103 0.88897 0.61951 0.99999 LEGISLATORS 2 7253 65406 0.11089 0.88911 0.61998 0.99750 8 ROLL CALLS 2 7250 65406 0.11085 0.88915 0.62014 0.99999 LEGISLATORS 2 7252 65406 0.11088 0.88912 0.62004 0.99801 9 ROLL CALLS 2 7248 65406 0.11082 0.88918 0.62025 1.00000 LEGISLATORS 2 7248 65406 0.11082 0.88918 0.62025 0.99811 10 ROLL CALLS 2 7243 65406 0.11074 0.88926 0.62051 0.99999 LEGISLATORS 2 7253 65406 0.11089 0.88911 0.61998 0.99745 11 ROLL CALLS 2 7245 65406 0.11077 0.88923 0.62040 1.00000 LEGISLATORS 2 7243 65406 0.11074 0.88926 0.62051 0.99787 12 ROLL CALLS 2 7236 65406 0.11063 0.88937 0.62087 1.00000 LEGISLATORS 2 7245 65406 0.11077 0.88923 0.62040 0.99743 13 ROLL CALLS 2 7239 65406 0.11068 0.88932 0.62072 1.00000 LEGISLATORS 2 7237 65406 0.11065 0.88935 0.62082 0.99712 14 ROLL CALLS 2 7233 65406 0.11059 0.88941 0.62103 1.00000 LEGISLATORS 2 7235 65406 0.11062 0.88938 0.62093 0.99859 15 ROLL CALLS 2 7232 65406 0.11057 0.88943 0.62108 1.00000 LEGISLATORS 2 7239 65406 0.11068 0.88932 0.62072 0.99763 16 ROLL CALLS 2 7237 65406 0.11065 0.88935 0.62082 1.00000 LEGISLATORS 2 7237 65406 0.11065 0.88935 0.62082 0.99795 17 ROLL CALLS 2 7233 65406 0.11059 0.88941 0.62103 1.00000 LEGISLATORS 2 7234 65406 0.11060 0.88940 0.62098 0.99795 18 ROLL CALLS 2 7232 65406 0.11057 0.88943 0.62108 0.99999 LEGISLATORS 2 7237 65406 0.11065 0.88935 0.62082 0.99730 19 ROLL CALLS 2 7233 65406 0.11059 0.88941 0.62103 1.00000 LEGISLATORS 2 7229 65406 0.11053 0.88947 0.62124 0.99833 20 ROLL CALLS 2 7224 65406 0.11045 0.88955 0.62150 0.99970 LEGISLATORS 2 7204 65406 0.11014 0.88986 0.62255 0.99259 MEAN VOLUME LEG. 0.1519 0.1530 150.9721 153.1920 0.2291 MACHINE PREC. 2 7159 65406 0.10945 0.89055 17.02.59.21. ELAPSED TIME OF JOB 17.10.06.59.Turn in a copy of PERF21.DAT.
22 MARCH 2003 17.02.59.18. 1 1 6 14 0 0 0 3 28 0 1 2 3 55 0.945 0.018 -0.131 0.362 2 2 1 15 0 0 0 3 25 0 1 1 2 60 0.967 0.314 0.404 0.558 3 4 3 13 0 0 1 1 25 1 5 0 17 54 0.685 0.265 0.210 0.010 4 5 5 21 0 0 1 1 42 1 5 0 3 42 0.929 0.111 -0.534 0.717 5 7 1 10 0 1 1 1 83 0 1 3 8 49 0.837 0.091 -0.101 -0.369 6 8 4 20 0 1 1 1 54 1 5 0 1 30 0.967 0.125 0.018 -0.471 7 9 4 13 0 1 0 1 69 1 1 2 11 56 0.804 0.014 -0.099 -0.147 8 10 0 20 0 0 1 1 55 1 1 1 10 59 0.831 0.033 0.110 0.034 9 11 4 11 0 0 1 2 50 1 5 0 12 57 0.789 0.026 0.224 0.270 10 16 3 14 0 0 0 2 23 1 5 0 7 57 0.877 0.315 0.344 0.080 etc etc etc etc etc etc 1245 2100 0 20 1 1 0 1 35 0 1 1 1 58 0.983 0.252 0.441 -0.147 1246 2103 2 11 1 1 0 1 52 0 5 0 3 48 0.938 0.111 0.179 -0.270 1247 2104 0 23 1 1 0 1 43 0 1 1 2 57 0.965 0.015 0.421 0.605 1248 2105 0 20 1 1 1 1 31 1 1 1 1 51 0.980 0.343 0.361 0.114 1249 2106 0 14 1 1 1 1 44 1 1 1 3 61 0.951 0.461 0.563 -0.091 1250 2110 0 13 1 1 1 1 32 1 5 0 0 52 1.000 0.273 0.142 0.000 1251 2113 0 21 1 0 1 2 32 1 1 1 3 61 0.951 0.283 0.144 -0.074 1252 2114 1 20 1 0 0 1 25 0 1 1 1 58 0.983 0.501 0.286 0.264 1253 2901 0 13 1 1 0 1 30 0 1 1 2 61 0.967 0.332 0.447 0.052 1254 2904 1 20 1 1 1 1 22 1 5 0 2 49 0.959 0.501 0.318 0.012 1 1 240 942 21 996 258 0.913 0.171 -0.901 -0.433 2 2 1751003 34 1941060 0.806 -0.256 0.375 0.927 3 3 258 849 34 930 324 0.868 0.109 -0.645 -0.764 4 4 246 830 43 326 928 0.825 -0.108 0.368 0.930 5 5 258 860 32 273 981 0.876 -0.165 0.679 0.734 etc etc etc 62 62 826 243 111 2181036 0.543 -0.238 0.954 -0.300 63 63 973 152 46 1341120 0.697 -0.326 0.965 0.263 64 64 566 246 98 534 720 0.602 -0.033 0.938 -0.347 65 65 806 157 531100 154 0.662 0.297 -0.912 -0.410 66 66 707 173 65 2101044 0.624 -0.228 0.312 0.950Remove the last 66 lines from PERF25.DAT (be sure to save them!) and make plots using R of the Humphrey Voters, Nixon Voters, and Wallace Voters. These plots should look like those you did for question 3 of homework 7.
23 MARCH 2003 15.42.21.90. \OLDTIME\VOTE_THERM_1968.ORD QUADRATIC-NORMAL MULTIDIMENSIONAL UNFOLDING 2 66 10 40 1 (40A1,3600I1) (I5,1X,40A1,2I5,50F8.3) (I5,1X,40A1,2I5,F8.3,F12.3,50F8.3) ****************************************************************************** RC CLASSIFICATION ERROR 1 2 9791 65406 0.14970 0.85030 LEG CLASSIFICATION ERROR 1 2 7300 65406 0.11161 0.88839 RC CLASSIFICATION ERROR 2 2 7293 65406 0.11150 0.88850 LEG CLASSIFICATION ERROR 2 2 7177 65406 0.10973 0.89027 RC CLASSIFICATION ERROR 3 2 7175 65406 0.10970 0.89030 LEG CLASSIFICATION ERROR 3 2 7155 65406 0.10939 0.89061 RC CLASSIFICATION ERROR 4 2 7153 65406 0.10936 0.89064 LEG CLASSIFICATION ERROR 4 2 7145 65406 0.10924 0.89076 RC CLASSIFICATION ERROR 5 2 7141 65406 0.10918 0.89082 LEG CLASSIFICATION ERROR 5 2 7129 65406 0.10900 0.89100 LOG-LIKELIHOOD 2D/SIGMA PHASE 65406 -26107.14650 0.67089 LOG-LIKELIHOOD SIGMAi PHASE 65406 -21123.06640 0.72401 LOG-LIKELIHOOD 2D/SIGMA PHASE 65406 -20819.13480 0.72738 LOG-LIKELIHOOD SIGMAi PHASE 65406 -20727.87300 0.72840 LOG-LIKELIHOOD & CLASS LEG PHASE 9170 65406 -19280.11910 0.74470 LOG-LIKELIHOOD & CLASS RC PHASE 9152 65406 -18870.81450 0.74937 LOG-L & CLASS N-VECTOR PHASE 8937 65406 -18560.91990 0.75293 LOG-LIKELIHOOD 2D/SIGMA PHASE 65406 -18421.78520 0.75454 LOG-LIKELIHOOD SIGMAi PHASE 65406 -18103.96290 0.75821 LOG-LIKELIHOOD 2D/SIGMA PHASE 65406 -18088.63480 0.75839 LOG-LIKELIHOOD SIGMAi PHASE 65406 -18083.92380 0.75844 LOG-LIKELIHOOD & CLASS LEG PHASE 8895 65406 -17836.66990 0.76132 LOG-LIKELIHOOD & CLASS RC PHASE 8901 65406 -17800.70700 0.76173 LOG-L & CLASS N-VECTOR PHASE 8917 65406 -17753.82620 0.76228 LOG-LIKELIHOOD 2D/SIGMA PHASE 65406 -17718.52150 0.76269 LOG-LIKELIHOOD SIGMAi PHASE 65406 -17637.39260 0.76364 LOG-LIKELIHOOD 2D/SIGMA PHASE 65406 -17633.59570 0.76368 LOG-LIKELIHOOD SIGMAi PHASE 65406 -17631.32030 0.76371 LOG-LIKELIHOOD & CLASS LEG PHASE 8902 65406 -17548.90040 0.76467 LOG-LIKELIHOOD & CLASS RC PHASE 8904 65406 -17540.12300 0.76478 LOG-L & CLASS N-VECTOR PHASE 8876 65406 -17524.01760 0.76496 CLASSIFICATION CHECK AT CONVERGENCE 56530 8876 65406 19086 0.8643 0.5349 LEGS: Rs BTWN STARTS & ESTIMATES 1 1254 0.9342 0.8855 LEGS: Rs BTWN STARTS & ESTIMATES 2 1254 0.8158 0.8232 15.42.21.90. ELAPSED TIME OF JOB 15.47.46.67.Turn in a copy of this file.
1 1 6 14 0 0 0 3 28 0 1 2 52 3 0.945 -6.545 0.888 -0.049 0.439 0.276 0.054 0.130 2 2 1 15 0 0 0 3 25 0 1 1 60 0 1.000 -1.257 0.979 0.283 0.516 0.164 0.204 0.193 3 4 3 13 0 0 1 1 25 1 5 0 34 20 0.630 -32.655 0.546 0.129 0.157 3.333 0.100 0.245 4 5 5 21 0 0 1 1 42 1 5 0 37 5 0.881 -8.306 0.821 -0.610 0.783 1.250 0.210 0.352 5 7 1 10 0 1 1 1 83 0 1 3 39 10 0.796 -24.752 0.603 0.078 -0.649 2.381 0.123 0.156 6 8 4 20 0 1 1 1 54 1 5 0 29 1 0.967 -1.750 0.943 0.121 -0.557 0.205 0.172 0.204 7 9 4 13 0 1 0 1 69 1 1 2 49 7 0.875 -20.582 0.692 -0.072 -0.164 0.463 0.030 0.035 8 10 0 20 0 0 1 1 55 1 1 1 47 12 0.797 -17.032 0.749 0.118 -0.056 0.610 0.049 0.121 9 11 4 11 0 0 1 2 50 1 5 0 46 11 0.807 -23.638 0.661 0.232 0.365 1.515 0.088 0.159 10 16 3 14 0 0 0 2 23 1 5 0 49 8 0.860 -15.413 0.763 0.423 0.301 1.020 0.135 0.183The estimated two-dimensional coordinates are the fourth and fifth colums after the columns of integers. Respondent 1's (the ID number is the second column) two dimensional coordinates are -0.049 0.439. Note that this output file has all the variables from VOTE_THERM_1968.ORD file so that you can select the voters and non-voters. Make plots using R of the Humphrey Voters, Nixon Voters, and Wallace Voters. These plots should look like those you did for question 3 of homework 7.
# # homework_9_plot_1968_1.r # # Reads in output from OC Applied to Thermometer "Roll Calls" # and produces Simple Graphs of Voters and Non-Voters. # Also outputs data as STATA file # # DATA FILE # -- 1st column: Counter 1 to 1254 # -- 2nd column: ID Number # -- 3rd column: partyid -- 0 (SD) to 6 (SR) # -- 4th column: income category # -- 5th column: race, 0=white, 1=black, >2 = other # -- 6th column: sex, 0=male, 1=female # -- 7th column: 0= non-south, 1=south # -- 8th column: education 1=HS, 2=SC, 3=College # -- 9th column: age # --10th column: 0= not married, 1 = married # --11th column: Vote=1 Not Vote=5 # --12th column: 1=Humphrey, 2=Nixon, 3=Wallace, 0=Other/Not Vote # --13th column: Classification Errors # --14th column: Total Choices # --15th column: Proportion Correctly Classified # --16th column: Volume of Polytope # --17th column: 1st dim. from Thermometers # --18th column: 2nd dim. from Thermometers # library(MASS) This is the easy way to call a library! library(foreign) We need this library to do the STATA output T <- matrix(scan("D:/R_Files/oc_leg_1968_therm_full.dat",0),ncol=18,byrow=TRUE) TT <- T nrow <- length(T[,1]) ncol <- length(T[1,]) # # Change Sign on the Dimensions # T[,17] <- -T[,17] T[,18] <- -T[,18] # -- Your Plotting Commands Here -- # outputdf <- as.data.frame(T) These two commands Tell STATA write.dta(outputdf,file="d:/k7moa/T_1968.DTA") To Write Out The Entire T Matrix # as a STATA FILETo enable this feature of R you must load the foreign package in the same way that you loaded the MASS package for Problem 1 of Homework 6 and Problem 1 of Homework 7.