## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.3     ✓ purrr   0.3.4
## ✓ tibble  3.0.6     ✓ dplyr   1.0.4
## ✓ tidyr   1.1.2     ✓ stringr 1.4.0
## ✓ readr   1.4.0     ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()

Data Preparation

I collected the data using an API. I used python to create the dataset. The code can be found here: https://github.com/jglendrange/data606/blob/main/leagueAPI.ipynb

playerStats <- read.csv("https://raw.githubusercontent.com/jglendrange/data606/main/playerMatchStats.csv")
glimpse(playerStats)
## Rows: 12,550
## Columns: 9
## $ X                  <int> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, …
## $ gameId             <dbl> 3856873255, 3856873255, 3856873255, 3856873255, 38…
## $ visionScore        <int> 13, 39, 10, 10, 37, 13, 14, 21, 47, 31, 45, 33, 28…
## $ goldEarned         <int> 9173, 8568, 8377, 11397, 7035, 12398, 13168, 10401…
## $ totalMinionsKilled <int> 139, 12, 155, 168, 25, 147, 175, 140, 42, 15, 54, …
## $ role               <chr> "SOLO", "NONE", "SOLO", "DUO_CARRY", "DUO_SUPPORT"…
## $ lane               <chr> "MIDDLE", "JUNGLE", "TOP", "BOTTOM", "BOTTOM", "TO…
## $ userId             <chr> "F_7N8wSdjoPdUw1SBn6P2t62PeDArMYt_GmtbU4RJe9rr9k",…
## $ rank               <chr> "SILVERII", "GOLDIV", "GOLDIV", "GOLDIV", "GOLDIV"…

Research question

I have been playing a game named “League of Legends” on and off for aproximetly a decade. During my journey as a player I began to practice and study methods to get better at the game. The most common advice I would hear from friends and professional players online was: “Get better at CS’ing”. I won’t get into too much of the mechanics of the game, but CS stand for creep score. Or, in other words, how many creeps a player kills throughout the game. I want to investigate whether or not this claim is true. Does CS correlate to a players rank in the game?

Cases

count(playerStats)
##       n
## 1 12550

Each row in the dataset represents 1 game played by 1 individual. I was able to collect 12,550 cases.

Data collection

At first I researched if there were any data sets online that met my criteria. I needed data at a match and player level. Stats around how a specific player performed in a random match. I couldn’t find it online, so I turned to leage of legends API.

Type of study

This is an observational study. The matches have already occured and I am just look at statistics aound each player.

Data Source

The data source can be found in RIOT Games’ API documentation found here: https://developer.riotgames.com/apis

Dependent Variable

Here the response variable is “Total Minions Killed”. We want to understand how a players ranking will influence how many minions they kill in a given match.

Independent Variable

Ranking: The players rank is going to be our independent quantitative variable. There are 27 possible ranks 1 being the lowest and 27 the highest.

Role: There are 10 participants in each game. 5 on each team. The Role is what position they play. It can be 1 of 5 values: Carry, Support, Mid, Top, and Jungle.This is our independent qualitative variable.

Relevant summary statistics

The mean is 112 with a minimum of 0 and a maximum of 403. I think there will need to be some further cleanup.

summary(playerStats$totalMinionsKilled)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0    35.0   112.0   105.3   162.0   403.0
boxplot(playerStats$totalMinionsKilled)