{"id":31688314,"url":"https://github.com/avazasgarov/soccer-hypothesis-testing","last_synced_at":"2026-04-30T08:32:57.210Z","repository":{"id":318371530,"uuid":"1071016684","full_name":"AvazAsgarov/soccer-hypothesis-testing","owner":"AvazAsgarov","description":"Statistical analysis comparing goal-scoring patterns in Men’s vs. Women’s FIFA World Cups using hypothesis testing.","archived":false,"fork":false,"pushed_at":"2025-10-06T18:59:40.000Z","size":2076,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T20:46:40.229Z","etag":null,"topics":["data-analysis","eda","hypothesis-testing","matplotlib-pyplot","pandas","pingouin","python","scipy"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AvazAsgarov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-06T18:45:54.000Z","updated_at":"2025-10-06T19:02:24.000Z","dependencies_parsed_at":"2025-10-06T20:46:42.440Z","dependency_job_id":null,"html_url":"https://github.com/AvazAsgarov/soccer-hypothesis-testing","commit_stats":null,"previous_names":["avazasgarov/soccer-hypothesis-testing"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/AvazAsgarov/soccer-hypothesis-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvazAsgarov%2Fsoccer-hypothesis-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvazAsgarov%2Fsoccer-hypothesis-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvazAsgarov%2Fsoccer-hypothesis-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvazAsgarov%2Fsoccer-hypothesis-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AvazAsgarov","download_url":"https://codeload.github.com/AvazAsgarov/soccer-hypothesis-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvazAsgarov%2Fsoccer-hypothesis-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278931658,"owners_count":26070788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","eda","hypothesis-testing","matplotlib-pyplot","pandas","pingouin","python","scipy"],"created_at":"2025-10-08T10:54:47.524Z","updated_at":"2025-10-08T10:54:50.609Z","avatar_url":"https://github.com/AvazAsgarov.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Man vs. Woman Poster](assets/soccer-analysis-banner.png)\n\n# Statistical Analysis of Goal-Scoring in Men's vs. Women's World Cups\n\nThis project conducts a statistical investigation to answer questions in the soccer world: **Are more goals scored in Women's FIFA World Cup matches than in Men's?**\n\nIt uses hypothesis testing with Python libraries like `pandas`, `scipy`, and `pingouin` to determine if the observed differences in goal-scoring are statistically significant or merely due to random chance.\n\n## Key Findings: A Summary of Results\n\nThe analysis tested four distinct hypotheses using a **significance level (α) of 0.10**. The results provide a nuanced picture of the differences and similarities between the two tournaments.\n\n| Hypothesis Tested                                      | P-Value | Significance Level (α) | Result                        |\n| ------------------------------------------------------ | ------- | ---------------------- | ----------------------------- |\n| 1. Mean **Total Goals** are greater in Women's matches   | 0.0051  | 0.10                   | **Reject Null Hypothesis** |\n| 2. Proportion of **Draws** is different                | 0.0192  | 0.10                   | **Reject Null Hypothesis** |\n| 3. Mean **Home Team Goals** are different              | 0.0148  | 0.10                   | **Reject Null Hypothesis** |\n| 4. Mean **Away Team Goals** are greater in Women's matches | 0.6398  | 0.10                   | **Fail to Reject Null Hypothesis** |\n\n## The Analytical Question: Is the Difference Statistically Significant?\n\nExploratory data analysis showed that the goal data is not normally distributed, which is why non-parametric tests were chosen.\n\nTo visualize the distribution of goals in both tournaments, see the plot below:\n\n![Goal Distribution](assets/goal-distribution.png)\n\n## Hypotheses for the Analysis\n\nThe project was structured around four precise hypotheses:\n\n**1. Mean Total Goals:**\n\n  - **$H_0$ (Null Hypothesis):** The mean total goals are the same in both tournaments.\n  - **$H_a$ (Alternative Hypothesis):** The mean total goals are greater in the Women's World Cup.\n\n**2. Frequency of Draws:**\n\n  - **$H_0$ (Null Hypothesis):** The proportion of matches ending in a draw is the same for both tournaments.\n  - **$H_a$ (Alternative Hypothesis):** The proportion of matches ending in a draw is different between the two tournaments.\n\n**3. Mean Home Team Goals:**\n\n  - **$H_0$ (Null Hypothesis):** The mean home goals scored is the same in both tournaments.\n  - **$H_a$ (Alternative Hypothesis):** The mean home goals scored is different between the two tournaments.\n\n**4. Mean Away Team Goals:**\n\n  - **$H_0$ (Null Hypothesis):** The mean away goals scored is the same in both tournaments.\n  - **$H_a$ (Alternative Hypothesis):** The mean away goals scored is greater in the Women's World Cup.\n\n## Methodology and Statistical Toolkit\n\nTo ensure the analysis was robust, specific statistical tests were chosen based on the data type and distribution.\n\n### Mann-Whitney U Test\n\n  - **What it is:** A non-parametric test used to compare the distributions of two independent samples.\n  - **Why it was chosen:** The exploratory data analysis (EDA) revealed that the goal-scoring data (`total_goals`, `home_score`, `away_score`) is not normally distributed (it is right-skewed). The Mann-Whitney U test is the appropriate choice in this scenario, as it does not assume normality, unlike its parametric counterpart, the t-test. It was used for Hypotheses 1, 3, and 4.\n\n### Chi-Squared Test of Independence\n\n  - **What it is:** A test used to determine if there is a significant association between two categorical variables.\n  - **Why it was chosen:** Hypothesis 2 deals with match outcomes (e.g., \"Draw,\" \"Win\"), which are categorical. The Chi-Squared test allows us to compare the proportions of these outcomes across the two gender categories to see if the distribution of outcomes is independent of the tournament type.\n\n### Custom Interpretation Function\n\nA general Python function was created to standardize the interpretation of the p-value against the significance level for each test, ensuring consistency and readability.\n```python\ndef interpret_hypothesis_test(p_value, alt_description, alpha=0.1):\n    \"\"\"\n    General function to interpret hypothesis test results.\n\n    Parameters:\n    - p_value (float): The p-value from the test result.\n    - alt_description (str): What the alternative hypothesis claims.\n    - alpha (float, optional): Significance level (default is 0.1).\n    \"\"\"\n    \n    print(f\"Significance Level (alpha): {alpha}\")\n    print(f\"P-value: {p_value:.4f}\")\n\n    if p_value \u003c alpha:\n        print(\"Result: Reject the null hypothesis (H₀).\")\n        print(f\"Conclusion: There is significant evidence that {alt_description}.\")\n    else:\n        print(\"Result: Fail to reject the null hypothesis (H₀).\")\n        print(f\"Conclusion: There is not enough evidence to conclude that {alt_description}.\")\n```\n\n## Dataset Description\n\nThis analysis uses two datasets containing the results of every official men's and women's international football match since the 19th century. The data was scraped from a reliable online source and stored in two CSV files:\n\n* `men_results.csv`\n* `women_results.csv`\n\nFor this project, the data was filtered to include **only official FIFA World Cup matches** (not including qualifiers) that occurred **since January 1, 2002**.\n\nEach record contains the following columns: `date`, `home_team`, `away_team`, `home_score`, `away_score`, and `tournament`.\n\n## Project Structure\n```\nsoccer-hypothesis-testing/\n│\n├── assets/\n│   ├── soccer-analysis-banner.png\n│   └── goal-distribution.png\n│\n├── data/\n│   ├── men_results.csv\n│   └── women_results.csv\n│\n├── world_cup_goals_analysis.ipynb\n│\n└── README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favazasgarov%2Fsoccer-hypothesis-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favazasgarov%2Fsoccer-hypothesis-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favazasgarov%2Fsoccer-hypothesis-testing/lists"}