- Details
- Parent Category: Programming Assignments' Solutions
We Helped With This R Programming Assignment: Have A Similar One?

Category | Programming |
---|---|
Subject | R | R Studio |
Difficulty | Undergraduate |
Status | Solved |
More Info | Psychology Statistics Homework Help |
Short Assignment Requirements
Assignment Description
Introduction to Social Data (SOC1004 / POL1008) Take-home exam - Refer/Defer
August 2020
Please answer all the questions for both exercises in the exam. Your answer to each question must include: a) R code, b) R output with the results (and graphs where necessary), c) a short (one or two paragraphs) interpretation of the results. Each question is worth 10, 15 or 20 points.
Please submit your assignments on eBart. The submission deadline is 13 August, 2pm.
You can use any sources to work on the assignment (the Internet, your notes, textbook, etc.), but you cannot consult with other students or use other students’ work. Your exam must be the result of your individual work.
[Continued on next page]
1 The Mark of a Criminal Record (50 points)[1]
To isolate the causal e↵ect of a criminal record for black and white applicants, Pager ran an audit experiment. In this type of experiment, researchers present two similar people that di↵er only according to one trait thought to be the source of discrimination. This approach was used in the resume experiment described in Quantitative Social Science, where researchers randomly assigned stereotypically African-American-sounding names and stereotypically white-sounding names to otherwise identical resumes to measure discrimination in the labour market.
To examine the role of a criminal record, Pager hired a pair of white men and a pair of black men and instructed them to apply for existing entrylevel jobs in the city of Milwaukee. The men in each pair were matched on a number of dimensions, including physical appearance and self-presentation. As much as possible, the only di↵erence between the two was that Pager randomly varied which individual in the pair would indicate to potential employers that he had a criminal record. Further, each week, the pair alternated which applicant would present himself as an ex-felon. To determine how incarceration and race influence employment chances, she compared callback rates among applicants with and without a criminal background and calculated how those callback rates varied by race.
The names and descriptions of variables in the dataset criminalrecord.csv are:
[Continued on next page]
Table 1: Criminal Record Data
Name | Description |
jobid | Job ID number |
callback | 1 if tester received a callback, 0 if the tester did not receive a callback |
black | 1 if the tester is black, 0 if the tester is white |
crimrec | 1 if the tester has a criminal record, 0 if the tester does not |
interact | 1 if tester interacted with employer during the job application, 0 if tester does not interact with employer |
city | 1 is job is located in the city center, 0 if job is located in the suburbs |
distance | Job’s average distance to downtown |
custserv | 1 if job is in the costumer service sector, 0 if it is not |
manualskill | 1 if job requires manual skills, 0 if it does not |
1.1. Begin by loading the data into R and explore the data. How many cases are there in the data? Show a summary of the data. In how many cases is the tester black? In how many cases is the tester white? What proportion of applicants are black and white? (10 points)
1.2. Now we examine the central question of the study. Calculate the proportion of callbacks for white applicants with and without a criminal record, and calculate this proportion for black applicants with and without a criminal record. (15 points)
1.3. What is the di↵erence in callback rates between individuals with and without a criminal record within each race (i.e. for black and white testers separately). What do these specific results tell us? Consider both the di↵erence in callback rates for records with and without a criminal record and the ratio of callback rates for these two types of records. (15 points)
1.4. Compare the callback rates of whites with a criminal record versus blacks without a criminal record. What do we learn from this comparison? (10 points)
[Continued on next page]
2 Sources of Empathy in the Circuit Courts (50 points)2
In this exercise, you will analyze the relationship between various demographic traits and pro-feminist voting behavior among circuit court judges. In a recent paper, Adam N. Glynn and Maya Sen argue that having a female child causes circuit court judges to make more pro-feminist decisions.
The dataset dbj.csv contains the following variables about individual judges:
Table 2: Judges Data
Name Description
name The judge’s name child The number of children each judge has circuit.1 Which federal circuit the judge serves in girls The number of female children the judge has progressive.vote The proportion of the judge’s votes on women’s issues which were decided in a pro-feminist direction | |
race | The judge’s race (1 = white, 2 = African-American, 3 = Hispanic, 4 = Asian-American) |
religion | The judge’s religion (1 = Unitarian, 2 = Episcopalian, 3 = Baptist, 4 = Catholic, 5 = Jewish, 7 = Presbyterian, 8 = Protestant, 9 = Congregationalist, 10 = Methodist, 11 = Church of Christ, 16 = Baha’i, 17 = Mormon, 21 = Anglican, 24 = Lutheran, 99 = unknown) |
republican | Takes a value of 1 if the judge was appointed by a Republican president, 0 otherwise. Used as a proxy for the judge’s party |
sons | The number of male children the judge has |
woman | Takes a value of 1 if the judge is a woman, 0 otherwise |
X | Indicator for the observation number |
yearb | The year the judge was born |
[Continued on next page]
2This exercise is in part based on: Glynn, Adam N., and Maya Sen. (2015). “Identifying Judicial Empathy: Does Having Daughters Cause Judges to Rule for Women’s
Issues?.” American Journal of Political Science Vol. 59, No. 1, pp. 37–54. doi:
10.1111/ajps.12118
2.1. Load the dbj.csv file. Find how many judges there are in the dataset, as well as the gender and party composition of our dataset. Is the party composition di↵erent for male and female judges? Additionally, note that our outcome in this exercise will be the proportion of pro-feminist rulings. What is the range of this variable progressive.vote?
(10 points)
2.2. Next, consider the di↵erences between some groups. For each of the four groups (Republican men/women, Democratic men/women) defined by gender and partisanship, create a boxplot (using a single command) that illustrates the di↵erences in progressive.vote. Briefly interpret the results of the analysis. For example, do any of the results surprise you? Does it appear that partisanship, gender, or both contribute to progressive voting patterns? Should we interpret any of these e↵ects causally? Why or why not? (10 points)
2.3. Create a new binary variable which takes a value of 1 if a judge has at least one child (that is, any children at all), 0 otherwise. Then, use this variable to answer the following questions. Are Republicans and Democrats equally likely to be parents (that is, have at least one child)? Do judges with children vote di↵erently than judges without? If so, how are they di↵erent? Do republican and democratic parents vote di↵erently on feminist issues?(10 points)
2.4. The final question explores di↵erences in voting among judges born earlier and judges born later. Create a new binary variable which takes a value of ‘before 1935’ if a judge has is born before 1935, and ‘from 1935’ otherwise. Compare the progressive voting of Republican and Democrat judges separately (a) for those born before 1935 and (b) for those born 1935 or after. Produce two bar plots to show this: one for Republican-appointed judges and one for Democrat-appointed judges. Comment on the similarities and di↵erences between the two charts, in terms of the changes to the progressive voting for judges born earlier and judges born later. (20 points)
[1] This exercise is based on: Pager, Devah. (2003). “The Mark of a Criminal Record” American Journal of Sociology 108(5):937-975. doi: 10.1086/374403