shuttle.f=data.frame(Temp=c(66,72,70,75,75,70,73,78,70,76,69,70,67,81,58,68,57,53,76,67,63,67,79),Distress=c(0,0,1,0,1,1,rep(0,8),1,0,1,1,0,0,1,0,0)) glm.logit=glm(Distress~Temp,family=binomial(link=logit),data=shuttle.f) summary(glm.logit) glm.probit=glm(Distress~Temp,family=binomial(link=probit),data=shuttle.f) summary(glm.probit) glm.cll=glm(Distress~Temp,family=binomial(link=cloglog),data=shuttle.f) summary(glm.cll) attach(shuttle.f) plot(Temp,Distress) lines(Temp[order(Temp)],fitted(glm.logit)[order(Temp)],lty=2,col=1) lines(Temp[order(Temp)],fitted(glm.probit)[order(Temp)],lty=3,col=2) lines(Temp[order(Temp)],fitted(glm.cll)[order(Temp)],lty=4,col=3) legend(x=70,y=.75,legend=c("Logit","Probit","Complementary log-log"),lty=c(2,3,4),cex=.85,col=c(1,2,3)) stdp.logit=resid(glm.logit,type="pearson")/sqrt(1-lm.influence(glm.logit)$hat) stdp.probit=resid(glm.probit,type="pearson")/sqrt(1-lm.influence(glm.probit)$hat) stdp.cll=resid(glm.cll,type="pearson")/sqrt(1-lm.influence(glm.cll)$hat) x11() plot(Temp,stdp.logit,pch=2,ylab="Standardized Pearson Residual",xlab="Temperature") points(Temp,stdp.probit,pch=3) points(Temp,stdp.cll,pch=4) legend(x=55,y=2.5,legend=c("Logit","Probit","Complementary log-log"),pch=c(2,3,4),cex=.85)