Skip to content

You're working as a sports journalist at a major online sports media company, specializing in soccer analysis and reporting. You've been watching both men's and women's international soccer matches for a number of years, and your gut instinct tells you that more goals are scored in women's international football matches than men's. This would make an interesting investigative article that your subscribers are bound to love, but you'll need to perform a valid statistical hypothesis test to be sure!

While scoping this project, you acknowledge that the sport has changed a lot over the years, and performances likely vary a lot depending on the tournament, so you decide to limit the data used in the analysis to only official FIFA World Cup matches (not including qualifiers) since 2002-01-01.

You create two datasets containing the results of every official men's and women's international football match since the 19th century, which you scraped from a reliable online source. This data is stored in two CSV files: women_results.csv and men_results.csv.

The question you are trying to determine the answer to is:

Are more goals scored in women's international soccer matches than men's?

You assume a 10% significance level, and use the following null and alternative hypotheses:

: The mean number of goals scored in women's international soccer matches is the same as men's.

: The mean number of goals scored in women's international soccer matches is greater than men's.

# Start your code here!
import pandas as pd
import pingouin as pg
# load the two dataset
women = pd.read_csv("women_results.csv", parse_dates=["date"])
men = pd.read_csv("men_results.csv", parse_dates=["date"])
# EDA
print(women.head())
print(men.head())
print(men.info())
print(women.info())
# filter for only fifa matches since 2002-01-01
women = women.query("tournament == 'FIFA World Cup' and date >= '2002-01-01'")
men = men.query("tournament == 'FIFA World Cup' and date >= '2002-01-01'")
print(women.describe())
print(men.describe())
men_scores = men["home_score"] + men["away_score"]
women_scores = women["home_score"] + women["away_score"]

Two-Sided T-Test for FIFA World Cup Scores

We are performing a two-sided t-test to compare the total scores of men's and women's FIFA World Cup matches since 2002. This test helps us determine if there is a statistically significant difference between the two groups.

Hypothesis

  • Null Hypothesis (H0): There is no significant difference in the total scores between men's and women's FIFA World Cup matches.
  • Alternative Hypothesis (H1): There is a significant difference in the total scores between men's and women's FIFA World Cup matches.

Significance Level

  • Alpha Level (α): 0.1

If the p-value is less than our alpha level (0.1), we reject the null hypothesis, indicating a significant difference.

# set the significance level
alpha = 0.1

# performing two_sided t-test
p_value = pg.ttest(x=men_scores, y=women_scores, paired=False, alternative="two-sided").loc["T-test", "p-val"]

result = "fail to reject" if p_value > alpha else "reject"
result_dict = {"p_val":p_value, "result": result}

result_dict

Conclusion

The results of our two-sided t-test reveal a p-value of approximately 0.0052, which is significantly lower than our chosen alpha level of 0.1. Consequently, we reject the null hypothesis, indicating that there is a statistically significant difference in the total scores between men's and women's FIFA World Cup matches since 2002.

Key Findings

  • P-value: ~0.0052
  • Alpha Level: 0.1
  • Result: Reject the null hypothesis

Implications

This finding is intriguing as it suggests that the dynamics of scoring in men's and women's World Cup matches are distinct. Such a difference could be influenced by various factors, including:

  • Playing styles
  • Strategies
  • Evolution of the sport over the years

Future Research

This insight opens up exciting avenues for further research to explore:

  • The underlying reasons behind this disparity
  • How it impacts the overall experience and development of the game in both men's and women's tournaments