[Unit 2] Pre-Class ActivitiesPC March 16 - Introduction to R (07-01)AssignmentAdvanced user?SubmitPC March 18 - Introduction to dplyr
(07-02)AssignmentAdvanced user? SubmitPC March 23 - Introduction to {ggplot2
}AssignmentAdvanced user? SubmitPC March 30 - ggplot2
- the return!AssignmentAdvanced user? SubmitPC April 01 - Definitions of inequality ReadCompletePC April 06 - Trends in inequality Read Optional PC April 08 - Neighborhoods and income mobilityReadOptionalInstructionsPromptsPC April 13 - Impact of Policy on InequalityReadOptionalInstructionsPrompts[Unit 3] Pre-Class ActivitiesPC April 27 - Returns to EducationReadInstructionsPrompts
The purpose of this pre-class activitiy is to get you set up for us to introduce R in class. See below if you're an advanced user.
Install R
You can download R from CRAN. Select your operating system.
Windows users: Select base
, and then download and install R
Mac users: Download and install R-4.04.pkg
If you get an error message, then you should hold down the control
key while clicking the package, then select "open" (still holding the key), and once you see a warning message, select "open."
Install R Studio. You can either get the standard version (RStudio Desktop) here, or you can grab a "preview" version, which has fun new updates. I recommend preview version, but it's your call.
Complete Programming Basics tutorial (Note: you will need to create a free RStudio Cloud account). In terms of time budgeting, note that this will involve you watching 7 videos that are 1-2 minutes long. There will also be short activities you can do, in which you type into boxes and click "run code" to test it. You should do these too!
Open RStudio on your computer. You know things are good if you see something that looks like a emptier, sadder version of this.
Type the following code in your Console window and press Enter: sqrt(pi)
. Look, you calculated !
Install the tidyverse! Type the following code in your Console window and press Enter:
install.packages("tidyverse")
It incldues fun friends like dplyr
(pronounced "dee-plier") and more!
Tell R to use dplyr
. Type the following code in your Console window and press Enter:
xxxxxxxxxx
library(dplyr)
Make sure your computer can do all the things: Type or copy-paste the following code in your Console window and press Enter:
xxxxxxxxxx
starwars %>%
filter(species == "Droid")
What is IG-88's height, mass, and homeworld?
Most of this will not be necessary. You should still answer the prompts, which will require you to do parts (7) and (8) of the assignment.
The R Introduction page contains instructions on installing R and R Studio, plus some general background.
Submit on Blackboard the answers to the following questions (in our pre-class assignments)
dplyr
(07-02)
Complete the following 3 primers:
You'll notice that you can work through examples in the tutorial, run your code, and compare against the solutions. I strongly recommend that you copy and paste your code into a R script or R markdown document as you go, which will give you a record of what you've done. You'll also need to bring in some answers in order to generate your PC document (below).
The remaining instructions are available here. You'll want to download the following template and open it in RStudio.
If you are already comfortable with RMarkdown, dplyr
, and the rudiments of ggplot
, then don't do the assignment. Instead, do the following:
babynames
package. ggthemes
package if you'd like.Your output should be a Word/PDF/html (pick whichever) that you created by knitting from the template that you edited. Note that if you try to upload a html file on to Blackboard, you will need to compress/zip it first.
ggplot2
}Complete these four primers:
dplyr
: practice w/ pipes and other key commands: summarize()
, mutate()
, and group_by()
The remaining instructions are available here: R_0801_pc_template.html You'll want to download the following template and open it in RStudio: R_0801_pc_template.Rmd
If you are already comfortable with dplyr
, and these ggplot
basics, then don't do the assignment. Instead, let's do a quick TidyTuesday assignment!
Because we're going to be tackling inequality (or rather, examining inequality) in a week or two, I'll ask you to make one neat graph based on the 02-09-2021 TidyTuesday - wealth and income!
The internet is full of inspiration, as participants post their results and code on Twitter with #tidytuesday. You'll want to go back to posts around February 09-15 ( π π embedded in the link). You can start from scratch of build off what other folks have done.
Finally, knit this document to Word, html, or PDF and upload into Blackboard.
tinytex
package. This is a two-step process. Andrew Heiss provides the clearest explanation.Note: If you get a weird error message about Error in contrib.url(repos,"source")...
comment out the two lines that install your packages.
ggplot2
- the return!Complete the following tutorials:
Then, download and work through the pre-class template here: R_0901_pc_template.Rmd.
You can find the html version as well: R_0901_pc_template.html.
If you are already comfortable with ggplot
, then don't do the assignment. Instead, let's revisit our TidyTuesday assignment ... for Thursday.
That said, you. may still want a quick refresher with the final ggplot
primer: Customize plots - there is good practice with labels, themes, scales (with scale_color_brewer
and scale_fill_brewer
), and legends.
Dive back into the 02-02-2021 Tidy Tuesday on wealth and income over time.!
The internet is full of inspiration, as participants post their results and code on Twitter with #tidytuesday. You'll want to go back to posts around February 09-15 ( π π embedded in the link). You can start from scratch of build off what other folks have done.
Finally, knit this document to Word, html, or PDF and upload into Blackboard.
tinytex
package. This is a two-step process. Andrew Heiss provides the clearest explanation.Note: If you get a weird error message about Error in contrib.url(repos,"source")...
comment out the two lines that install your packages.
Chapters 5.9 and 5.10, Economy, Society, and Public Policy
Visit the Data Access Research Tool from the LIS. Note how you can visualize inequality data based on income or wealth across time for multiple high-income countries!
We're going to replicate a graph and think about the various measures of inequality with the power of R. Download this template and work through it 09-02-preclass.Rmd
You can find the html version here as well: 09-02-preclass.html.
Note that you will need to download a .xlsx
file from DART. This should be straightforward π€. In the event that it isn't, you can download the one I used here as a last resort.
Once you've finished, knit and upload to Blackboard.
No advanced user activities this week! But, you can always make your graphs as fancy as you like.
Note: If you have issues w/ article limits and access to The New York Times, please remember that you can sign up for a free digital subscription through UVM! πππ Now you can geek out w/ the NYT for free all the time. π€
Badger, E. and Quely, K. "Watch four decades of inequality drive American cities apart." The New York Times 02 December 2019 (Updated 11 June 2020).
Lowrey, A. "The wealth gap in America is growing too." The New York Times, 02 April 2014.
Kent, A., Ricketts, L., and Boshara, R. "What wealth inequality in America looks like: facts and figures." 14 August 2019
Abel, J. and Deitz, R. "Why are some places so much more unequal than others?" Federal Reserve Bank of New York Economic Policy Review, 25.1 Decmeber 2019. <-- This is the full article that informs the NYTimes piece, if you're interested!
Pew Research Center "Many around the world were pessimistic about inequality even before the pandemic." 06 August 2020
The America We Need New York Times interactive feature with heaps of articles on inequality, work, and cities in light of the pandemic. It's kind of amazing.
Saez, E. and Zucman, G. "Wealth Inequality in the United States since 1913" October 2014
Slides from Saez and Zucman that forom the base of the 3rd assigned article.
Smialek, J. "Even as Americans grew richer, inequality persisted." The New York Times, 28 September 2020.
Complete the following activities. You'll earn 2 points for fully complete with reasonable effort, 1 point for at least half complete, and 0 points for less than half complete.
Your answers should total 300-500 words
(6p) Chetty, R., Friedman, J. N., Hendren, N., Jones, M. R., and Porter, S. R. "The Opportunity Atlas: Mapping the Childhood Roots of Social Mobility" (Executive Summary)
(92p) Chetty, R., Friedman, J. N., Hendren, N., Jones, M. R., and Porter, S. R. "The Opportunity Atlas: Mapping the Childhood Roots of Social Mobility." January 2020.
(105p) Chetty, R., Hendren, N., Kline, P., and Saez, E. 2014 "Where is the land of opportunity? The geography of intergenerational mobility in the United States". massively long, but an important paper!
Complete the following activities. You'll earn 2 points for fully complete with reasonable effort, 1 point for at least half complete, and 0 points for less than half complete.
Your answers should total 300-500 words
You'll need to include pictures, so I recommend uploading a document rather than answering in the text box.
After reading the executive summary, visit the Opportunity Atlas. First, take a moment to orient yourself. You may want to review the FAQ. Or, you can click on "Explore Stories"--> "Tutorial" for a walkthrough of functionality. The right panel lets you focus on outcomes for a particular subgroup by parental income, race/ethnicity, and/or gender. Some subgroups won't be possible if there is insufficient sample size, particularly for low-population areas. find a town/area that is important or interesting to you. It could be where you grew up, where you've lived for a while, a place you're generally interested in learning more about.
(2p) Chetty, R., Hendren, N., and Katz, L. "The Effects of Exposure to Better Neighborhoods on Children" (Executive Summary). May 2015
(~10p) Collinson, R. and Ludwig, J. "Neighborhoods and Opportunity in America." The Brookings Institution. 19 September 2019.
(90p) Chetty, Raj, Nathaniel Hendren, and Lawrence F. Katz. "The effects of exposure to better neighborhoods on children: New evidence from the Moving to Opportunity experiment." American Economic Review 106.4 (2016): 855-902.
(12p) Ludwig, Jens, Greg J. Duncan, Lisa A. Gennetian, Lawrence F. Katz, Ronald C. Kessler, Jeffrey R. Kling, and Lisa Sanbonmatsu. 2013. βLong-Term Neighborhood Effects on Low-Income Families: Evidence from Moving to Opportunity.β American Economic Review 103, no. 3: 226β231.
Complete the following activities. You'll earn 2 points for fully complete with reasonable effort, 1 point for at least half complete, and 0 points for less than half complete.
Your answers should total 300-500 words
(p10) Webber, Douglas. βIs the Return to Education the Same for Everybody?β IZA World of Labor, October 1, 2014. Read the "full article" version!
Complete the following activities. You'll earn 2 points for fully complete with reasonable effort, 1 point for at least half complete, and 0 points for less than half complete.
Answer some or all of the prompts below, but your answers should total 300-500 words
Consider the following statement: 10 year after graduating college, the median-earning economics major earns 50% more than the median earning biology major ($83k vs β$56k), and 150% more than a high school graduate ($83k vs $33k). (Data taken from here).
a. Based on the readings, why would it be inaccurate to tell a room full of biology majors that if they all switched to economics, they would (more or less on average) increase their earnings 10 years out by 50%? What other factors might be important?
b. What additional factors beyond what you already listed might be important for why it would also be inaccurate to tell a room full of high school seniors that if they all become economics majors, they would (more or less on average) increase their earnings 10 years out by 150%?