rm(list = ls()) oring.sllr <- read.table( #"C:\\E-drive\\Books\\ANREG2\\newdata\\tab20-3.DAT", #"C:\\E-drive\\Books\\LOGLIN3\\DATA\\tab2-1.dat", url("http://stat.unm.edu/~fletcher/LLM/DATA/TAB2-1.dat"), sep="",col.names=c("Case","Flt","y","s","f","no")) attach(oring.sllr) oring.sllr #summary(oring.sllr) #Summary tables or <- glm(y ~ x,family = binomial) orp=summary(or) orp anova(or) #prediction new = data.frame(x=c(31,53)) predict(or,new,type="response") rpearson=(y-or$fit)/(or$fit*(1-or$fit))^(.5) rstand=rpearson/(1-hatvalues(or))^(.5) infv = c(y,or$fit,hatvalues(or),rpearson, rstand,cooks.distance(or)) inf=matrix(infv,I(orp$df[1]+orp$df[2]),6,dimnames = list(NULL,c("y","yhat","lev","Pearson","Stand.","C"))) inf R2 = (cor(y,or$fit))^2 R2 altR2=(or$null.deviance - or$deviance)/or$null.deviance altR2