Last active
March 1, 2017 19:00
-
-
Save ryanburge/774bf8c4782aad0fff0720d4f99da9d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's the data link: | |
simon <- read.csv(url("http://goo.gl/exQA14")) | |
Here's the link to the codebook: | |
http://opensiuc.lib.siu.edu/cgi/viewcontent.cgi?article=1010&context=ppi_statepolls | |
Install these pacakges: | |
install.packages("dplyr") | |
install.packages("car") | |
Load these packages: | |
library(dplyr) | |
library(car) | |
Here are some sample codes: | |
simon$downstate <- Recode(simon$area, "3=1; else=0") | |
black <- filter(simon, rac_eth == 2) | |
hist(simon$area) | |
Do the following exercises. | |
1. Create a new dichotomous variable that is a measurement of males. Do the same for females. | |
2. There's a question in the dataset asking about term limits. Clean that up so that higher values are favor and lower values are oppose. | |
You have to deal with that "don't know" response, as well. | |
3. Use filter to create a dataset of just females. And create a dataset of just males. | |
4. Compare how males and females feel about term limits. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment