Description Usage Format Source References Examples
Lawyers collected data on convicted black murderers in the state of Georgia to see whether convicted black murderers whose victim was white were more likely to receive the death penalty than those whose victim was black, after accounting for aggravation level of the murder. They categorized murders into 6 progressively more serious types. Category 1 comprises barroom brawls, liquor-induced arguments lovers' quarrels, and similar crimes. Category 6 includes the most vicious, cruel, cold=blooded, unprovoked crimes.
1 |
A data frame with 12 observations on the following 4 variables.
the aggravation level of the crime, a numerical variable ranging from 1 to 6
a factor indicating race of murder victim, with
levels "White"
and "Black"
number in the aggravation and victim category who received the death penalty
number in the aggravation and victim category who did not receive the death penalty
Ramsey, F.L. and Schafer, D.W. (2013). The Statistical Sleuth: A Course in Methods of Data Analysis (3rd ed), Cengage Learning.
Woodworth, G.C. (1989). Statistics and the Death Penalty, Stats 2: 9–12.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | str(case1902)
attach(case1902)
## EXPLORATION
proportionDeath <- Death/(Death + NoDeath)
myPointCode <- ifelse(Victim=="White",22,24)
myPointColor <- ifelse(Victim=="White","white","black")
plot(proportionDeath ~ Aggravation, pch=myPointCode, bg=myPointColor)
oddsOfDeath <- Death/(NoDeath + .5) # Add .5 to the demoninator to avoid 0's
plot(oddsOfDeath ~ Aggravation, pch=myPointCode, bg=myPointColor)
plot(oddsOfDeath ~ Aggravation, log="y", pch=myPointCode, bg=myPointColor)
# Use logistic regression (Ch 21) to see if the 6 odds ratios are constant
myGlm1 <- glm(cbind(Death,NoDeath) ~ Aggravation + Victim +
Aggravation:Victim, family=binomial) # Logistic reg with interaction
myGlm2 <- update(myGlm1, ~ . - Aggravation:Victim) # without interaction
anova(myGlm2, myGlm1) # no evidence of interaction.
## INFERENCE
# Mantel Haenszel
myTable <- array(rbind(Death, NoDeath), dim=c(2,2,6),
dimnames=list(Penalty=c("Death","No Death"), Victim=c("White","Black"),
Aggravation=c("1","2","3","4","5","6")))
myTable # Show the 6 2x2 tables
mantelhaen.test(myTable, alternative="greater", correct=FALSE) # 1-sided p-value
mantelhaen.test(myTable, alternative="greater") # with continuity correction
mantelhaen.test(myTable) # two.sided (default) for confidence interval
# Logistic Regression (Ch 21) (treating aggravation level as numerical)
summary(myGlm2)
beta <- myGlm2$coef
exp(beta[3]) # 6.1144
exp(confint(myGlm2,3)) # 2.23040 18.72693
# Interpretation: The odds of death penalty for white victim murderers are
# estimated to be 6 times the odds of death penalty for black victim murderers
# with similar aggravation level(95% confidence interval: 2.2 to 18.7 times).
## GRAPHICAL DISPLAY FOR PRESENTATION
myPointColor <- ifelse(Victim=="White","green", "orange")
plot(jitter(proportionDeath,.1) ~ jitter(Aggravation,.1),
xlab="Aggravation Level of the Murder",
ylab="Proportion of Murderers Who Received Death Penalty",
pch=myPointCode, bg=myPointColor, cex=2, lwd=2)
legend(1,1, c("White Victim Murderers","Black Victim Murderers"), pch=c(21,22),
pt.cex=c(2,2), pt.bg=c("green","orange"), pt.lw=c(2,2))
# Include logistic regression fit on plot
dummyAg <- seq(min(Aggravation),max(Aggravation),length=50)
etaB <- beta[1] + beta[2]*dummyAg
etaW <- etaB + beta[3]
pB <- exp(etaB)/(1 + exp(etaB)) # Estimated prob of DP; Black victim
pW <- exp(etaW)/(1 + exp(etaW)) # Estimated prob of DP; White victim
lines(pB ~ dummyAg,lty=1)
lines(pW ~ dummyAg,lty=2)
detach(case1902)
|
'data.frame': 12 obs. of 4 variables:
$ Aggravation: int 1 1 2 2 3 3 4 4 5 5 ...
$ Victim : Factor w/ 2 levels "Black","White": 2 1 2 1 2 1 2 1 2 1 ...
$ Death : int 2 1 2 1 6 2 9 2 9 4 ...
$ NoDeath : int 60 181 15 21 7 9 3 4 0 3 ...
Analysis of Deviance Table
Model 1: cbind(Death, NoDeath) ~ Aggravation + Victim
Model 2: cbind(Death, NoDeath) ~ Aggravation + Victim + Aggravation:Victim
Resid. Df Resid. Dev Df Deviance
1 9 3.8816
2 8 3.3438 1 0.53778
, , Aggravation = 1
Victim
Penalty White Black
Death 2 1
No Death 60 181
, , Aggravation = 2
Victim
Penalty White Black
Death 2 1
No Death 15 21
, , Aggravation = 3
Victim
Penalty White Black
Death 6 2
No Death 7 9
, , Aggravation = 4
Victim
Penalty White Black
Death 9 2
No Death 3 4
, , Aggravation = 5
Victim
Penalty White Black
Death 9 4
No Death 0 3
, , Aggravation = 6
Victim
Penalty White Black
Death 17 4
No Death 0 0
Mantel-Haenszel chi-squared test without continuity correction
data: myTable
Mantel-Haenszel X-squared = 11.26, df = 1, p-value = 0.000396
alternative hypothesis: true common odds ratio is greater than 1
95 percent confidence interval:
2.264218 Inf
sample estimates:
common odds ratio
5.49258
Mantel-Haenszel chi-squared test with continuity correction
data: myTable
Mantel-Haenszel X-squared = 9.6983, df = 1, p-value = 0.0009222
alternative hypothesis: true common odds ratio is greater than 1
95 percent confidence interval:
2.264218 Inf
sample estimates:
common odds ratio
5.49258
Mantel-Haenszel chi-squared test with continuity correction
data: myTable
Mantel-Haenszel X-squared = 9.6983, df = 1, p-value = 0.001844
alternative hypothesis: true common odds ratio is not equal to 1
95 percent confidence interval:
1.910687 15.789312
sample estimates:
common odds ratio
5.49258
Call:
glm(formula = cbind(Death, NoDeath) ~ Aggravation + Victim, family = binomial)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.93570 -0.22548 0.05142 0.65620 1.01444
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -6.6760 0.7574 -8.814 < 2e-16 ***
Aggravation 1.5397 0.1867 8.246 < 2e-16 ***
VictimWhite 1.8106 0.5361 3.377 0.000732 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 212.2838 on 11 degrees of freedom
Residual deviance: 3.8816 on 9 degrees of freedom
AIC: 31.747
Number of Fisher Scoring iterations: 4
VictimWhite
6.1144
Waiting for profiling to be done...
2.5 % 97.5 %
2.23040 18.72693
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.