In the ranked-choice ballot system, once a voter has picked a first choice candidate, there is no advantage in listing that same candidate as second or third choice.
In answering each of the following, you should include three things:
head()
).Here are the questions.
First
and Second
place?First
and Second
place choices are the same, what were the top 3 choices?First
, what were the top three Second
choices?One way to measure the “spread” of values is with the “standard deviation.” The higher the standard deviation, the more spread out the values are.
In the MedicareCharges
data table:
Make a scatterplot map of the locations of the Medicare providers. (Hint: the ZIP code provides this information. You can translate it into latitude and longitude with ZipGeography
.) Overlay this on a choropleth map giving the population of each state.
Suppose you wanted to display how many people were treated for problems in various body systems: Heart, Respiratory, Skeletal, BrainCNS, Blood, Circulation, Psychology, Sepsis, Kidney, Endocrine, Digestive, Other. To help, a translation table is available. You can access it with commands these commands (which create a data table named DRGtoBodySystem
):
library( mosaic )
DRGtoBodySystem <-
fetchGoogle( "https://docs.google.com/spreadsheet/pub?key=0Am13enSalO74dFFFaGJWdk1IbUo4bVFXLXYzbE1KLXc&single=true&gid=0&output=csv" )
Make a bar chart showing how much is paid by Medicare for each categories. Your report should show both the bar chart and the commands that generate it.
Join the zip code geography and demography:
Totalhousingunits
) that are vacant (Vacanthousingunits
).Bachelorsdegreeorhigher
).Pick out the 10000 zip codes with the highest population. Make a scatter plot of the latitude versus longitude. (Hint: arrange()
and head()
.) Use color to represent the fraction of the population that is over 65.
How many zip codes have a WaterArea
that is more than 50% of the LandArea
? Make a scatter plot showing the geographical location of these, with color indicating the population.
Please use the comment system to make suggestions, point out errors, or to discuss the topic.
Written by Daniel Kaplan for the Data & Computing Fundamentals Course. Development was supported by grants from the National Science Foundation for Project Mosaic (NSF DUE-0920350) and from the Howard Hughes Medical Institute.