Regression Practice

October 21, 2024

Your Turn


Are democracies less corrupt?


  • V-Dem includes a Political Corruption Index, which aggregates corruption in a number of spheres (see codebook for details).

  • The variable name is: v2x_corr : lower values mean less corruption

Your Turn


Are democracies less corrupt?


  • Filter the V-Dem data to only include the year 2019
  • Make a scatterplot to visualize the relationship between democracy (X) and corruption (Y) (use the v2x_libdem variable for democracy)
  • Fit a linear model with lm()
  • Interpret results for the slope and intercept
  • For a country with the average (mean) level of democracy, what is the predicted level of corruption?
15:00

Create Your Own Model


  • What is a theory of democracy you could test with V-Dem?
  • What is the dependent variable?
  • What is the independent variable?
  • Map out steps to wrangle the data and fit a regression model
  • What do you expect to find?
  • Now go ahead and wrangle the data
  • Fit the model
  • Interpret the coefficients and their significance
  • Did the results match your expectations?
15:00

Final Project


  • Project assignment 1 due this Sunday
  • Can access here
  • Let’s get started!