Exploring College Major and Income: A Live Data Analysis in R [Video]
In this post, an expert data scientist takes a look at how to work with the R language, all the from bringing in data to analyzing it to creating data visualizations.
Join the DZone community and get the full member experience.Join For Free
i recently came up with the idea for a series of screencasts:
i've thought about recording a screencast of an example data analysis in #rstats . i'd do it on a dataset i'm unfamiliar with so that i can show and narrate my live thought process.- david robinson (@drob) october 6, 2018
any suggestions for interesting datasets to use?
hadley wickham had the great suggestion of analyzing a tidy tuesday dataset . tidy tuesday is a fantastic project run by the r for data science online learning community (especially thomas mock ) that releases an interesting dataset each week.
i've now released my first such screencast, exploring this week's tidy tuesday dataset on (the data behind the economic guide to picking a college major ). you can also find the r markdown i produced here .
i produced a handful of figures that i found pretty interesting. i took a look at the distribution of income from graduates within each category of major.
i spent some time looking at the differences in gender distribution across majors, which was also included in the data.
and i ended by setting up an interactive scatterplot with the plotly package that compared the share of women in a field to the median salary.
some notes and observations:
- this isn't an r tutorial: if i were teaching r, i'd have prepared in advance and moved more slowly through the material. this is a case study in how i'd dive into a dataset and learn from it, including steps where i think aloud and decide what route to take. if anything, it's closer to a "speedrun" .
- i enjoyed showing the order i work in: i write blog posts somewhat "inside-out": i start with a few figures, then figure out what preprocessing i should have started with, and i'm always moving uninteresting figures out of the post or to appendices. it was nice to show how an analysis took shape and ended up looking like an organized final product.
- i ran into fewer bugs than i expected: part of the excitement of a live screencast is that "anything can go wrong" (part of the reason i recorded this first one in advance rather than live is to practice with less pressure!) i was pretty well versed in the tools i used in this session (dplyr and ggplot2), so i got stuck on only a handful of bugs (though i did go down a few unproductive routes).
i had enough fun that i think i'll do it again (though probably not every week). with that in mind, i've learned some lessons that might improve my future screencasts:
- i speak too fast : this is a recurring issue for me. when i'm speaking in front of an audience i can watch people's faces and pace myself a bit better, but when i'm "by myself" while recording it's difficult. i've learned this is especially difficult for non-native listeners, and i'll try to be more conscious and speak slower!
- i need to keep a better eye on time : the screencast is about 80 minutes long (i'd originally planned on an hour, and i'll probably aim for that in the future). i'd be interested in feedback about the length, and whether people find the whole session interesting.
i look forward to hearing your feedback, and to recording to the next one!
Published at DZone with permission of David Robinson, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.