1. Economic Data

One possible single plot view:

library(ggplot2)
library(lattice)
sts <- ts(scale(economics[-1], center = FALSE),
          start = c(1967, 7), frequency = 12)
xyplot(sts, superpose= TRUE)

An alternative scaling that emphasizes the behavior around 2008:

sec2008 <- as.numeric(economics[487, -1])
sec <- scale(economics[-1], center = FALSE, scale = sec2008)
xyplot(ts(sec, start = c(1967, 7), frequency = 12), superpose = TRUE)

An alternative:

library(zoo)
ets <- ts(economics[-1], start = c(1967, 7), frequency = 12)
autoplot(as.zoo(ets)) + facet_grid(Series ~ ., scales = 'free') 

Some notes:

2. Florida Death Penalty Data

Transform the data to have more useful labels:

library(lattice)
library(vcd)
library(dplyr)
data(deathpenalty, package = "catdata")

bw <- c("black", "white")
dp <- mutate(deathpenalty,
             DefendantRace = factor(DefendantRace, labels = bw),
             VictimRace = factor(VictimRace, labels = bw),
             DeathPenalty = factor(DeathPenalty, labels = c("no", "yes")))

Double decker plots are very effective for visualizing these data.

A slightly lower proportion of black defendants than white defendants received the death penalty.

tabs0 <- xtabs(Freq ~ DefendantRace + DeathPenalty, data = dp)
round(prop.table(tabs0, 1), 2)
##              DeathPenalty
## DefendantRace   no  yes
##         black 0.92 0.08
##         white 0.89 0.11
doubledecker(tabs0)

Conditioning on the victim’s race this is reversed: for both black and white victims, a higher proportion of black defendants than white defendants received the death penalty. For cases where the victim was white and the defendant black almost a quarter of the defendants were sentenced to death.

tabs <- xtabs(Freq ~ DefendantRace + VictimRace + DeathPenalty, data = dp)
round(prop.table(tabs, 1:2), 2)
## , , DeathPenalty = no
## 
##              VictimRace
## DefendantRace black white
##         black  0.97  0.77
##         white  1.00  0.89
## 
## , , DeathPenalty = yes
## 
##              VictimRace
## DefendantRace black white
##         black  0.03  0.23
##         white  0.00  0.11
doubledecker(tabs)