2026-10-20

The Question

Expected goals (xG) estimates how many goals a player is expected to score based on the quality of their scoring chances.

Can a player’s expected goals (xG) predict the number of goals they actually score?

The Data

The dataset contains goal scoring statistics of football players in different leagues.

For this analysis the two main variables are:

  • xG: Expected goals based on the player’s scoring chances
  • Goals: Actual number of goals scored

Other variables include country, player name, league, club, matches played, minutes played and shots.

Source: Kaggle Goal Scorers Dataset

xG vs Actual Goals

The graph shows a positive relationship, with players having a higher xG generally scoring more actual goals

Simple linear regression

Simple linear regression is used to study the relationship between two numerical variables

In this analysis:

  • Predictor (x):: Expected Goals (xG)
  • Outcome (y):: Actual Goals

We use simple linear regression to see how well xG can predict the number of goals a player scores

Regression Model

The relationship between xG and actual goals can be written as:

\[ Goals = \beta_0 + \beta_1(xG) + \varepsilon \]

  • \(\beta_0\) = intercept

  • \(\beta_1\) = change in actual goals when xG increases by 1

  • \(\varepsilon\) = random error

The model explains how actual goals are related to expected goals

Fitted Regression Model

After using the data, the fitted regression model is:

\[ \widehat{Goals} = \hat{\beta}_0 + \hat{\beta}_1(xG) \]

where:

  • \(\widehat{Goals}\) = predicted number of goals

  • \(\hat{\beta}_0\) = estimated intercept

  • \(\hat{\beta}_1\) = estimated effect of xG

The fitted model allows us to predict actual goals using a player’s xG

Fitting the Model in R

We use lm() to fit the simple linear regression model.

model <- lm(Goals ~ xG, data = goal_data)

The fitted model gives:

\[ \widehat{Goals} = 2.61 + 0.96(xG) \]

  • Intercept: 2.61
  • xG coefficient: 0.96

This means that when xG increases by 1, the model predicts about 0.96 more goals.

Regression Line

The regression line shows a positive relationship between xG and actual goals. As xG increases the predicted number of goals increases

Interactive xG vs Actual Goals

Hover over points to see player’s name, xG and actual goals

What Did we Learn?

The regression analysis shows the xG is a strong predictor of actual goals.

  • For every 1 increase in xG predicted goals increases by about 0.96 goals
  • The model has an \(R^2\) of 0.819 meaning xG explains about 81.9% of the variation in actual goals
  • The relationship between xG and actual goals is statistically significant

Conclusion

Players with higher expected goals generally score more actual goals showing that xG can be useful for predicting goal scoring performance