# # Barry Edwards # Voting Rights and Minority Representation # # bivariate plots, observations in bins, averaged # I did this using brute force coding. Programming a loop to calculate plot coordinates would # have been much a much better approach. My apologies! # # Remove all objects just to be safe # rm(list=ls(all=TRUE)) # library(foreign) # # # data.stata <- read.dta("http://www.poliscidata.com/replication/vra/edwardsDataVotingRights.dta") #names(data.stata) # [1] "stateAbbrv" "CD" # [3] "electionYear" "openSeat" # [5] "afAmIncumbent" "latinoIncumbent" # [7] "whiteIncumbent" "repIDNO" # [9] "repNAME" "raceRep" #[11] "sampleWeightRevised" "cong" #[13] "state" "party" #[15] "medianFamilyIncome" "blackVAP" #[17] "hispanicVAP" "section5state" #[19] "demSharePresVote" "BVAPpercent" #[21] "HVAPpercent" "repIsBlack" #[23] "repIsLatinoDetail" "minorityRepresentative" #[25] "perNonWhite" "repIsLatino" #[27] "raceRepresentative" "medianFamIncomeOriginal" #[29] "northeastRegion" "demSharePresVoteSave" #[31] "overallData" "constant" #[33] "incumbentParty" "latinoVAPsmooth" #[35] "sampleWeight" "bvapRoundedOff" #[37] "hvapRoundedOff" "afAmVoterSuccess" #[39] "latinoVoterSuccess" recentElections <- subset(data.stata,electionYear>=2002) #fix(recentElections) nbins <- 25 recentElectionsB <- recentElections[order(+recentElections$blackVAP),] resultByBVAP <- recentElectionsB$afAmVoterSuccess bvapInOrder <- recentElectionsB$blackVAP bvapObs <- NULL resultAfAmObs <- NULL ########### uncomment to write graphics files to disk rather than display in R # setwd('H:/voting rights/hi res figures/') # png(file="bivariatePlotFigure2.png",width=6,height=3.4, units="in", pointsize=10, res=800) thisCount <- 1 while (thisCount <= length(resultByBVAP)) { resultAfAmObs[thisCount] <- resultByBVAP[thisCount] bvapObs[thisCount] <- bvapInOrder[thisCount] thisCount <- thisCount+ 1 } afamploty <- NULL afamploty[ 1 ] <- mean(resultAfAmObs[ 1 : 25 ]) afamploty[ 2 ] <- mean(resultAfAmObs[ 26 : 50 ]) afamploty[ 3 ] <- mean(resultAfAmObs[ 51 : 75 ]) afamploty[ 4 ] <- mean(resultAfAmObs[ 76 : 100 ]) afamploty[ 5 ] <- mean(resultAfAmObs[ 101 : 125 ]) afamploty[ 6 ] <- mean(resultAfAmObs[ 126 : 150 ]) afamploty[ 7 ] <- mean(resultAfAmObs[ 151 : 175 ]) afamploty[ 8 ] <- mean(resultAfAmObs[ 176 : 200 ]) afamploty[ 9 ] <- mean(resultAfAmObs[ 201 : 225 ]) afamploty[ 10 ] <- mean(resultAfAmObs[ 226 : 250 ]) afamploty[ 11 ] <- mean(resultAfAmObs[ 251 : 275 ]) afamploty[ 12 ] <- mean(resultAfAmObs[ 276 : 300 ]) afamploty[ 13 ] <- mean(resultAfAmObs[ 301 : 325 ]) afamploty[ 14 ] <- mean(resultAfAmObs[ 326 : 350 ]) afamploty[ 15 ] <- mean(resultAfAmObs[ 351 : 375 ]) afamploty[ 16 ] <- mean(resultAfAmObs[ 376 : 400 ]) afamploty[ 17 ] <- mean(resultAfAmObs[ 401 : 425 ]) afamploty[ 18 ] <- mean(resultAfAmObs[ 426 : 450 ]) afamploty[ 19 ] <- mean(resultAfAmObs[ 451 : 475 ]) afamploty[ 20 ] <- mean(resultAfAmObs[ 476 : 500 ]) afamploty[ 21 ] <- mean(resultAfAmObs[ 501 : 525 ]) afamploty[ 22 ] <- mean(resultAfAmObs[ 526 : 550 ]) afamploty[ 23 ] <- mean(resultAfAmObs[ 551 : 575 ]) afamploty[ 24 ] <- mean(resultAfAmObs[ 576 : 600 ]) afamploty[ 25 ] <- mean(resultAfAmObs[ 601 : 625 ]) afamploty[ 26 ] <- mean(resultAfAmObs[ 626 : 650 ]) afamploty[ 27 ] <- mean(resultAfAmObs[ 651 : 675 ]) afamploty[ 28 ] <- mean(resultAfAmObs[ 676 : 700 ]) afamploty[ 29 ] <- mean(resultAfAmObs[ 701 : 725 ]) afamploty[ 30 ] <- mean(resultAfAmObs[ 726 : 750 ]) afamploty[ 31 ] <- mean(resultAfAmObs[ 751 : 775 ]) afamploty[ 32 ] <- mean(resultAfAmObs[ 776 : 800 ]) afamploty[ 33 ] <- mean(resultAfAmObs[ 801 : 825 ]) afamploty[ 34 ] <- mean(resultAfAmObs[ 826 : 850 ]) afamploty[ 35 ] <- mean(resultAfAmObs[ 851 : 875 ]) afamploty[ 36 ] <- mean(resultAfAmObs[ 876 : 900 ]) afamploty[ 37 ] <- mean(resultAfAmObs[ 901 : 925 ]) afamploty[ 38 ] <- mean(resultAfAmObs[ 926 : 950 ]) afamploty[ 39 ] <- mean(resultAfAmObs[ 951 : 975 ]) afamploty[ 40 ] <- mean(resultAfAmObs[ 976 : 1000 ]) afamploty[ 41 ] <- mean(resultAfAmObs[ 1001 : 1025 ]) afamploty[ 42 ] <- mean(resultAfAmObs[ 1026 : 1050 ]) afamploty[ 43 ] <- mean(resultAfAmObs[ 1051 : 1075 ]) afamploty[ 44 ] <- mean(resultAfAmObs[ 1076 : 1100 ]) afamploty[ 45 ] <- mean(resultAfAmObs[ 1101 : 1125 ]) afamploty[ 46 ] <- mean(resultAfAmObs[ 1126 : 1150 ]) afamploty[ 47 ] <- mean(resultAfAmObs[ 1151 : 1175 ]) afamploty[ 48 ] <- mean(resultAfAmObs[ 1176 : 1200 ]) afamploty[ 49 ] <- mean(resultAfAmObs[ 1201 : 1225 ]) afamploty[ 50 ] <- mean(resultAfAmObs[ 1226 : 1250 ]) afamploty[ 51 ] <- mean(resultAfAmObs[ 1251 : 1275 ]) afamploty[ 52 ] <- mean(resultAfAmObs[ 1276 : 1300 ]) afamploty[ 53 ] <- mean(resultAfAmObs[ 1301 : 1325 ]) afamploty[ 54 ] <- mean(resultAfAmObs[ 1326 : 1350 ]) afamploty[ 55 ] <- mean(resultAfAmObs[ 1351 : 1375 ]) afamploty[ 56 ] <- mean(resultAfAmObs[ 1376 : 1400 ]) afamploty[ 57 ] <- mean(resultAfAmObs[ 1401 : 1425 ]) afamploty[ 58 ] <- mean(resultAfAmObs[ 1426 : 1450 ]) afamploty[ 59 ] <- mean(resultAfAmObs[ 1451 : 1475 ]) afamploty[ 60 ] <- mean(resultAfAmObs[ 1476 : 1500 ]) afamploty[ 61 ] <- mean(resultAfAmObs[ 1501 : 1525 ]) afamploty[ 62 ] <- mean(resultAfAmObs[ 1526 : 1550 ]) afamploty[ 63 ] <- mean(resultAfAmObs[ 1551 : 1575 ]) afamploty[ 64 ] <- mean(resultAfAmObs[ 1576 : 1600 ]) afamploty[ 65 ] <- mean(resultAfAmObs[ 1601 : 1625 ]) afamploty[ 66 ] <- mean(resultAfAmObs[ 1626 : 1650 ]) afamploty[ 67 ] <- mean(resultAfAmObs[ 1651 : 1675 ]) afamploty[ 68 ] <- mean(resultAfAmObs[ 1676 : 1700 ]) afamploty[ 69 ] <- mean(resultAfAmObs[ 1701 : 1725 ]) afamploty[ 70 ] <- mean(resultAfAmObs[ 1726 : 1750 ]) afamploty[ 71 ] <- mean(resultAfAmObs[ 1751 : 1775 ]) afamploty[ 72 ] <- mean(resultAfAmObs[ 1776 : 1800 ]) afamploty[ 73 ] <- mean(resultAfAmObs[ 1801 : 1825 ]) afamploty[ 74 ] <- mean(resultAfAmObs[ 1826 : 1850 ]) afamploty[ 75 ] <- mean(resultAfAmObs[ 1851 : 1875 ]) afamploty[ 76 ] <- mean(resultAfAmObs[ 1876 : 1900 ]) afamploty[ 77 ] <- mean(resultAfAmObs[ 1901 : 1925 ]) afamploty[ 78 ] <- mean(resultAfAmObs[ 1926 : 1950 ]) afamploty[ 79 ] <- mean(resultAfAmObs[ 1951 : 1975 ]) afamploty[ 80 ] <- mean(resultAfAmObs[ 1976 : 2000 ]) afamploty[ 81 ] <- mean(resultAfAmObs[ 2001 : 2025 ]) afamploty[ 82 ] <- mean(resultAfAmObs[ 2026 : 2050 ]) afamploty[ 83 ] <- mean(resultAfAmObs[ 2051 : 2075 ]) afamploty[ 84 ] <- mean(resultAfAmObs[ 2076 : 2100 ]) afamploty[ 85 ] <- mean(resultAfAmObs[ 2101 : 2125 ]) afamploty[ 86 ] <- mean(resultAfAmObs[ 2126 : 2150 ]) afamploty[ 87 ] <- mean(resultAfAmObs[ 2151 : 2175 ]) afamplotx <- NULL afamplotx[ 1 ] <- mean(bvapObs[ 1 : 25 ]) afamplotx[ 2 ] <- mean(bvapObs[ 26 : 50 ]) afamplotx[ 3 ] <- mean(bvapObs[ 51 : 75 ]) afamplotx[ 4 ] <- mean(bvapObs[ 76 : 100 ]) afamplotx[ 5 ] <- mean(bvapObs[ 101 : 125 ]) afamplotx[ 6 ] <- mean(bvapObs[ 126 : 150 ]) afamplotx[ 7 ] <- mean(bvapObs[ 151 : 175 ]) afamplotx[ 8 ] <- mean(bvapObs[ 176 : 200 ]) afamplotx[ 9 ] <- mean(bvapObs[ 201 : 225 ]) afamplotx[ 10 ] <- mean(bvapObs[ 226 : 250 ]) afamplotx[ 11 ] <- mean(bvapObs[ 251 : 275 ]) afamplotx[ 12 ] <- mean(bvapObs[ 276 : 300 ]) afamplotx[ 13 ] <- mean(bvapObs[ 301 : 325 ]) afamplotx[ 14 ] <- mean(bvapObs[ 326 : 350 ]) afamplotx[ 15 ] <- mean(bvapObs[ 351 : 375 ]) afamplotx[ 16 ] <- mean(bvapObs[ 376 : 400 ]) afamplotx[ 17 ] <- mean(bvapObs[ 401 : 425 ]) afamplotx[ 18 ] <- mean(bvapObs[ 426 : 450 ]) afamplotx[ 19 ] <- mean(bvapObs[ 451 : 475 ]) afamplotx[ 20 ] <- mean(bvapObs[ 476 : 500 ]) afamplotx[ 21 ] <- mean(bvapObs[ 501 : 525 ]) afamplotx[ 22 ] <- mean(bvapObs[ 526 : 550 ]) afamplotx[ 23 ] <- mean(bvapObs[ 551 : 575 ]) afamplotx[ 24 ] <- mean(bvapObs[ 576 : 600 ]) afamplotx[ 25 ] <- mean(bvapObs[ 601 : 625 ]) afamplotx[ 26 ] <- mean(bvapObs[ 626 : 650 ]) afamplotx[ 27 ] <- mean(bvapObs[ 651 : 675 ]) afamplotx[ 28 ] <- mean(bvapObs[ 676 : 700 ]) afamplotx[ 29 ] <- mean(bvapObs[ 701 : 725 ]) afamplotx[ 30 ] <- mean(bvapObs[ 726 : 750 ]) afamplotx[ 31 ] <- mean(bvapObs[ 751 : 775 ]) afamplotx[ 32 ] <- mean(bvapObs[ 776 : 800 ]) afamplotx[ 33 ] <- mean(bvapObs[ 801 : 825 ]) afamplotx[ 34 ] <- mean(bvapObs[ 826 : 850 ]) afamplotx[ 35 ] <- mean(bvapObs[ 851 : 875 ]) afamplotx[ 36 ] <- mean(bvapObs[ 876 : 900 ]) afamplotx[ 37 ] <- mean(bvapObs[ 901 : 925 ]) afamplotx[ 38 ] <- mean(bvapObs[ 926 : 950 ]) afamplotx[ 39 ] <- mean(bvapObs[ 951 : 975 ]) afamplotx[ 40 ] <- mean(bvapObs[ 976 : 1000 ]) afamplotx[ 41 ] <- mean(bvapObs[ 1001 : 1025 ]) afamplotx[ 42 ] <- mean(bvapObs[ 1026 : 1050 ]) afamplotx[ 43 ] <- mean(bvapObs[ 1051 : 1075 ]) afamplotx[ 44 ] <- mean(bvapObs[ 1076 : 1100 ]) afamplotx[ 45 ] <- mean(bvapObs[ 1101 : 1125 ]) afamplotx[ 46 ] <- mean(bvapObs[ 1126 : 1150 ]) afamplotx[ 47 ] <- mean(bvapObs[ 1151 : 1175 ]) afamplotx[ 48 ] <- mean(bvapObs[ 1176 : 1200 ]) afamplotx[ 49 ] <- mean(bvapObs[ 1201 : 1225 ]) afamplotx[ 50 ] <- mean(bvapObs[ 1226 : 1250 ]) afamplotx[ 51 ] <- mean(bvapObs[ 1251 : 1275 ]) afamplotx[ 52 ] <- mean(bvapObs[ 1276 : 1300 ]) afamplotx[ 53 ] <- mean(bvapObs[ 1301 : 1325 ]) afamplotx[ 54 ] <- mean(bvapObs[ 1326 : 1350 ]) afamplotx[ 55 ] <- mean(bvapObs[ 1351 : 1375 ]) afamplotx[ 56 ] <- mean(bvapObs[ 1376 : 1400 ]) afamplotx[ 57 ] <- mean(bvapObs[ 1401 : 1425 ]) afamplotx[ 58 ] <- mean(bvapObs[ 1426 : 1450 ]) afamplotx[ 59 ] <- mean(bvapObs[ 1451 : 1475 ]) afamplotx[ 60 ] <- mean(bvapObs[ 1476 : 1500 ]) afamplotx[ 61 ] <- mean(bvapObs[ 1501 : 1525 ]) afamplotx[ 62 ] <- mean(bvapObs[ 1526 : 1550 ]) afamplotx[ 63 ] <- mean(bvapObs[ 1551 : 1575 ]) afamplotx[ 64 ] <- mean(bvapObs[ 1576 : 1600 ]) afamplotx[ 65 ] <- mean(bvapObs[ 1601 : 1625 ]) afamplotx[ 66 ] <- mean(bvapObs[ 1626 : 1650 ]) afamplotx[ 67 ] <- mean(bvapObs[ 1651 : 1675 ]) afamplotx[ 68 ] <- mean(bvapObs[ 1676 : 1700 ]) afamplotx[ 69 ] <- mean(bvapObs[ 1701 : 1725 ]) afamplotx[ 70 ] <- mean(bvapObs[ 1726 : 1750 ]) afamplotx[ 71 ] <- mean(bvapObs[ 1751 : 1775 ]) afamplotx[ 72 ] <- mean(bvapObs[ 1776 : 1800 ]) afamplotx[ 73 ] <- mean(bvapObs[ 1801 : 1825 ]) afamplotx[ 74 ] <- mean(bvapObs[ 1826 : 1850 ]) afamplotx[ 75 ] <- mean(bvapObs[ 1851 : 1875 ]) afamplotx[ 76 ] <- mean(bvapObs[ 1876 : 1900 ]) afamplotx[ 77 ] <- mean(bvapObs[ 1901 : 1925 ]) afamplotx[ 78 ] <- mean(bvapObs[ 1926 : 1950 ]) afamplotx[ 79 ] <- mean(bvapObs[ 1951 : 1975 ]) afamplotx[ 80 ] <- mean(bvapObs[ 1976 : 2000 ]) afamplotx[ 81 ] <- mean(bvapObs[ 2001 : 2025 ]) afamplotx[ 82 ] <- mean(bvapObs[ 2026 : 2050 ]) afamplotx[ 83 ] <- mean(bvapObs[ 2051 : 2075 ]) afamplotx[ 84 ] <- mean(bvapObs[ 2076 : 2100 ]) afamplotx[ 85 ] <- mean(bvapObs[ 2101 : 2125 ]) afamplotx[ 86 ] <- mean(bvapObs[ 2126 : 2150 ]) afamplotx[ 87 ] <- mean(bvapObs[ 2151 : 2175 ]) par(mfrow=c(1,2)) par(mar=c(3.6,3.6,3.1,1.1), mgp=c(2,.6,.5), family = "serif") plot(x="",y="",xlim=c(0,1),xlab="Proportion of Voting Age Population",ylab="Success Rate",ylim=c(0,1),main="(a) African American Voters", axes=F,cex.lab=1.0,cex.main=1.0,font=2,asp=1, family="serif") segments(0,0,1,1,col="gray50",lty=3) lines(x=afamplotx,y=afamploty,lwd=1) points(x=afamplotx,y=afamploty,pch=16,cex=.8) axis(side=1,at=seq(0,1,by=.1),font=2,cex.axis=.7,line=0, family="serif") axis(side=2,at=seq(0,1,by=.1),font=2,las=2,cex.axis=.7,line=0, family="serif") box() legend(x=.50, y=.1, pch=c(16), lwd=c(1), cex=.65, legend=c('Mean of 25 Districts')) ############################## # library(foreign) # # # data.stata <- read.dta("http://www.poliscidata.com/replication/vra/edwardsDataVotingRights.dta") recentElections <- subset(data.stata,electionYear>=2002) #fix(recentElections) nbins <- 25 recentElectionsH <- recentElections[order(+recentElections$hispanicVAP),] resultByHVAP <- recentElectionsH$latinoVoterSuccess hvapInOrder <- recentElectionsH$hispanicVAP hvapObs <- NULL resultLatinoObs <- NULL thisCount <- 1 while (thisCount <= length(resultByHVAP)) { resultLatinoObs[thisCount] <- resultByHVAP[thisCount] hvapObs[thisCount] <- hvapInOrder[thisCount] thisCount <- thisCount+ 1 } latinoploty <- NULL latinoploty[ 1 ] <- mean(resultLatinoObs[ 1 : 25 ]) latinoploty[ 2 ] <- mean(resultLatinoObs[ 26 : 50 ]) latinoploty[ 3 ] <- mean(resultLatinoObs[ 51 : 75 ]) latinoploty[ 4 ] <- mean(resultLatinoObs[ 76 : 100 ]) latinoploty[ 5 ] <- mean(resultLatinoObs[ 101 : 125 ]) latinoploty[ 6 ] <- mean(resultLatinoObs[ 126 : 150 ]) latinoploty[ 7 ] <- mean(resultLatinoObs[ 151 : 175 ]) latinoploty[ 8 ] <- mean(resultLatinoObs[ 176 : 200 ]) latinoploty[ 9 ] <- mean(resultLatinoObs[ 201 : 225 ]) latinoploty[ 10 ] <- mean(resultLatinoObs[ 226 : 250 ]) latinoploty[ 11 ] <- mean(resultLatinoObs[ 251 : 275 ]) latinoploty[ 12 ] <- mean(resultLatinoObs[ 276 : 300 ]) latinoploty[ 13 ] <- mean(resultLatinoObs[ 301 : 325 ]) latinoploty[ 14 ] <- mean(resultLatinoObs[ 326 : 350 ]) latinoploty[ 15 ] <- mean(resultLatinoObs[ 351 : 375 ]) latinoploty[ 16 ] <- mean(resultLatinoObs[ 376 : 400 ]) latinoploty[ 17 ] <- mean(resultLatinoObs[ 401 : 425 ]) latinoploty[ 18 ] <- mean(resultLatinoObs[ 426 : 450 ]) latinoploty[ 19 ] <- mean(resultLatinoObs[ 451 : 475 ]) latinoploty[ 20 ] <- mean(resultLatinoObs[ 476 : 500 ]) latinoploty[ 21 ] <- mean(resultLatinoObs[ 501 : 525 ]) latinoploty[ 22 ] <- mean(resultLatinoObs[ 526 : 550 ]) latinoploty[ 23 ] <- mean(resultLatinoObs[ 551 : 575 ]) latinoploty[ 24 ] <- mean(resultLatinoObs[ 576 : 600 ]) latinoploty[ 25 ] <- mean(resultLatinoObs[ 601 : 625 ]) latinoploty[ 26 ] <- mean(resultLatinoObs[ 626 : 650 ]) latinoploty[ 27 ] <- mean(resultLatinoObs[ 651 : 675 ]) latinoploty[ 28 ] <- mean(resultLatinoObs[ 676 : 700 ]) latinoploty[ 29 ] <- mean(resultLatinoObs[ 701 : 725 ]) latinoploty[ 30 ] <- mean(resultLatinoObs[ 726 : 750 ]) latinoploty[ 31 ] <- mean(resultLatinoObs[ 751 : 775 ]) latinoploty[ 32 ] <- mean(resultLatinoObs[ 776 : 800 ]) latinoploty[ 33 ] <- mean(resultLatinoObs[ 801 : 825 ]) latinoploty[ 34 ] <- mean(resultLatinoObs[ 826 : 850 ]) latinoploty[ 35 ] <- mean(resultLatinoObs[ 851 : 875 ]) latinoploty[ 36 ] <- mean(resultLatinoObs[ 876 : 900 ]) latinoploty[ 37 ] <- mean(resultLatinoObs[ 901 : 925 ]) latinoploty[ 38 ] <- mean(resultLatinoObs[ 926 : 950 ]) latinoploty[ 39 ] <- mean(resultLatinoObs[ 951 : 975 ]) latinoploty[ 40 ] <- mean(resultLatinoObs[ 976 : 1000 ]) latinoploty[ 41 ] <- mean(resultLatinoObs[ 1001 : 1025 ]) latinoploty[ 42 ] <- mean(resultLatinoObs[ 1026 : 1050 ]) latinoploty[ 43 ] <- mean(resultLatinoObs[ 1051 : 1075 ]) latinoploty[ 44 ] <- mean(resultLatinoObs[ 1076 : 1100 ]) latinoploty[ 45 ] <- mean(resultLatinoObs[ 1101 : 1125 ]) latinoploty[ 46 ] <- mean(resultLatinoObs[ 1126 : 1150 ]) latinoploty[ 47 ] <- mean(resultLatinoObs[ 1151 : 1175 ]) latinoploty[ 48 ] <- mean(resultLatinoObs[ 1176 : 1200 ]) latinoploty[ 49 ] <- mean(resultLatinoObs[ 1201 : 1225 ]) latinoploty[ 50 ] <- mean(resultLatinoObs[ 1226 : 1250 ]) latinoploty[ 51 ] <- mean(resultLatinoObs[ 1251 : 1275 ]) latinoploty[ 52 ] <- mean(resultLatinoObs[ 1276 : 1300 ]) latinoploty[ 53 ] <- mean(resultLatinoObs[ 1301 : 1325 ]) latinoploty[ 54 ] <- mean(resultLatinoObs[ 1326 : 1350 ]) latinoploty[ 55 ] <- mean(resultLatinoObs[ 1351 : 1375 ]) latinoploty[ 56 ] <- mean(resultLatinoObs[ 1376 : 1400 ]) latinoploty[ 57 ] <- mean(resultLatinoObs[ 1401 : 1425 ]) latinoploty[ 58 ] <- mean(resultLatinoObs[ 1426 : 1450 ]) latinoploty[ 59 ] <- mean(resultLatinoObs[ 1451 : 1475 ]) latinoploty[ 60 ] <- mean(resultLatinoObs[ 1476 : 1500 ]) latinoploty[ 61 ] <- mean(resultLatinoObs[ 1501 : 1525 ]) latinoploty[ 62 ] <- mean(resultLatinoObs[ 1526 : 1550 ]) latinoploty[ 63 ] <- mean(resultLatinoObs[ 1551 : 1575 ]) latinoploty[ 64 ] <- mean(resultLatinoObs[ 1576 : 1600 ]) latinoploty[ 65 ] <- mean(resultLatinoObs[ 1601 : 1625 ]) latinoploty[ 66 ] <- mean(resultLatinoObs[ 1626 : 1650 ]) latinoploty[ 67 ] <- mean(resultLatinoObs[ 1651 : 1675 ]) latinoploty[ 68 ] <- mean(resultLatinoObs[ 1676 : 1700 ]) latinoploty[ 69 ] <- mean(resultLatinoObs[ 1701 : 1725 ]) latinoploty[ 70 ] <- mean(resultLatinoObs[ 1726 : 1750 ]) latinoploty[ 71 ] <- mean(resultLatinoObs[ 1751 : 1775 ]) latinoploty[ 72 ] <- mean(resultLatinoObs[ 1776 : 1800 ]) latinoploty[ 73 ] <- mean(resultLatinoObs[ 1801 : 1825 ]) latinoploty[ 74 ] <- mean(resultLatinoObs[ 1826 : 1850 ]) latinoploty[ 75 ] <- mean(resultLatinoObs[ 1851 : 1875 ]) latinoploty[ 76 ] <- mean(resultLatinoObs[ 1876 : 1900 ]) latinoploty[ 77 ] <- mean(resultLatinoObs[ 1901 : 1925 ]) latinoploty[ 78 ] <- mean(resultLatinoObs[ 1926 : 1950 ]) latinoploty[ 79 ] <- mean(resultLatinoObs[ 1951 : 1975 ]) latinoploty[ 80 ] <- mean(resultLatinoObs[ 1976 : 2000 ]) latinoploty[ 81 ] <- mean(resultLatinoObs[ 2001 : 2025 ]) latinoploty[ 82 ] <- mean(resultLatinoObs[ 2026 : 2050 ]) latinoploty[ 83 ] <- mean(resultLatinoObs[ 2051 : 2075 ]) latinoploty[ 84 ] <- mean(resultLatinoObs[ 2076 : 2100 ]) latinoploty[ 85 ] <- mean(resultLatinoObs[ 2101 : 2125 ]) latinoploty[ 86 ] <- mean(resultLatinoObs[ 2126 : 2150 ]) latinoploty[ 87 ] <- mean(resultLatinoObs[ 2151 : 2175 ]) latinoplotx <- NULL latinoplotx[ 1 ] <- mean(hvapObs[ 1 : 25 ]) latinoplotx[ 2 ] <- mean(hvapObs[ 26 : 50 ]) latinoplotx[ 3 ] <- mean(hvapObs[ 51 : 75 ]) latinoplotx[ 4 ] <- mean(hvapObs[ 76 : 100 ]) latinoplotx[ 5 ] <- mean(hvapObs[ 101 : 125 ]) latinoplotx[ 6 ] <- mean(hvapObs[ 126 : 150 ]) latinoplotx[ 7 ] <- mean(hvapObs[ 151 : 175 ]) latinoplotx[ 8 ] <- mean(hvapObs[ 176 : 200 ]) latinoplotx[ 9 ] <- mean(hvapObs[ 201 : 225 ]) latinoplotx[ 10 ] <- mean(hvapObs[ 226 : 250 ]) latinoplotx[ 11 ] <- mean(hvapObs[ 251 : 275 ]) latinoplotx[ 12 ] <- mean(hvapObs[ 276 : 300 ]) latinoplotx[ 13 ] <- mean(hvapObs[ 301 : 325 ]) latinoplotx[ 14 ] <- mean(hvapObs[ 326 : 350 ]) latinoplotx[ 15 ] <- mean(hvapObs[ 351 : 375 ]) latinoplotx[ 16 ] <- mean(hvapObs[ 376 : 400 ]) latinoplotx[ 17 ] <- mean(hvapObs[ 401 : 425 ]) latinoplotx[ 18 ] <- mean(hvapObs[ 426 : 450 ]) latinoplotx[ 19 ] <- mean(hvapObs[ 451 : 475 ]) latinoplotx[ 20 ] <- mean(hvapObs[ 476 : 500 ]) latinoplotx[ 21 ] <- mean(hvapObs[ 501 : 525 ]) latinoplotx[ 22 ] <- mean(hvapObs[ 526 : 550 ]) latinoplotx[ 23 ] <- mean(hvapObs[ 551 : 575 ]) latinoplotx[ 24 ] <- mean(hvapObs[ 576 : 600 ]) latinoplotx[ 25 ] <- mean(hvapObs[ 601 : 625 ]) latinoplotx[ 26 ] <- mean(hvapObs[ 626 : 650 ]) latinoplotx[ 27 ] <- mean(hvapObs[ 651 : 675 ]) latinoplotx[ 28 ] <- mean(hvapObs[ 676 : 700 ]) latinoplotx[ 29 ] <- mean(hvapObs[ 701 : 725 ]) latinoplotx[ 30 ] <- mean(hvapObs[ 726 : 750 ]) latinoplotx[ 31 ] <- mean(hvapObs[ 751 : 775 ]) latinoplotx[ 32 ] <- mean(hvapObs[ 776 : 800 ]) latinoplotx[ 33 ] <- mean(hvapObs[ 801 : 825 ]) latinoplotx[ 34 ] <- mean(hvapObs[ 826 : 850 ]) latinoplotx[ 35 ] <- mean(hvapObs[ 851 : 875 ]) latinoplotx[ 36 ] <- mean(hvapObs[ 876 : 900 ]) latinoplotx[ 37 ] <- mean(hvapObs[ 901 : 925 ]) latinoplotx[ 38 ] <- mean(hvapObs[ 926 : 950 ]) latinoplotx[ 39 ] <- mean(hvapObs[ 951 : 975 ]) latinoplotx[ 40 ] <- mean(hvapObs[ 976 : 1000 ]) latinoplotx[ 41 ] <- mean(hvapObs[ 1001 : 1025 ]) latinoplotx[ 42 ] <- mean(hvapObs[ 1026 : 1050 ]) latinoplotx[ 43 ] <- mean(hvapObs[ 1051 : 1075 ]) latinoplotx[ 44 ] <- mean(hvapObs[ 1076 : 1100 ]) latinoplotx[ 45 ] <- mean(hvapObs[ 1101 : 1125 ]) latinoplotx[ 46 ] <- mean(hvapObs[ 1126 : 1150 ]) latinoplotx[ 47 ] <- mean(hvapObs[ 1151 : 1175 ]) latinoplotx[ 48 ] <- mean(hvapObs[ 1176 : 1200 ]) latinoplotx[ 49 ] <- mean(hvapObs[ 1201 : 1225 ]) latinoplotx[ 50 ] <- mean(hvapObs[ 1226 : 1250 ]) latinoplotx[ 51 ] <- mean(hvapObs[ 1251 : 1275 ]) latinoplotx[ 52 ] <- mean(hvapObs[ 1276 : 1300 ]) latinoplotx[ 53 ] <- mean(hvapObs[ 1301 : 1325 ]) latinoplotx[ 54 ] <- mean(hvapObs[ 1326 : 1350 ]) latinoplotx[ 55 ] <- mean(hvapObs[ 1351 : 1375 ]) latinoplotx[ 56 ] <- mean(hvapObs[ 1376 : 1400 ]) latinoplotx[ 57 ] <- mean(hvapObs[ 1401 : 1425 ]) latinoplotx[ 58 ] <- mean(hvapObs[ 1426 : 1450 ]) latinoplotx[ 59 ] <- mean(hvapObs[ 1451 : 1475 ]) latinoplotx[ 60 ] <- mean(hvapObs[ 1476 : 1500 ]) latinoplotx[ 61 ] <- mean(hvapObs[ 1501 : 1525 ]) latinoplotx[ 62 ] <- mean(hvapObs[ 1526 : 1550 ]) latinoplotx[ 63 ] <- mean(hvapObs[ 1551 : 1575 ]) latinoplotx[ 64 ] <- mean(hvapObs[ 1576 : 1600 ]) latinoplotx[ 65 ] <- mean(hvapObs[ 1601 : 1625 ]) latinoplotx[ 66 ] <- mean(hvapObs[ 1626 : 1650 ]) latinoplotx[ 67 ] <- mean(hvapObs[ 1651 : 1675 ]) latinoplotx[ 68 ] <- mean(hvapObs[ 1676 : 1700 ]) latinoplotx[ 69 ] <- mean(hvapObs[ 1701 : 1725 ]) latinoplotx[ 70 ] <- mean(hvapObs[ 1726 : 1750 ]) latinoplotx[ 71 ] <- mean(hvapObs[ 1751 : 1775 ]) latinoplotx[ 72 ] <- mean(hvapObs[ 1776 : 1800 ]) latinoplotx[ 73 ] <- mean(hvapObs[ 1801 : 1825 ]) latinoplotx[ 74 ] <- mean(hvapObs[ 1826 : 1850 ]) latinoplotx[ 75 ] <- mean(hvapObs[ 1851 : 1875 ]) latinoplotx[ 76 ] <- mean(hvapObs[ 1876 : 1900 ]) latinoplotx[ 77 ] <- mean(hvapObs[ 1901 : 1925 ]) latinoplotx[ 78 ] <- mean(hvapObs[ 1926 : 1950 ]) latinoplotx[ 79 ] <- mean(hvapObs[ 1951 : 1975 ]) latinoplotx[ 80 ] <- mean(hvapObs[ 1976 : 2000 ]) latinoplotx[ 81 ] <- mean(hvapObs[ 2001 : 2025 ]) latinoplotx[ 82 ] <- mean(hvapObs[ 2026 : 2050 ]) latinoplotx[ 83 ] <- mean(hvapObs[ 2051 : 2075 ]) latinoplotx[ 84 ] <- mean(hvapObs[ 2076 : 2100 ]) latinoplotx[ 85 ] <- mean(hvapObs[ 2101 : 2125 ]) latinoplotx[ 86 ] <- mean(hvapObs[ 2126 : 2150 ]) latinoplotx[ 87 ] <- mean(hvapObs[ 2151 : 2175 ]) plot(x="",y="",xlim=c(0,1),xlab="Proportion of Voting Age Population",ylab="Success Rate",ylim=c(0,1),main="(b) Latino Voters",axes=F, cex.lab=1.0,cex.main=1.0,font=2,asp=1, family="serif") segments(0,0,1,1,col="gray50",lty=3) lines(x=latinoplotx,y=latinoploty,lwd=1) points(x=latinoplotx,y=latinoploty,pch=16,cex=.8) axis(side=1,at=seq(0,1,by=.1),font=2,cex.axis=.7,line=0, family="serif") axis(side=2,at=seq(0,1,by=.1),font=2,las=2,cex.axis=.7,line=0, family="serif") box() legend(x=.50, y=.1, pch=c(16), lwd=c(1), cex=.65, legend=c('Mean of 25 Districts')) ########### uncomment to write graphics files to disk rather than display in R # dev.off()