Chris Malec

Data Scientist

Examining Racial Discrimination in the US Job Market

Background

Racial discrimination continues to be pervasive in cultures throughout the world. Researchers examined the level of racial discrimination in the United States labor market by randomly assigning identical résumés to black-sounding or white-sounding names and observing the impact on requests for interviews from employers.

Data

In the dataset provided, each row represents a resume. The ‘race’ column has two values, ‘b’ and ‘w’, indicating black-sounding and white-sounding. The column ‘call’ has two values, 1 and 0, indicating whether the resume received a call from employers or not.

Note that the ‘b’ and ‘w’ values in race are assigned randomly to the resumes when presented to the employer.

Exercises

You will perform a statistical analysis to establish whether race has a significant impact on the rate of callbacks for resumes.

Answer the following questions in this notebook below and submit to your Github account.

  1. What test is appropriate for this problem? Does CLT apply?
  2. What are the null and alternate hypotheses?
  3. Compute margin of error, confidence interval, and p-value. Try using both the bootstrapping and the frequentist statistical approaches.
  4. Write a story describing the statistical significance in the context or the original problem.
  5. Does your analysis mean that race/name is the most important factor in callback success? Why or why not? If not, how would you amend your analysis?

You can include written notes in notebook cells using Markdown:

Resources

import pandas as pd
import numpy as np
from scipy import stats
data = pd.io.stata.read_stata('data/us_job_market_discrimination.dta')
# number of callbacks for black-sounding names
sum(data[data.race=='w'].call)
235.0
data.head()
id ad education ofjobs yearsexp honors volunteer military empholes occupspecific ... compreq orgreq manuf transcom bankreal trade busservice othservice missind ownership
0 b 1 4 2 6 0 0 0 1 17 ... 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
1 b 1 3 3 6 0 1 1 0 316 ... 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
2 b 1 4 1 6 0 0 0 0 19 ... 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
3 b 1 3 4 6 0 1 0 1 313 ... 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
4 b 1 3 3 22 0 0 0 0 313 ... 1.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 Nonprofit

5 rows × 65 columns

Your answers to Q1 and Q2 here

A t-test is appropriate as the sample size is not exceptionally large (4870), however it may be close to a normal distribution. It is safer to perform a t-test as it will give the same result as a z-test as the sample size increases. Regardless of the distribution of the data, if it is independent, the sample means will be normally distributed and the CLT applies.

The null hypothesis is that the instances labeled with black sounding names and white sounding names will receive the same number of phone calls, or that their difference is zero. The althernate hypothesis is that the difference of phone calls received by the two groups is non-zero.

w = data[data.race=='w']
b = data[data.race=='b']
# Your solution to Q3 here
t_stat, p_value = stats.ttest_ind(w['call'],b['call'],equal_var = False)
mean_diff = np.mean(w['call'])-np.mean(b['call'])
print('The mean difference in call-backs is:',round(mean_diff,3),'with a p-value of:',np.format_float_scientific(p_value,2))
The mean difference in call-backs is: 0.032 with a p-value of: 3.94e-05

Your answers to Q4 and Q5 here

The statistical test shows that the mean percentage of call-backs is higher for white sounding names than black ones. Black sounding names were called back at a rate of 6.4% while white sounding names were called back at a rate of 9.7%, which is 50% greater. The t-test demonstrates that this difference is very unlikely to be caused by chance as indicicated by the low p-value. The null hypothesis that the two means are the same must be rejected.

That being said, the test does not show that race is the most important factor in determining call-backs from resumes. Further tests would have to be run to determine if other factors are more important. One important thing to keep in mind is that there are 65 variables, and so if p = 0.05 is used as a benchmark for statistical significance we are likely to get at least one, possibly more, statistically significant results by chance. Setting a lower threshold for the p-value, such as 1/65 = 0.015 would help avoid finding relationships where non exist.