Worldcup
A Comprehensive Database on the FIFA World Cup (Men's and Women's)
Install / Use
/learn @jfjelstul/WorldcupREADME
The Fjelstul World Cup Database
The Fjelstul World Cup Database is a comprehensive database about the FIFA World Cup created by Joshua C. Fjelstul, Ph.D. that covers all 22 men's tournaments (1930-2022) and all 8 women's tournaments (1991-2019). The database includes 27 datasets (over 1.58 million data points) that cover all aspects of the World Cup.
The database has been featured by The Washington Post, FiveThirtyEight, The Markup, Data is Plural, The Times, Agence France-Presse (AFP), Barron's, Latinometrics, Hindustan Times, and DataCamp.
Users can use the database to calculate statistics about teams, players, managers, and referees. Users can also use the data to predict match results. With many units of analysis and opportunities for merging and reshaping data, the database is also an excellent resource for teaching data science skills.
Here are some example visualizations that use the data:
<div> <img src="https://github.com/jfjelstul/worldcup/blob/master/visualizations/match-results.png?raw=true" width="90%"> </div> <div> <img src="https://github.com/jfjelstul/worldcup/blob/master/visualizations/goals-by-European-teams.png?raw=true" width="70%"> </div> <div> <img src="https://github.com/jfjelstul/worldcup/blob/master/visualizations/goals-by-South-American-teams.png?raw=true" width="70%"> </div>Overview of the database
The 27 datasets in the database are organized into 5 groups:
-
A first group of datasets (containing
9datasets) includes information about each of the9basic units of observation in the database: tournaments (tournaments), including the host country, the winner, the dates of the tournament, and information about the format of each tournament; the FIFA confederations (confederations); teams (teams); players (players); managers (managers), including their team and home country; referees (referees), including their home country and confederation; stadiums that have hosted World Cup matches (stadiums); matches (matches), including the stage of the tournament, the location of the match (country, city, stadium), the teams involved, and the result; and the individual awards that are handed out to players at each tournament (awards). Each of these units of observation has a unique ID number. -
A second group of datasets (containing
4datasets) maps teams, players, managers, and referees to tournaments. There is a dataset about which teams qualified (qualified teams), which indicates how each team performed in the tournament; a dataset about squads (squads), which indicates the name, position, and shirt number of each player; a dataset about manager appointments (manager_appointments), which indicates the team and home country of each manager; and a dataset about referee appointments (referee_appointments), which indicates the home country and confederation of each referee. -
A third group of datasets (containing
4datasets) maps teams, players, managers, and referees to individual matches. There are datasets about team appearances (team_appearances), player appearances (player_apperances), manager appearances (manager appearances), and referee appearances (referee appearances). Players who start a game on the bench but who are not substituted in appear in thesquadsdataset but not theplayer_appearancesdataset. -
A fourth group of datasets (containing
4datasets) cover in-match events, including: all goals (goals); all attempted penalty kicks in penalty shootouts and their outcomes (penalty_kicks); all bookings (bookings), including yellow cards and red cards; and all substitutions (substitutions). Each dataset includes the minute of the event and the player(s) and team involved. Each of these4types of in-match events has a unique ID number. -
A fifth group of datasets (containing
6datasets) cover tournament-level attributes. There a dataset about host countries (host_countries), including the performance of each host country; a dataset about the stages in each tournament (tournament_stages), which records each stage of the tournament, the dates of the stage, and key features of the stage; a dataset about the groups in each group stage (groups), which indicates the name of each group and the number of teams in each group; a dataset about the final standings in each group (group_standings); a dataset about the final standings for each tournament (tournament_standings); and a dataset about all individual player awards handed out at each tournament (award_winners).
Downloading the data
The Fjelstul World Cup Database is available via the R package worldcup, which you can install from this repository (instructions below). Note that this repository is structured as a repository for an R package. You can also download the database directly from this repository in 4 formats: an .RData version of the database is available in the data/ folder, a .csv version is available in the data-csv/ folder, a .json version is available in the data-json/ folder, and a relational database version (SQLite) is available in the data-sqlite/ folder.
The .Rdata, .csv, and .json versions of the database are all identical except for the file format. These versions of the database are not technically relational because many tables already include variables that have been merged in from other tables for convenience (i.e., some data exists in multiple tables). The SQLite version includes all of the same variables, but variables from other tables are not already merged in. Dummy variables that are coded 0 or 1 are converted to FALSE and TRUE. Users can use the primary and foreign keys in the tables to merge in data from other tables. See the README.md file in the data-sqlite/ folder for more details on using the relational database.
Downloading the codebook
The codebook for the Fjelstul World Cup Database is available in .pdf format in the codebook/pdf/ folder.
The codebook is also available in .csv format in the codebook/csv/ folder. There are 2 files: datasets.csv, which describes the contents of each dataset, and variables.csv, which describes each variable.
The codebook for the database is also included in the R package: worldcup::datasets and worldcup::variables. The same information is also available as part of the R documentation for each dataset. For example, you can see the codebook for the worldcup::matches dataset by running ?worldcup::matches.
The license
The copyright for the original structure and organization of the Fjelstul World Cup Database and for all of the documentation and replication code for the database is owned by Joshua C. Fjelstul, Ph.D.
The Fjelstul World Cup Database and the worldcup package are both published under a CC-BY-SA 4.0 license. This means that you can distribute, modify, and use all or part of the database for commercial or non-commercial purposes as long as (1) you provide proper attribution and (2) any new works you produce based on this database also carry the CC-BY-SA 4.0 license.
To provide proper attribution, according to the CC-BY-SA 4.0 license, you must provide the name of the author ("Joshua C. Fjelstul, Ph.D."), a notice that the database is copyrighted ("© 2023 Joshua C. Fjelstul, Ph.D."), a link to the CC-BY-SA 4.0 license (https://creativecommons.org/licenses/by-sa/4.0/legalcode), and a link to this repository (https://www.github.com/jfjelstul/worldcup). You must also indicate any modifications you have made to the database.
Consistent with the CC-BY-SA 4.0 license, I provide this database as-is and as-available, and make no representations or warranties of any kind concerning the database, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable.
The datasets
-
tournaments: This dataset records all World Cup tournaments. There is one observation per tournament. It includes the host of the tournament, the winner of the tournament, the start and end dates of the tournament, and information about the format of the tournament. There are18variables and30observations. -
confederations: This dataset records all FIFA confederations. There is one observation per confederation. There are5variables and6observations. -
teams: This dataset records all teams who have participated in a World Cup match. There is one observation per team. It includes the 3-letter ISO code for each country and information about each country's national federation and FIFA confederation. There are14variables and88observations. -
players: This dataset records all players who have participated in a World Cup match, including players on the bench. There is one observation per p
Related Skills
notion
341.6kNotion API for creating and managing pages, databases, and blocks.
feishu-drive
341.6k|
things-mac
341.6kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
341.6kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
