6
$\begingroup$

I am using

$X$ The estimated pre-game win probability of a sporting team playing on its Home field (estimated according to a certain model)

to predict

$Y$ Actual proportion of points scored by the Home team in the game (i.e. number of points scored by Home team divided by all points scored in the game).

Graphed, the data look like this.

Home team estimated probability of winning vs Home team actual proportion of score

Data viewable here.

I did a simple linear regression and it produced the parameters $b_{0} = 0.3554$ and $b_{1} = 0.2930$. Thus even at the maximum possible value of $x$ it doesn't predict the home team will score more than 100% of the points.

However, some reading of other questions here indicates that linear regression is generally considered inappropriate for situations in which the outcome variable is a proportion.

The question is highly similar to this one, in which a the poster was seeking to predict a team's winning percentage. There it was suggested that the poster should convert the proportion of wins to the number of wins. However, in my question it would not be the same thing for me to use the number of points scored by the team.

  1. How inappropriate it is for me to use linear regression here?

  2. What analysis should I use, keeping in mind that unlike in the linked question I can't just use the raw number of points scored by the team (since I really am interested in the proportion of points they will score). gung's answer here seems to indicate beta regression if the predictor is a continuous proportion, and logistic regression if it's a count proportion. However, I'm not sure which of those two my predictor is.

  3. Does it make any difference that my predictor is also measured as a proportion?

$\endgroup$
1
  • 2
    $\begingroup$ 1). It's not great because your DV is bounded, 2). Beta regression would be the first choice, since it allows you to model your data as is (without needing to change it), 3). Yes, you could also use a logit transform $$\text{log}\Big(\cfrac{p}{1-p}\Big)$$ to transform your DV and do regular linear regression. $\endgroup$ Commented Oct 26, 2018 at 5:04

2 Answers 2

6
$\begingroup$

A glm with a binomial distribution and a logit link should work fine. If there are no probabilities of $0$ or $1$, beta regression is another possibility. In this case, they yield almost indistinguishable results (not shown).

The relationship between the logit of the actual and the logit of the estimated probabilities looks quite linear (see picture below), which would lead me to use the logit of the estimated probabilities as predictor. The R code using to generate the plots is at the bottom of this answer.

loess_plot

Let's visualize the model on the original scale (the points are partial residuals):

enter image description here

Possible extensions include:

  • Using robust standard errors (see R code below). Stata's fracreg command uses them by default.
  • Using a quasi-likelihood (by using quasibinomial as family in glm)

R code:

library(betareg)
library(visreg)
library(lmtest)
library(sandwich)

# Convert probabilities to log-odds
est_p_logit <- log(est_prob/(1 - est_prob))
act_p_logit <- log(act_prob/(1 - act_prob))

# Check linearity
scatter.smooth(act_p_logit~est_p_logit, las = 1)

# GLM with binomial distribution and logit-link
mod <- glm(act_prob~est_p_logit, family = binomial)

summary(mod)

# Robust standard errors
coeftest(mod, vcov = vcovHC, type = "HC3")

# Visualize GLM model
res_glm <- visreg(mod, scale = "response", ylim = c(0, 1), partial = TRUE, rug = 2)

# Beta regression
mod_beta <- betareg(act_prob~est_p_logit)

# Compare GLM results with beta regression
res_beta <- visreg(mod_beta, scale = "response", ylim = c(0, 1))
lines(res_beta$fit$visregFit~res_beta$fit$est_p_logit, type = "l", col = "red")
$\endgroup$
5
+50
$\begingroup$

Differently from the other answer here which I think is a good answer, I think a linear regression suffices in your exact situation. As a matter of principle, it might be wrong because of the hard bounds on the outcome but a plot of your data suggests why it is a good enough approximation. At both extremes, the mean of your data is far enough from the extremes of the outcome, hence, there is no bending or curving of the relationship to respect the bounds on the original outcome. In short, your predictions appear to be linearly related to the outcome, the major requirement for linear regression.

If the above is true, the advantages of the linear model are then:

  1. ease of interpretation, the coefficients you posted make sense on arrival
  2. one can obtain a relatively simple measure of variability around the fitted line from the regression standard deviation if one cares.

I began by exploring the data:

dat <- read.csv("Estimated probability of winning vs Actual proportion of score - Sheet1.csv")
names(dat) <- c("x", "y")
ggplot(dat, aes(x, y)) + geom_point(shape = 1) + theme_bw() +
  geom_smooth() + geom_smooth(method = "lm", se = FALSE, col = "red")

enter image description here

The blue line is a generalized additive model smoother. The red line is the linear fit. One can observe some curvature at the ends but outwards, not inwards. So your predictions are not exactly linearly related to the outcome. Since you have enough data points, this is probably not arbitrary.

A logit transformation of $y$ is unlikely to help here, rather, a logit transformation of $x$ since it bends outwards. We can shrink the middle $x$ values somewhat and expand the larger $x$ values:

ggplot(dat, aes(log(x / (1 - x)), y)) + geom_point(shape = 1) + theme_bw() +
  geom_smooth() + geom_smooth(method = "lm", se = FALSE, col = "red")

enter image description here

And this time, the linear fit approximates the smoothed fit quite well, not so well at the tails, but good enough for most applications. And homoskedasticity is a plausible assumption.

So the regression model of choice is then:

coef(summary(fit.lm <- lm(y ~ log(x / (1 - x)), dat)))

                 Estimate  Std. Error   t value      Pr(>|t|)
(Intercept)    0.50116288 0.002897402 172.96973  0.000000e+00
log(x/(1 - x)) 0.05446613 0.002045560  26.62652 6.846189e-124

When the predicted log-odds are zero, we expect the win probability to be about 50%. A log-odd higher, and expectation is 5% higher. As seen in the second plot above, the log-odds don't go any further than 5 in either direction. So all the predicted values of $y$ are bound between about 25% and 75%. The regression effect is clear enough and at a large enough sample size that I trust that the inference is not misleading overall. There are always alternatives for better precision.

We can also get a sense of the error about the fitted line.

sigma(fit.lm)
[1] 0.09958555

Given a prediction, about 95% of values should be within about $\pm20\%$. The interval when added to the minimum and maximum predicted $y$ also lies within bounds.

The justification for the linear approach is its simplicity and its adequacy in this particular application.

$\endgroup$
4
  • $\begingroup$ This is certainly an intuitive and attractive approach. If I apply the model, do you think it's legitimate for me to manually change the intercept parameter from 0.50116288 to 0.5 exactly. Because it seems desirable that a team with a .5 chance of winning should be expected to score 50% of the points. $\endgroup$ Commented Oct 27, 2018 at 21:36
  • 1
    $\begingroup$ @user1205901 if you had more data, you could empirically test to see how bad it would be if you made this approximation. If you can live with it, then why not? $\endgroup$ Commented Oct 28, 2018 at 1:54
  • 2
    $\begingroup$ In addition, $0.500$ is within the $95\%$ confidence interval of the estimate for the intercept. $\endgroup$ Commented Oct 31, 2018 at 7:32
  • $\begingroup$ It wouldn't matter much here, but you could also then run a no-intercept model with .5 subtracted off from the outcome: lm(I(y - .5) ~ 0 + log(x / (1 - x)), dat). Any predictions from this model would then have to be adjusted up by .5. Or alternatively using an offset: lm(y ~ 0 + log(x / (1 - x)), dat, offset = rep(.5, nrow(dat))) $\endgroup$ Commented Oct 31, 2018 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.