Data Analysis Tools, week 1: hypothesis testing and ANOVA

Welcome to the first week of the second course in Coursera’s Data Management and Visualization specialization. In order to utilize ANOVA and post hoc testing, I needed to examine a different explanatory variable than in the previous course. This analysis will examine whether or not a person’s gender and race is associated with their support of the death penalty, as punishment for murder. I will still be using the Outlook on Life (OOL) surveys, made available by ICPSR for Coursera students.

Hypotheses to be tested:

Null hypothesis: the death penalty is supported equally among all gender-racial groups.
Alternate hypothesis: support for the death penalty varies among gender-racial groups.

The categorical response variable was a combination of two groups: those who know someone who has been arrested for a crime, and those who have a friend or relative who has been convicted of a crime. This variable had two categories: yes and no.

The new categorical explanatory variable contains four (4) categories: white men, white women, men of color, and women of color. The gender choices were extremely limited in the dataset: male, female, and no response. Because it was not possible to know if a “no response” was a refusal to answer or identifying as a transgender or nonbinary person, these individuals were omitted from the sample. For more comprehensive data analysis, the survey should have used “masculine” and “feminine” instead of “male” and “female,” and included options for transgender, nonbinary, and possibly other gender identities.

An analysis of variance (ANOVA) revealed that among this sample, the gender and race of an individual (collapsed into 4 categories, as the categorical explanatory variable) is significantly associated with a preference for the death penalty. Utilizing an ordinary least squares (OLS) approach, the following results were obtained: F-statistic = 32.57, p = 2.10e-20. Tukey’s Honestly Significant Difference post hoc test was conducted to determine which groups were significantly different from each other. There was no significant difference in the results between white men and white women, therefore we accept the null hypothesis; however, there were significant differences between white women and men of color, white men and men of color, men of color and women of color, white women and women of color, and white men and women of color, and we accept the alternate hypothesis for these groups.

The punishment preferences among the groups are as follows: 66.7% of white men favor the death penalty, 58.8% of white women favor the death penalty, 55.6% of men of color favor imprisonment, and 64.7% of women of color favor imprisonment.

I was unable to calculate standard deviation for these results. I do not think this is possible, because the explanatory variable has 4 categories, and the response variable has 2 categories: neither are quantitative. After spending many hours (at least 16!) trying to find and code quantitative variables relevant to my original thesis, I was unsuccessful. I understand the code involved in calculating means and standard deviations, but I was unable to show that in this assignment. If any of my classmates have some input or resources, I’d welcome the assistance. I would very much like to calculate the deviation between each of the four gender-ethnic groups.

Click to read the rest….Data Analysis Tools, week 1: hypothesis testing and ANOVA

week 4: creating graphs

This week’s goal was to create univariate and bivariate graphs for the data that was managed in week 3.

Research question, to recap: Do people who know someone who has been accused or convicted of a crime favor the death penalty over life in prison as a punishment for murder, and does this preference differ from people who have never known anyone accused or convicted of a crime?

PROGRAM OUTPUT

bar graph
Out of 1490 responses, 51.28% favored imprisonment over the death penalty, and 48.72% favored the death penalty as punishment for murder.

Click to read the rest….week 4: creating graphs

week 3: managing data

The goal for this week was to identify and perform any data management that will help to answer the question clarified in week 2:

Do people who know someone who has been accused or convicted of a crime favor the death penalty over life in prison as a punishment for murder, and does this preference differ from people who have never known anyone accused or convicted of a crime?

I did not realize that I was jumping ahead when performing some data management in the previous assignment. In order to answer this question, I needed to combine those who answered “yes” to one or both of the following questions: “has anyone in your household ever been arrested for a crime?” and “do you have any friends or relatives having a criminal conviction?” into one group, and combine those who answered “no” to both of these questions into a second group.

By the nature of the convert_numeric() function, individuals with missing variables were excluded. Individuals who refused to answer the questions are included in the analysis, because their responses were coded as (-1). However, it was impossible to determine why variables are missing from the dataset at this level of investigation. Because these answers cannot be inferred, the individuals were omitted from the analysis.

Click to read the rest….week 3: managing data

week 2: writing your first program (in python)

SUMMARY:

While I had an understanding in my head of what I wanted to examine last week, my last blog post still felt muddy, and it wasn’t until I dove into the data itself and started isolating it and working with it that really got to understand the dataset enough to refine my research question:

Do people who know someone who has been accused or convicted of a crime favor the death penalty over life in prison as a punishment for murder, and does this preference differ from people who have never known anyone accused or convicted of a crime?

Blank responses were omitted from the sample, leaving a total sample size of 2,201 out of the dataset’s total 2,294 records. This sample includes 1,086 people who answered “yes” to one or both of the following questions: “has anyone in your household ever been arrested for a crime?” and “do you have any friends or relatives having a criminal conviction?” and 1,115 people who answered “no” to both of these questions.

Examining the entire sample (n = 2,201) first: 46.5% favored the death penalty as punishment for murder, 49.4% favored life in prison, and 4.1% refused to answer.

Group 1 includes those who know someone who has been accused or convicted of a crime (n = 1,086): 44.4% favored the death penalty, 53.1% favored life in prison, and 2.4 % refused to answer.

Group 2 includes those who do not know anyone accused or convicted of a crime (n = 1,115): 50.1% favored the death penalty, 46.7% favored life in prison, and 3.3% refused to answer.

Click to read the rest….week 2: writing your first program (in python)

week 1: getting started

Saluton, miaj samklasanoj! [hello, my classmates!]

I am going to examine whether people’s opinions of prisoners might be more favorable if they themselves have been accused or convicted of a crime or if they know someone who has. I believe that people who have firsthand experience with the defense side of the criminal justice system are going to be more empathetic towards people who are in jail or have been accused of a crime. I also believe this group will be more likely to oppose the death penalty or “three-strikes” laws (life in prison after a third felony conviction).

[Note: links to sources are embedded in the text below.]

I will be utilizing the Outlook on Life (OOL) surveys, made available by the Inter-university Consortium for Political and Social Research (ICPSR) and a special and generous arrangement that allows Coursera students to access this data. I get to take advantage of accessing a dataset that I would not have access to otherwise. This data was collected between August and December 2012. The target population was adults over the age of 18, divided into four groups of male- or female-identified African-American or Black individuals, and white or other (non-Black) race individuals.

A review of the prisoner’s rights movement between 1960 and 1980 suggests prisoners have the power to change public opinion and policy through the actions they’ve taken to advocate for their rights while incarcerated.

An interesting paper from 2008 describes public preference for “punitive policies,” but in the case of non-violent offenders and extreme punishments like the death penalty, support is weaker, and may indicate a preference of rehabilitation over the most severe of punishments.

A study in Chicago in 1988 found that despite increased punitive sentences, the general public was more supportive of the idea of rehabilitation over incarceration. However, a 2008 study in the United Kingdom found that people are perceiving crime to be more prevalent and violent despite falling crime rates, and that people feel less safe, implying that they may be more likely to prefer punishment over rehabilitation.

A 2003 article compared recidivism rates of sex offenders with public opinion and concluded that punishments are disproportionately severe and based on prejudices regarding recidivism rates, despite statistics on treatment options and recidivism rates.

In Perth, Australia, a survey of 544 residents in the 1980s found that people were more likely to recommend the minimum of three potential sentences when they were given the description of specific cases, compared to when they were asked for potential sentences for a general offense, suggesting that people may be more empathetic towards the accused if they see them as individual people rather than anonymous criminal offenses.

a short introduction.

greetings and salutations! my name is jennifer and i’m new here.

you can read a little more about my background here, but this website was created as a small sampling of what i’m working on as i embark on a new career journey. i recently completed Coursera’s Python for Everybody specialization, and i was so enamored by Python, that i jumped right into Coursera’s Data Analysis and Interpretation specialization, with the idea that it would help me merge a science background with a new love of programming.

as part of the first course on data management and visualization, i needed to create a blog where i will document my project’s progress. so here we are. let’s begin!