Coding Assignment 1

Overview

For this assignment, you are going to download some variables using the wbstats and vdemlite packages. Then you are going to wrangle these data and merge the two data sets into one and analyze how they relate to women’s representation in national parliaments. Do your work for each step in the code chunks provided.

Here is a setup code chunk. You can load all of your packages here or as you go along in the code chunks below using the library() function. However, note that you really only need to load a library once per document.

Warning

Please refrain from installing any packages in your code chunks because this will also install them every time the code chunk is run or your document is rendered. This may not be desirable for you or whoever is looking at or running your code (e.g. me).

Step 1: Download data from V-Dem (20pts)

Use the V-Dem codebook or the searchdem() function in vdemlite to identify one measures of democracy and one indicator related to women’s empowerment. Now use fetchdem() to download the most recent 25 years or so of data for your analysis for all countries in the dataset. Make sure to load the packages that you need and glimpse() the data or View() it to make sure that it downloaded properly.

Step 2: Download data from the World Bank (20 pts)

Next, download the variable on women’s represenation that we used in Module 1.2 (“SG.GEN.PARL.ZS”) and at least one additional measure related to women’s empowerment. Go to the WDI site the wb_search() function to identify relevant variables. Download data for the same time period as you did for the V-Dem data for all countries.

Important

Try to make sure you download indicators with enough data to conduct your analysis. You won’t get great results if there are too many NAs.

Step 3: Merge the data (20 pts)

Now add country codes using the countrycode package and merge the data using left_join().

Step 4: Summarize your combined data set (20 pts)

Use group_by(), summarize() and arrange() to glean insights about your data. For example, how do regions compare on mean values of women’s representation and how do these values relate to the values of other variables in your data set? Which countries stand out in terms of women’s representation? Etc.

Step 5: Interpret your data (20 pts)

Write a paragraph or so relating your insights to the Norris reading about electoral reform and women’s representation. Picking a handful of country cases from your data, how does your summary of gender and democracy variables relate to the level of female representation in a country? How would you relate these findings to Norris’s argument about the importance of an inclusive democracy?

Warning

Don’t write your paragraphs or any interpretation or analysis in a code chunk. Use markdown text. Quarto is designed to be a literate programming tool, so you can write your analysis in markdown text and include code chunks when necessary to support your argument.

Submission: This same document is available on Posit Cloud. You can complete and save your work there. There is no need to submit anything to Blackboard or via e-mail. If you prefer to work locally, you can upload your word to the assignment folder on Posit Cloud when your are finished.