Marathon Miles per Hour at NAPA Valley 2015 Marathon by Age and Gender Gamma Regression Marathon Miles per Hour at NAPA Valley 2015 Marathon by Age and Gender
Data Description Y = Race speed (Miles per Hour) at Napa Valley 2015 Marathon (3/1/2015) for 1882 Runners (977 M, 905 F) Predictor Variables: Age in Years (18-76) Gender (1=Male, 0=Female) Age x Gender Interaction Distribution: Gamma (Strictly Positive values, skewed right) Potential Link Functions Inverse Link (Conjugate) Log Link
Gamma Distribution – Likelihood Function
Gamma Distribution – Inverse Link
Gamma Distribution – Inverse Link
Estimating f
Gamma Distribution – Log Link
Results – Inverse Link The main effects of Age and gender are significant, the interaction is not Deviance, Goodness-of-Fit and Likelihood Ratio Tests are Described Below
Results – Log Link The main effects of Age and Gender are significant, the interaction is not. Deviance, Goodness-of-Fit and Likelihood Ratio Tests are Described Below
Deviance Deviance measures the discrepancy between the observed and fitted values for a model Both (link) models provide a good fit (both p > 0.50)
Additive Model Results – Log Link
R Program napaf2015 <- read.csv("http://www.stat.ufl.edu/~winner/data/napa_marathon_fm2015.csv", header=T) attach(napaf2015); names(napaf2015) gender <- factor(Gender) napa.mod1 <- glm(mph~1,family=Gamma); summary(napa.mod1); deviance(napa.mod1) napa.mod2 <- glm(mph~Age,family=Gamma); summary(napa.mod2) napa.mod3 <- glm(mph ~ Age, family=Gamma(link="log")); summary(napa.mod3) napa.mod4 <- glm(mph~gender,family=Gamma); summary(napa.mod4) napa.mod5 <- glm(mph~Age + gender,family=Gamma); summary(napa.mod5) napa.mod6 <- glm(mph ~ Age + gender, family=Gamma(link="log")); summary(napa.mod6) napa.mod7 <- glm(mph~Age*gender,family=Gamma); summary(napa.mod7) napa.mod8 <- glm(mph ~ Age*gender, family=Gamma(link="log")); summary(napa.mod8) age1 <- min(Age):max(Age) yhat.F <- exp(1.8494178 - 0.0018116*age1) yhat.M <- exp((1.8494178+0.1521938) - (0.0018116+0.0013388)*age1) plot(Age,mph,col=gender) lines(age1,yhat.F,col=1) lines(age1,yhat.M,col=2) anova(napa.mod5,napa.mod7,test="Chisq") anova(napa.mod6,napa.mod8,test="Chisq") par(mfrow=c(2,2)) plot(Age[Gender=="F"],log(mph[Gender=="F"])) plot(Age[Gender=="M"],log(mph[Gender=="M"])) plot(Age[Gender=="F"],1/mph[Gender=="F"]) plot(Age[Gender=="M"],1/mph[Gender=="M"])