R analysis

Job ID: 33397006

Budget: $30 – $250 USD

Make summary statistics (25 of 100 points) Find two other ways to split the data and present it like in the above description of the relative frequencies of fours/sixes/wickets across overs and wickets lost. Each of your two slicings should involve a combination of at least three variables. Possible variables include, but are not limited to players, leagues, teams, overs left, wickets lost, runs scored so far, inning, outcome of previous ball, fielder involved, and sentiment of commentary text. Each of the two ways must include an informative ggplot.

Identify second inning ‘turning points’ (25 of 100 points) Use the runs and resources information in the next section of this document, as well as sentiment analysis of the commentary in the FullNotes variable to produce a list of 20 balls that could be in a highlight reel. You might do this by making up a formula that gives each ball an excitement score based on a sum of emotional valence and the amount that a team either falls behind or comes up ahead. For full marks, add some diversity to your highlight reel, it shouldn’t include all sixes or all wickets. Keep this to second inning balls so that you can take advantage of the target (described next section)

Find a meaningful clustering of matches (25 of 100 points) Aggregate the matches (hint: the ddply function in the K-means clustering section is great for this) and apply K-means clustering to the matches to find some meaningful archetypes of games. Example clusters: high scoring games, very close games, games with early wickets, etc. Make sure to scale your variables appropriately.

Optimize Duckworth-Lewis (25 of 100 points) Use the optim function on the first inning data to fit a smooth function (e.g., a polynomial or a sigmoid) to the proportion of a team’s total score (run total at the end of the first inning) that they achieve after X overs and Y wickets lost. The Duckworth-Lewis, or DLS table essentially does a similar optimiziation, so compare your answers. (i.e., the spot where 50% of the resource is used up is where half of the runs should be scored by.)