# NOT RUN {
data(schoket)
attach(schoket)
plot(sort(adductsc),sort(adductsw),ylim=c(0,6.4),xlim=c(0,6.4),
xlab="DNA adducts for controls",ylab="DNA adducts for workers",
main="Quantile-Quantile Plot") # Compare with Chapter 17
abline(0,1) # line of equality
legend(4,1,lty=1,"x=y")
boxplot(adductsw,adductsc,ylim=c(0,6.4),ylab="DNA adducts",names=c("Worker","Control"))
d<-adductsw-adductsc
senWilcox(d,gamma=1)
senWilcox(d,gamma=1.5) # sensitive to gamma=1.5
senU(d,gamma=1) # U-statistic version of Wilcoxon's statistic
senU(d,gamma=1.8)
# Stephenson's statistic is obtained from senU()
# by setting m1=m2=m
senU(d,m1=5,m2=5,m=5,gamma=1) # Stephenson's statistic, m=5
senU(d,m1=5,m2=5,m=5,gamma=1.8)
# U-statistic from Rosenbaum (2011) and
# Section 19.2 of Design of Observational Studies, 2nd ed.
senU(d,m1=4,m2=5,m=5,gamma=1.8)
detach(schoket)
# }
Run the code above in your browser using DataLab