
binnedplot(x ,y, nclass=floor(sqrt(length(x))),
xlab="Expected Values", ylab="Average residual",
main="Binned residual plot",
cex.pts=0.8, col.pts=1, col.int="gray")
title
.par
, plot
data(lalonde)
attach(lalonde)
fit <- glm(treat ~ re74 + re75 + educ + black + hisp + married
+ nodegr + u74 + u75, family=binomial(link="logit"))
x <- predict(fit)
y <- resid(fit)
binnedplot(x,y)
Run the code above in your browser using DataLab