Using the book

R packages

There are quite a few R packages used in the book. To prepare your R installation for running all the examples in this book, you can use the following commands to install these packages.

packages <- c("AER", "ca", "car", "colorspace", "corrplot", "countreg", "directlabels",
	"effects", "ggparallel", "ggplot2", "ggtern", "gmodels", "gnm", "gpairs",
	"heplots", "Lahman", "lattice", "lmtest", "logmult", "MASS", "mgcv", "nnet",
	"plyr", "pscl", "RColorBrewer", "reshape2", "rms", "rsm", "sandwich", "splines",
	"vcd", "vcdExtra", "VGAM", "xtable")
install.packages(packages)

The countreg package, used in Chapter 11, may not yet be available on CRAN. If not, you can install it from the R-Forge development site.

# if countreg is not yet on CRAN:
install.packages("countreg", repos="http://R-Forge.R-project.org")

Data sets by package

The following lists the data sets used in the book, by package. Links to the data set documentation for CRAN packages are courtesy of http://www.inside-r.org/.

AER
NMES1988
agridat
jansen.strawberry
car
Womenlf
countreg
CodParasites, CrabSatellites
datasets
HairEyeColor, iris, UCBAdmissions
effects
Arrests
HistData
Arbuthnot
Lahman
Master
logmult
criminal, gss8590
MASS
birthwt, caith
Sleuth2
case2201
vcd
Arthritis, Bundesliga, Butterfly, CoalMiners, Employment, Federalist, HorseKicks, Lifeboats, PreSex, Punishment, RepVict, Saxony, SexualFun, SpaceShuttle, Suicide, UKSoccer, VisualAcuity, WeldonDice, WomenQueue
vcdExtra
Abortion, Accident, AirCrash, Caesar, Cormorants, CyclingDeaths, DaytonSurvey, Donner, Geissler, Hauser79, ICU, Mammograms, Mental, PhdPubs, Toxaemia, TV, Vietnam

R code

All of the R code from the book is available in the links below for browsing or saving. Alternatively you can get it all in a zip file.