OxBoatRace {glarma} | R Documentation |
Oxford-Cambridge Boat Race
Description
Results of the boat race between Oxford and Cambridge from 1829–2011.
Usage
data(OxBoatRace)
Format
A data frame containing the following columns:
[, 1] | Year | Year in which the race occurred. Some years are missing when the race was not run. |
[, 2] | Intercept | A vector of ones, providing the intercept in the model. |
[, 3] | Camwin | A binary response, zero for an Oxford win, one for a Cambridge win. |
[, 4] | WinnerWeight | Weight of winning team's crew. |
[, 5] | LoserWeight | Weight of losing team's crew. |
[, 6] | Diff | Difference between winning team's weight and losing team's weight. |
Source
Klingenberg, Bernhard (2008) Regression models for binary time series with gaps. Computational Statistics & Data Analysis, 52, 4076–4090.
Examples
### Example with Oxford-Cambridge Boat Race
data(OxBoatRace)
y1 <- OxBoatRace$Camwin
n1 <- rep(1, length(OxBoatRace$Year))
Y <- cbind(y1, n1 - y1)
X <- cbind(OxBoatRace$Intercept, OxBoatRace$Diff)
colnames(X) <- c("Intercept", "Weight Diff")
oxcamglm <- glm(Y ~ Diff + I(Diff^2),
data = OxBoatRace,
family = binomial(link = "logit"), x = TRUE)
summary(oxcamglm)
X <- oxcamglm$x
glarmamod <- glarma(Y, X, thetaLags = c(1, 2), type = "Bin", method = "NR",
residuals = "Pearson", maxit = 100, grad = 1e-6)
summary(glarmamod)
likTests(glarmamod)
## Plot Probability of Cambridge win versus Cambridge Weight advantage:
beta <- coef(glarmamod, "beta")
par(mfrow = c(1, 1))
plot(OxBoatRace$Diff, 1 / (1 + exp(-(beta[1] + beta[2] * OxBoatRace$Diff +
beta[3] * OxBoatRace$Diff^2))),
ylab = "Prob", xlab = "Weight Diff")
title("Probability of Cambridge win \n versus Cambridge weight advantage")
## Residuals and fit plots
par(mfrow=c(3, 2))
plot.glarma(glarmamod)
[Package glarma version 1.6-0 Index]