# NOT RUN {
data(antibiotic)
lucid(antibiotic)
# }
# NOT RUN {
# Plot the data similar to Fig 2.14 of Wainer's book, "Medical Illuminations"
require(lattice)
require(reshape2)
# Use log10 transform
dat <- transform(antibiotic,
penicillin=log10(penicillin),
streptomycin=log10(streptomycin),
neomycin=log10(neomycin))
dat <- transform(dat, sgn = ifelse(dat$gramstain=="neg", "-", "+"))
dat <- transform(dat,
bacteria = paste(bacteria, sgn))
dat <- transform(dat, bacteria=reorder(bacteria, -penicillin))
dat <- melt(dat)
op <- tpg <- trellis.par.get()
tpg$superpose.symbol$pch <- toupper(substring(levels(dat$variable),1,1))
tpg$superpose.symbol$col <- c("darkgreen","purple","orange")
trellis.par.set(tpg)
dotplot(bacteria ~ value, data=dat, group=variable,
cex=2,
scales=list(x=list(at= -3:3,
labels=c('.001', '.01', '.1', '1', '10', '100', '1000'))),
main="Bacterial response to Neomycin, Streptomycin, and Penicillin",
xlab="Minimum Inhibitory Concentration (mg/L)")
trellis.par.set(op)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab