load("georgia2000.RData")
head(georgia2000)
## county ballots votes equip poor urban atlanta perAA gore bush
## 1 APPLING 6617 6099 LEVER 1 0 0 0.182 2093 3940
## 2 ATKINSON 2149 2071 LEVER 1 0 0 0.230 821 1228
## 3 BACON 3347 2995 LEVER 1 0 0 0.131 956 2010
## 4 BAKER 1607 1519 OPTICAL 1 0 0 0.476 893 615
## 5 BALDWIN 12785 12126 LEVER 0 0 0 0.359 5893 6041
## 6 BANKS 4773 4533 LEVER 0 0 0 0.024 1220 3202
attach(georgia2000)
mean(ballots)
## [1] 16926.5
median(ballots)
## [1] 6712
First, I calculated the mean showing the average amount of ballots for all of the counties, which came out to 16926.5. Secondly, I calculated the median of ballots, which shows the number of ballots in the middle when they are arranged in order, which was 6712.
var(ballots)
## [1] 1433769757
sd(ballots)
## [1] 37865.15
The variance came out to be 1433769757. The Standard Deviation came out to be 37865.15 which is showing how scattered our data of ballots is.
max(ballots)
## [1] 280975
min(ballots)
## [1] 881
The maximum of 280975 is the highest value of ballots we have, while the minimum of 881 shows us the lowest value of ballots.
hist(ballots)
The histogram shows us the distribution of ballots, with most of the counties having 0-50,000 ballots.
sum(ballots)
## [1] 2691314
The sum of ballots simply tells us the total amount of ballots across all of the counties, which is 2691314.
red <- bush > gore
table(red)
## red
## FALSE TRUE
## 34 125
From this table, we are able to see the amount of counties won by Bush compared to Gore, which was 125 to 34.
bushprop <- bush/(bush+gore)
hist(bushprop)
The histogram shows that most counties are learning more to the right, meaning in favor of Bush.
plot(perAA,bushprop)
The scatter plot shows us how scattered our plot becomes when we use PerAA against bushprop.