#read in space shuttle data from data file shuttle.df <- read.table("data/shuttle.dat",header=T) attach(shuttle.df) #plot data plot(temp,ndo,type="n",xlim=c(30,85),ylim=c(0,6),xlab="TEMPERATURE",ylab="#DAMAGED O-RINGS") points(temp,ndo,col=ndo+1) title("O-ring damage during Challenger launches") #create binary response and design matrix y <- as.numeric(ndo>0) #fit model using R glm function fit <- glm(y~temp,family=binomial) summary(fit) plot(fit)