Errata are corrected as found and incorporated into newly printed copies of the book. This means that not all the errata listed below exist in your copy of the book. If you see any errors not listed below, please let me know.
usageurban
should be beta_3gdf <- group_by(wcgs, cut(linpred, breaks=unique(quantile(linpred, (1:100)/100))))
with
gdf <- group_by(wcgs, ntile(linpred,100))
The original fails because the largest and smallest values get sorted into an NA category. The ntile
function chooses the breakpoints so that there are a roughly equal number of observations per bin. We choose 100 bins. This should be varied according to the size of the dataset.
gdf <- group_by(wcgsm, cut(linpred, breaks=unique(quantile(linpred, (1:100)/101))))
with
gdf <- group_by(wcgsm, ntile(linpred,100))
hldf <- summarise(gdf, y=sum(chd=='yes'), ppred=mean(predprob), count=n())
> c(hlstat, nrow(hldf))
[1] 127.99 100.00
> 1-pchisq(127.99, 100-2)
[1] 0.02262
sum(residuals(lmod,type="pearson")^2)
robust
package has been superceded by the robustbase
package.lme4
has changed since publication. Now when the MLE of a variance component approaches the boundary of the parameter space (usually zero), it prints a warning message. Since this occurs frequently in the boostrap sampling, many warning messages are produced. But these are warnings and not an errors - the results are OK.refit()
function in the current (April 2016) lme4
no longer works as expected. Replace:rmodr <- refit(rmod, ryield)
with
rmodr <- lmer(ryield ~ treat + (1|blend), penicillin)
The replacement achieves the same intended purpose but is slightly less efficient than the original. - p378 LHS of formula for the likelihood ratio test statistic is missing a minus