# NOT RUN {
# Figure 1 in Rosenbaum (2017)
data(periodontal)
attach(periodontal)
m<-matrix(1:2,1,2)
layout(m,widths=c(1,2))
boxplot(pcteither[z==1]-pcteither[z==0],ylab="Smoker-Control Difference",
main="(i)",xlab="Matched Pairs",ylim=c(-100,100))
abline(h=0,lty=2)
crosscutplot(cigsperday[z==1],pcteither[z==1]-pcteither[z==0],
ct=.2,ylab="Smoker-Control Difference",
xlab="Cigarettes per Day",main="(ii)",ylim=c(-100,100))
abline(h=0,lty=2)
detach(periodontal)
layout(1)
# }
Run the code above in your browser using DataLab