pdf("ex0801.pdf") # Read in data from ASCII formatted (Fixed With File) ex0801dat <- read.fwf("http://www.stat.ufl.edu/~winner/data/biostat/ex0801.dat", width=c(8,8), col.names=c("dose","death")) # Create a dataset (frame) from input data ex0801 <- data.frame(ex0801dat) # Attach the dataset for analysis attach(ex0801) # Fit the logistic regression model with dependent variable = death # and independent variable = dose # glm means generalized linear model, we are using the binomial distribution, and logit link function ex0801.reg <- glm(death ~ dose, family=binomial("logit")) summary(ex0801.reg) anova(ex0801.reg, test="Chisq") dev.off()