# NOT RUN {
data(smokerlead)
attach(smokerlead)
# Compare with Table 1 in Rosenbaum (2012).
quantile(lead,c(0,1/16,1/8,1/4,1/2,3/4,7/8,15/16,1))
quantile(dose,c(0,1/16,1/8,1/4,1/2,3/4,7/8,15/16,1))
oldpar<-par(mfrow=c(1,2))
boxplot(llead,ylab="Difference in Logs of Lead Levels",xlab="Smoker-Control")
abline(h=0,col="red")
plot(dose,llead,ylab="Difference in Logs of Lead Levels",xlab="Cigarettes Per Day")
lines(lowess(dose,llead),col="red")
detach(smokerlead)
par(oldpar)
# }
Run the code above in your browser using DataLab