data(aHDLt)
table(aHDLt$grp,aHDLt$grpL) # Short labels for plotting
boxplot(aHDLt$age~aHDLt$grp,xlab="Group",ylab="Age")
boxplot(aHDLt$education~aHDLt$grp,xlab="Group",ylab="Education")
table(aHDLt$female,aHDLt$grpL)
table(aHDLt$z,aHDLt$grpL)
# The sets were also matched for is.na(aHDLt$mmercury), for use
# in Rosenbaum (2023). About half of the matched sets
# have values for mmercury.
table(is.na(aHDLt$mmercury),aHDLt$grp)
# See also the informedSen package for additional analysis
oldpar<-par(mfrow=c(1,2))
library(MASS)
huber2<-function(y){huber(y)$mu}
boxplot(aHDLt$hdl~aHDLt$grpL,ylab="HDL Cholesterol, mg/dL",cex.lab=1,
cex.axis=.9,cex.main=.9,las=1,xlab="(i)")
axis(3,at=1:4,labels=round(tapply(aHDLt$hdl,aHDLt$grpL,huber2),1),
cex.axis=.9)
boxplot(aHDLt$bmi~aHDLt$grpL,ylab="BMI",cex.lab=.9,
cex.axis=1,cex.main=.9,las=1,xlab="(ii)")
axis(3,at=1:4,labels=round(tapply(aHDLt$bmi,aHDLt$grpL,huber2),1),
cex.axis=.9)
par(oldpar)
Run the code above in your browser using DataLab