Question: Need help to set up a R code for following question Go read the article One match to go!, by Spiegelhalter and Ng, linked from

Need help to set up a R code for following question

Go read the article "One match to go!", by Spiegelhalter and Ng, linked from our Canvas site. In this article, the authors describe how they formulated an approach for predicting the probability of different outcomes for soccer matches based on "attack strength" and "defense weakness." It is better than the simple approach we took in class, though probably not as good as what actual bookmakers (i.e. in Las Vegas) use. Now go download the data from the 2018-19 English Premiere League soccer season. (We'll use the data from two seasons ago because the 2019-20 season was disturbed by the pandemic, while the 20-21 season is only just getting started.) These are in the files "epl_2018-19_away.csv" and "epl_2018-19_home.csv", which give the home and away performance for all 20 teams. These two files allow you to replicate the analysis described in the "One Match to Go!" article. Specifically, the columns of interest in each file are "GF" and "GA", which are "Goals For" and "Goals Against," respectively. So, for example, in the "epl_2018-19_away.csv" you'll notice that Manchester City has 38 for GF and 11 for GA. That means in their away games that season, Manchester City scored 38 goals and allowed 11 goals by their opponents. (Note: this data were [downloaded from here].(http://www.soccerstats.com/latest.asp?league=england)

Replicate Spiegelhalter and Ng's approach using the 2018-19 data to answer the following two questions:

1. What is your estimated probability distribution of win/lose/draw results for a match between Liverpool (home) and Tottenham (away)?

2. What about Manchester City (home) versus Arsenal (away)?

Notes and requirements:

You might find this easiest to do in Excel or a similar spreadsheet program (Google Sheets, Numbers, etc), although you can certainly use R if you want. If you use Excel or similar, you'll submit your spreadsheet and/or Google Sheets link as your upload for Problem 3, instead of an R script. You'll see a separate "Problem 3 work files" submission link for this homework.

Spiegelhalter and Ng did the calculations for the whole League, but you certainly don't need to; these two games will suffice.

Your write-up doesn't need the break down the results by all possible game scores (1-0, 1-1, etc); just summarize the probability of a draw or win for each team. The one exception is that, in your "Approach" section, you should include an explicit math formula that shows how you calculated the probability of a 2-1 victory for the home team in each of the two games. This formula will serve as an example of your approach for calculating all the necessary probabilities. You can insert an equation directly into the document via Word's Equation Editor or similar, or you can simply include a handwritten equation that you took a photo of.

Summarize the Spiegelhalter and Ng approach in your words in your Approach section of your write-up. It's fine to assume independence between the teams' scores but state this assumption in the Approach section.

Don't get confused by the "Pts" (points) column. This isn't goals. "Points" are how the league crowns a winner, with a team getting 3 points for a win and 1 point for a draw.

GP means "games played."

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!