共计 4723 个字符,预计需要花费 12 分钟才能阅读完成。
Econ 3818
Spring 2019
R data project
Unlike your other R assignments, this assignment is individual work only. You may discuss your project with classmates but you must have your own unique project..
Final write-up is due via email by 5 pm on Monday, April 22. You will need to turn in a pdf including your written answers, R code and R output where asked to do so. You do not need to print this project.
Often data comes unstructured. There is a bit of work to do before you can readily apply the concepts learned in this course. To receive credit for a project you will complete the following.
1)Load a data set into R. This can be any data set that has at least two quantitative variables and one qualitative variable and can be used to complete the rest of this assignment.
a)If you have an interest (chess, avocados, climate change), this is a great opportunity to explore that topic. Or just browse some data sets like this one. I listed potential data sources at the end of this pdf. Look for data that is“.csv”file type.
b)If you do not have an interest in mind, you can use the default data set from the 2016 American Community Survey from Colorado. It is located on desire to learn as“ACS_2016_CO.csv”with an accompanying codebook describing the variable values. NOTE: the default data set is nice to have, but a lot of the variables are top coded as 9999* because the information is missing. This isn’t valuable data when calculating statistics or creating plots and should not be used! (the command subset(-) in R is helpful for dealing with this)
2)Describe the data set with words. How many variables are there? How many observations? What is the unit of observation for the data set (person-year, state, month)? Is this a cross-section, or multiple observations overtime? Do we have repeated observations for the same subject? Describe a few key variables that you will use in your data set including their units (feet, miles, $).
3)Summarize one of the quantitative variables for the full sample using sample statistics. Then, summarize the same quantitative variable for a subset the observations that meet a specific condition. (e.g. report the average, and standard deviation, monthly price of avocados in 20 major cities in the US from 2010 to 2015, then summarize the avocado price for all 20 cities only in the month of February). Try to choose the subsample in a way that is meaningful. How do the summary statistics compare and what do you learn from that? Include R code and output here.
4)Create a histogram of the variable that you summarize in part 3 with properly labeled axis and title. (Bonus points if you can create two histograms of the same variable, split by some other variable, that are strikingly different). Include R output here.
5)Calculate a confidence interval. You can choose to calculate a confidence interval of one variable or a difference of means confidence interval. Pick something interesting to you and interpret your findings. Include your R code here and output here.
6)Formalize a hypothesis you wish to test with these data (e.g. is the average salary from men the same as the average salary for women?). You might not have all the knowledge to test the exact hypothesis you are interested in. You will mostly be interested in doing a difference of means test. Or if the mean of a variable is equal to a specific value.
7)Conduct the hypothesis test at the level of significance and interpret your results in a meaningful way. Include your R code and output here.
8)Visualize at least two variables from the data set using a two-dimensional plot with an appropriate title, axis labels, and legend. The goal is for this image to tell a story that is clear to the reader. A useful visualization here could be a scatterplot involving two quantitative variables. (Bonus points if you can incorporate a third variable into the plot using another dimension, think color, shape, line thickness, etc). While not necessary, this is a great opportunity to become familiar with ggplot(-). Include R code and output here.
9)Finally, think and write about who would be a good“consumer”of this information. Who would be interested in the facts you present here, and how you could improve the analysis in the future by incorporating new data or using the existing data to answer a more interesting question.
For tooling up in R for this assignment, look at https://datacarpentry.org/R-e… lesson 3, Manipulating data frames, and lesson 4, Visualizing data.
In terms of grading, I will be going through the following rubric:
Formatting 10 points – this should look professional!
Dataset description 10 points
Summary 10 points
Histogram 10 points
Confidence interval 15 points
Formalize hypothesis 5 points
Conduct hypothesis 15 points
Visualization 15 points
Write up 10 points
Individual Meeting week of 4/8 5 points (Extra credit!)
Potential data sources (if you do not care to use the default ACS data)
There are many good resources to find data online:
Google’s dataset search: https://toolbox.google.com/da…
Data is plural structured archive, list of interesting data:
https://docs.google.com/sprea…
Bureau of Labor Statistics, prices, unemployment: https://www.bls.gov/data/
Five Thirty Eight project data: https://github.com/fivethirty…
Energy Information Agency: https://www.eia.gov/
Census data at IPUMS: https://www.ipums.org/
Economics data at the Federal Reserve: https://fred.stlouisfed.org/
Economic history data: http://eh.net/databases/
Bureau of Economic Analysis: https://www.bea.gov/data
Agricultural data at USDA: https://www.ers.usda.gov/data…
WX:codehelp