The bulk of our data were obtained from FootyStats for a fee, selecting the 2022/23 season option and downloading the .csv called Match H2H CSV. Data on the locations of each team's stadium were compiled ourselves using google maps. Data on the standings and scores of each team from the previous EPL season were obtained from TNTSports, who allow for non-commercial use.\
We will use information on the distances that an away team has to travel to attend a match. These distances were computed using the co-ordinate data mentioned above, and the `distVincentyEllipsoid` function in the `geosphere` package in R. We could have taken travel distance data directly from google maps, which would also calculate actual distance rather than as-the-crow-flies, but this would require either manually collecting 190 distances or automation using the API.\
The previous seasons standings data were copied into a spreadsheet and cleaned up, changing team names to follow the same standard as the FootyStats data, before being exported to a .csv file.\
The relevant data from FootyStats were extracted, some processed, and saved in a new file. Processing included reading the first goal time out of a string containing a list of all goal times, for instance taking the string "10,27,64" into the numeric value 10.\
For a 3rd party source on what exactly to count as a derby game we used an article by The Mirror @derbygames. This was processed using a python script (see appendices) and included in the data preparation R script.\
We will use data on the number of league points attained by a team in the previous Premier League season, for a short discussion on why we use this variable in particular please see the 'Testing correlations' section under exploratory analysis. 
/*The first step we wanted to carry out after data collection was filtering out matches in which red cards were awarded to one or more teams. Due to the absence of one or more players it was assumed that the results of any analysis based on these matches would be unsuitable for predictive purposes. At least one red card was awarded to the home team on 18 occasions, to the away team on 10, leaving a total of 353 / 380 games of the season with none handed out. Most analysis will be performed on data of red-card-free matches, any analysis with these matches included will be noted as such.*/