Editing Statistics and Statistical Programming (Fall 2020)/pset7
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
This problem set asks you to apply, extend, and interpret the widely influential "bread and peace" model of U.S. electoral behavior from the work of [https://douglas-hibbs.com/ Douglas Hibbs]. In brief, Hibbs argues that two variables almost perfectly predict U.S. presidential election vote-share for incumbent party candidates since 1950: economic growth and U.S. military fatalities (both calculated over the duration of the previous president's term). Since | This problem set asks you to apply, extend, and interpret the widely influential "bread and peace" model of U.S. electoral behavior from the work of [https://douglas-hibbs.com/ Douglas Hibbs]. In brief, Hibbs argues that two variables almost perfectly predict U.S. presidential election vote-share for incumbent party candidates since 1950: economic growth and U.S. military fatalities (both calculated over the duration of the previous president's term). Since doing univariate (one predictor variable) regression this week, I ask you to work with the income measure (predictor) and the incumbent part vote share (outcome). | ||
== Programming challenges == | == Programming challenges == | ||
=== | === Import and update data === | ||
Data for all U.S. presidential elections 1952-2012 are [https://github.com/avehtari/ROS-Examples/raw/master/ElectionsEconomy/data/hibbs.dat available here]. Note that this points to a ".dat" file, which in this case is just a raw text file format that you can import using the following command: <code>read.table(url(<insert.url.here>), header=TRUE)</code> | Data for all U.S. presidential elections 1952-2012 are [https://github.com/avehtari/ROS-Examples/raw/master/ElectionsEconomy/data/hibbs.dat available here]. Note that this points to a ".dat" file, which in this case is just a raw text file format that you can import using the following command: <code>read.table(url(<insert.url.here>), header=TRUE)</code>. | ||
Each row corresponds to one presidential election since 1952. The variables provided are: | Each row corresponds to one presidential election since 1952. The variables provided are: | ||
Line 14: | Line 13: | ||
The dataset does not include 2016, so we can add that by hand. You might recall that Hillary Clinton was the incumbent party candidate and Donald Trump was the out-party candidate that year. Clinton won approximately 51.1% of the popular vote and a reasonable estimate for per-capita income growth 2012-2016 is 2.2%. You can append this information to the imported dataset in a bunch of different ways. (I would personally do so using a call to <code>list()</code> nested inside a call to <code>rbind()</code> (e.g., <code>rbind(<hibbs_data>, list(<2016 row>))</code>). You could also explore the <code>add_row()</code> function in the tidyverse. As usual, your mileage may vary.) | The dataset does not include 2016, so we can add that by hand. You might recall that Hillary Clinton was the incumbent party candidate and Donald Trump was the out-party candidate that year. Clinton won approximately 51.1% of the popular vote and a reasonable estimate for per-capita income growth 2012-2016 is 2.2%. You can append this information to the imported dataset in a bunch of different ways. (I would personally do so using a call to <code>list()</code> nested inside a call to <code>rbind()</code> (e.g., <code>rbind(<hibbs_data>, list(<2016 row>))</code>). You could also explore the <code>add_row()</code> function in the tidyverse. As usual, your mileage may vary.) | ||
=== | === Summarize and visualize data === | ||
=== Calculate covariance and correlation === | |||
=== Fit and summarize a linear model === | |||
=== Assess the model fit === | |||
=== | === Calculate confidence interval for a coefficient === | ||
=== Calculate an out-of-sample prediction interval === | |||
=== | |||
=== | |||
=== | |||
=== | |||
== Statistical questions == | == Statistical questions == | ||
=== Interpret the results === | |||
=== Disambiguate: correlation vs. covariance vs. OLS estimate === | |||
=== | === Identify threats to validity of estimates === | ||
=== Interpret prediction === | |||
=== Brainstorm confounds & alternative explanations === | |||
=== Revisit (vaguely stated) theory === | |||
=== | |||
=== | |||
=== | |||