# Groundhog Day Predictions (Shadow = 1) --- Logistic Regression # Data Source: www.stormfax.com/ghogday.htm groundhog <- read.table("groundhog.dat", header=TRUE) plot(groundhog) groundhog.model <- glm(Shadow ~ Year, family=binomial, data=groundhog) summary(groundhog.model) reduced.model <- glm(Shadow ~ 1, family=binomial, data=groundhog) anova(reduced.model, groundhog.model, test="Chisq") dev.new() plot(groundhog) lines(groundhog$Year, predict(groundhog.model, type="response"))