lolimg

Introduction

League of Legends is a 5v5 multiplayer online battle arena. Each player fulfills one of 5 roles (Top, Mid, ADC, Support, and Jungle) and has the objective of destroying the enemy team’s Nexus. Since its release, League of Legends has become one of the most played games in the world, ranking 5th overall for the most popular PC games by monthly active users.

Along with being one of the most popular games globally, League of Legends is also the world’s largest esport. During League of Legends esport tournaments, each player on both teams has the chance to ban a champion. When a champion is banned, they are removed from the pool of available champions and cannot be selected. Since each player can ban a champion, there are a total of 10 bans per game. During tournaments some champions are more banned than others. This leads us to our question:

If a team doesn’t ban the most banned champions, are they more likely to lose?

We want to see the impact a champion’s presence, or lack thereof, can have on the results of the match. Depending on our results, viewers of these tournaments can potentially predict the outcome of the match before it even starts and the teams playing in them can be better informed on the importance of their bans and better decide who to ban.

In order to answer this question, we’ll use a permutation test to analyze whether banning a commonly banned champion yields a higher win rate than not banning one. Before we get to that, we will clean the data, perform an EDA, and assess and determine what to do about the missing data.

For this project, we are going to look at Oracle’s Elixer’s League of Legends Competitive Matches data from 2022.

gameid datacompleteness url league year split playoffs date game patch participantid side position playername playerid teamname teamid champion ban1 ban2 ban3 ban4 ban5 gamelength result kills deaths assists teamkills teamdeaths doublekills triplekills quadrakills pentakills firstblood firstbloodkill firstbloodassist firstbloodvictim team kpm ckpm firstdragon dragons opp_dragons elementaldrakes opp_elementaldrakes infernals mountains clouds oceans chemtechs hextechs dragons (type unknown) elders opp_elders firstherald heralds opp_heralds firstbaron barons opp_barons firsttower towers opp_towers firstmidtower firsttothreetowers turretplates opp_turretplates inhibitors opp_inhibitors damagetochampions dpm damageshare damagetakenperminute damagemitigatedperminute wardsplaced wpm wardskilled wcpm controlwardsbought visionscore vspm totalgold earnedgold earned gpm earnedgoldshare goldspent gspd total cs minionkills monsterkills monsterkillsownjungle monsterkillsenemyjungle cspm goldat10 xpat10 csat10 opp_goldat10 opp_xpat10 opp_csat10 golddiffat10 xpdiffat10 csdiffat10 killsat10 assistsat10 deathsat10 opp_killsat10 opp_assistsat10 opp_deathsat10 goldat15 xpat15 csat15 opp_goldat15 opp_xpat15 opp_csat15 golddiffat15 xpdiffat15 csdiffat15 killsat15 assistsat15 deathsat15 opp_killsat15 opp_assistsat15 opp_deathsat15
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 1 Blue top Soboro oe:player:38e0af7278d6769d0c81d7c4b47ac1e Fredit BRION Challengers oe:team:68911b3329146587617ab2973106e23 Renekton Karma Caitlyn Syndra Thresh Lulu 1713 0 2 3 2 9 19 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.3152 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 15768.0 552.2942 0.278784 1072.3993 777.7933 8.0 0.2802 6.0 0.2102 5.0 26.0 0.9107 10934 7164.0 250.9282 0.253859 10275.0 NaN 231.0 220.0 11.0 NaN NaN 8.0911 3228.0 4909.0 89.0 3176.0 4953.0 81.0 52.0 -44.0 8.0 0.0 0.0 0.0 0.0 0.0 0.0 5025.0 7560.0 135.0 4634.0 7215.0 121.0 391.0 345.0 14.0 0.0 1.0 0.0 0.0 1.0 0.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 2 Blue jng Raptor oe:player:637ed20b1e41be1c51bd1a4cb211357 Fredit BRION Challengers oe:team:68911b3329146587617ab2973106e23 Xin Zhao Karma Caitlyn Syndra Thresh Lulu 1713 0 2 5 6 9 19 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.3152 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 11765.0 412.0841 0.208009 944.2732 650.1576 6.0 0.2102 18.0 0.6305 6.0 48.0 1.6813 9138 5368.0 188.0210 0.190220 8750.0 NaN 148.0 33.0 115.0 NaN NaN 5.1839 3429.0 3484.0 58.0 2944.0 3052.0 63.0 485.0 432.0 -5.0 1.0 2.0 0.0 0.0 0.0 1.0 5366.0 5320.0 89.0 4825.0 5595.0 100.0 541.0 -275.0 -11.0 2.0 3.0 2.0 0.0 5.0 1.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 3 Blue mid Feisty oe:player:d1ae0e2f9f3ac1e0e0cdcb86504ca77 Fredit BRION Challengers oe:team:68911b3329146587617ab2973106e23 LeBlanc Karma Caitlyn Syndra Thresh Lulu 1713 0 2 2 3 9 19 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.3152 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 14258.0 499.4046 0.252086 581.6462 227.7758 19.0 0.6655 7.0 0.2452 7.0 29.0 1.0158 9715 5945.0 208.2312 0.210665 8725.0 NaN 193.0 177.0 16.0 NaN NaN 6.7601 3283.0 4556.0 81.0 3121.0 4485.0 81.0 162.0 71.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 5118.0 6942.0 120.0 5593.0 6789.0 119.0 -475.0 153.0 1.0 0.0 3.0 0.0 3.0 3.0 2.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 4 Blue bot Gamin oe:player:998b3e49b01ecc41eacc392477a98cf Fredit BRION Challengers oe:team:68911b3329146587617ab2973106e23 Samira Karma Caitlyn Syndra Thresh Lulu 1713 0 2 4 2 9 19 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.3152 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 11106.0 389.0018 0.196358 463.8529 218.8792 12.0 0.4203 6.0 0.2102 4.0 25.0 0.8757 10605 6835.0 239.4046 0.242201 10425.0 NaN 226.0 208.0 18.0 NaN NaN 7.9159 3600.0 3103.0 78.0 3304.0 2838.0 90.0 296.0 265.0 -12.0 1.0 1.0 0.0 0.0 0.0 0.0 5461.0 4591.0 115.0 6254.0 5934.0 149.0 -793.0 -1343.0 -34.0 2.0 1.0 2.0 3.0 3.0 0.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 5 Blue sup Loopy oe:player:e9741b3a238723ea6380ef2113fae63 Fredit BRION Challengers oe:team:68911b3329146587617ab2973106e23 Leona Karma Caitlyn Syndra Thresh Lulu 1713 0 1 5 6 9 19 0.0 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.3152 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 3663.0 128.3012 0.064763 475.0263 490.1226 29.0 1.0158 14.0 0.4904 11.0 69.0 2.4168 6678 2908.0 101.8564 0.103054 6395.0 NaN 42.0 42.0 0.0 NaN NaN 1.4711 2678.0 2161.0 16.0 2150.0 2748.0 15.0 528.0 -587.0 1.0 1.0 1.0 0.0 0.0 0.0 1.0 3836.0 3588.0 28.0 3393.0 4085.0 21.0 443.0 -497.0 7.0 1.0 2.0 2.0 0.0 6.0 2.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 6 Red top DnDn oe:player:341e10748bb6d388250fd1f013e45a4 Nongshim RedForce Challengers oe:team:d2dc3681437e2beb2bb4742477108ff Gragas Lee Sin Twisted Fate Zoe Nautilus Rell 1713 1 1 1 12 19 9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.6655 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 17455.0 611.3835 0.218428 911.8739 1210.2977 15.0 0.5254 2.0 0.0701 8.0 30.0 1.0508 10001 6231.0 218.2487 0.184530 9750.0 NaN 229.0 221.0 8.0 NaN NaN 8.0210 3176.0 4953.0 81.0 3228.0 4909.0 89.0 -52.0 44.0 -8.0 0.0 0.0 0.0 0.0 0.0 0.0 4634.0 7215.0 121.0 5025.0 7560.0 135.0 -391.0 -345.0 -14.0 0.0 1.0 0.0 0.0 1.0 0.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 7 Red jng Sylvie oe:player:1a75a7cf8c98442be881fed562346f5 Nongshim RedForce Challengers oe:team:d2dc3681437e2beb2bb4742477108ff Viego Lee Sin Twisted Fate Zoe Nautilus Rell 1713 1 4 1 10 19 9 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.6655 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 10564.0 370.0175 0.132195 838.6690 530.4378 8.0 0.2802 17.0 0.5954 19.0 39.0 1.3660 10293 6523.0 228.4764 0.193177 8750.0 NaN 183.0 47.0 136.0 NaN NaN 6.4098 2944.0 3052.0 63.0 3429.0 3484.0 58.0 -485.0 -432.0 5.0 0.0 0.0 1.0 1.0 2.0 0.0 4825.0 5595.0 100.0 5366.0 5320.0 89.0 -541.0 275.0 11.0 0.0 5.0 1.0 2.0 3.0 2.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 8 Red mid FIESTA oe:player:5ee64eb3feb02e60832a2265db54f71 Nongshim RedForce Challengers oe:team:d2dc3681437e2beb2bb4742477108ff Viktor Lee Sin Twisted Fate Zoe Nautilus Rell 1713 1 6 3 12 19 9 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.6655 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 20690.0 724.6935 0.258910 531.6287 426.9352 15.0 0.5254 4.0 0.1401 6.0 29.0 1.0158 11532 7762.0 271.8739 0.229868 8900.0 NaN 216.0 196.0 20.0 NaN NaN 7.5657 3121.0 4485.0 81.0 3283.0 4556.0 81.0 -162.0 -71.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 5593.0 6789.0 119.0 5118.0 6942.0 120.0 475.0 -153.0 -1.0 3.0 3.0 2.0 0.0 3.0 0.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 9 Red bot vital oe:player:252de481e83ab0bc87aada93aeb424c Nongshim RedForce Challengers oe:team:d2dc3681437e2beb2bb4742477108ff Jinx Lee Sin Twisted Fate Zoe Nautilus Rell 1713 1 8 2 10 19 9 3.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.6655 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 26687.0 934.7461 0.333955 385.0088 186.6550 9.0 0.3152 21.0 0.7356 2.0 40.0 1.4011 14018 10248.0 358.9492 0.303486 12800.0 NaN 319.0 299.0 20.0 NaN NaN 11.1734 3304.0 2838.0 90.0 3600.0 3103.0 78.0 -296.0 -265.0 12.0 0.0 0.0 0.0 1.0 1.0 0.0 6254.0 5934.0 149.0 5461.0 4591.0 115.0 793.0 1343.0 34.0 3.0 3.0 0.0 2.0 1.0 2.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 10 Red sup Blessing oe:player:f1347562011016753e18334ffe7a5c9 Nongshim RedForce Challengers oe:team:d2dc3681437e2beb2bb4742477108ff Alistar Lee Sin Twisted Fate Zoe Nautilus Rell 1713 1 0 2 18 19 9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.6655 0.9807 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN 0.0 0.0 4516.0 158.1786 0.056512 342.4869 518.0035 46.0 1.6112 7.0 0.2452 10.0 67.0 2.3468 6773 3003.0 105.1839 0.088939 5650.0 NaN 29.0 29.0 0.0 NaN NaN 1.0158 2150.0 2748.0 15.0 2678.0 2161.0 16.0 -528.0 587.0 -1.0 0.0 0.0 1.0 1.0 1.0 0.0 3393.0 4085.0 21.0 3836.0 3588.0 28.0 -443.0 497.0 -7.0 0.0 6.0 2.0 1.0 2.0 2.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 100 Blue team NaN NaN Fredit BRION Challengers oe:team:68911b3329146587617ab2973106e23 NaN Karma Caitlyn Syndra Thresh Lulu 1713 0 9 19 19 9 19 0.0 0.0 0.0 0.0 1.0 NaN NaN NaN 0.3152 0.9807 0.0 1.0 3.0 1.0 3.0 0.0 0.0 0.0 0.0 0.0 1.0 NaN 0.0 0.0 1.0 2.0 0.0 0.0 0.0 0.0 1.0 3.0 6.0 1.0 1.0 5.0 0.0 0.0 1.0 56560.0 1981.0858 NaN 3537.1979 2364.7285 74.0 2.5919 51.0 1.7863 33.0 197.0 6.9002 47070 28222.0 988.5114 NaN 44570.0 -0.028312 NaN 680.0 160.0 NaN NaN 29.4221 16218.0 18213.0 322.0 14695.0 18076.0 330.0 1523.0 137.0 -8.0 3.0 5.0 0.0 0.0 0.0 3.0 24806.0 28001.0 487.0 24699.0 29618.0 510.0 107.0 -1617.0 -23.0 5.0 10.0 6.0 6.0 18.0 5.0
ESPORTSTMNT01_2690210 complete NaN LCKC 2022 Spring 0 2022-01-10 07:44:08 1 12.01 200 Red team NaN NaN Nongshim RedForce Challengers oe:team:d2dc3681437e2beb2bb4742477108ff NaN Lee Sin Twisted Fate Zoe Nautilus Rell 1713 1 19 9 62 19 9 6.0 0.0 0.0 0.0 0.0 NaN NaN NaN 0.6655 0.9807 1.0 3.0 1.0 3.0 1.0 2.0 1.0 0.0 0.0 0.0 0.0 NaN 0.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0 6.0 3.0 0.0 0.0 0.0 5.0 1.0 0.0 79912.0 2799.0193 NaN 3009.6673 2872.3292 93.0 3.2574 51.0 1.7863 45.0 205.0 7.1804 52617 33769.0 1182.8021 NaN 45850.0 0.028312 NaN 792.0 184.0 NaN NaN 34.1856 14695.0 18076.0 330.0 16218.0 18213.0 322.0 -1523.0 -137.0 8.0 0.0 0.0 3.0 3.0 5.0 0.0 24699.0 29618.0 510.0 24806.0 28001.0 487.0 -107.0 1617.0 23.0 6.0 18.0 5.0 5.0 10.0 6.0

lol_2022 contains 149400 rows that have information about each player during a game and 123 columns that describe different attributes of the game. Let’s look at what the columns of lol_2022 are.

print(lol_2022.columns.tolist())
['gameid', 'datacompleteness', 'url', 'league', 'year', 'split', 'playoffs', 'date', 'game', 'patch', 'participantid', 'side', 'position', 'playername', 'playerid', 'teamname', 'teamid', 'champion', 'ban1', 'ban2', 'ban3', 'ban4', 'ban5', 'gamelength', 'result', 'kills', 'deaths', 'assists', 'teamkills', 'teamdeaths', 'doublekills', 'triplekills', 'quadrakills', 'pentakills', 'firstblood', 'firstbloodkill', 'firstbloodassist', 'firstbloodvictim', 'team kpm', 'ckpm', 'firstdragon', 'dragons', 'opp_dragons', 'elementaldrakes', 'opp_elementaldrakes', 'infernals', 'mountains', 'clouds', 'oceans', 'chemtechs', 'hextechs', 'dragons (type unknown)', 'elders', 'opp_elders', 'firstherald', 'heralds', 'opp_heralds', 'firstbaron', 'barons', 'opp_barons', 'firsttower', 'towers', 'opp_towers', 'firstmidtower', 'firsttothreetowers', 'turretplates', 'opp_turretplates', 'inhibitors', 'opp_inhibitors', 'damagetochampions', 'dpm', 'damageshare', 'damagetakenperminute', 'damagemitigatedperminute', 'wardsplaced', 'wpm', 'wardskilled', 'wcpm', 'controlwardsbought', 'visionscore', 'vspm', 'totalgold', 'earnedgold', 'earned gpm', 'earnedgoldshare', 'goldspent', 'gspd', 'total cs', 'minionkills', 'monsterkills', 'monsterkillsownjungle', 'monsterkillsenemyjungle', 'cspm', 'goldat10', 'xpat10', 'csat10', 'opp_goldat10', 'opp_xpat10', 'opp_csat10', 'golddiffat10', 'xpdiffat10', 'csdiffat10', 'killsat10', 'assistsat10', 'deathsat10', 'opp_killsat10', 'opp_assistsat10', 'opp_deathsat10', 'goldat15', 'xpat15', 'csat15', 'opp_goldat15', 'opp_xpat15', 'opp_csat15', 'golddiffat15', 'xpdiffat15', 'csdiffat15', 'killsat15', 'assistsat15', 'deathsat15', 'opp_killsat15', 'opp_assistsat15', 'opp_deathsat15']

Upon looking at this list, we can see that not every columns will be useful to answering our question. We are interested in are league, gameid, teamname, ban1, ban2, ban3, ban4, ban5, champion, and result.

  • league(str): The league/tournament the game took place
  • gameid(str): The game’s id
  • teamname(str): The name of the team playing during the match
  • ban1(str): The name of the champion that was banned first
  • ban2(str): The name of the champion that was banned second
  • ban3(str): The name of the champion that was banned third
  • ban4(str): The name of the champion that was banned fourth
  • ban5(str): The name of the champion that was banned fifth
  • champion(str): The name of the champion the player is playing
  • result(int): The result of the match (0 = Team lost, 1 = Team won)

We filter our DataFrame to contain only these columns:

league gameid teamname ban1 ban2 ban3 ban4 ban5 champion result
LCKC ESPORTSTMNT01_2690210 Fredit BRION Challengers Karma Caitlyn Syndra Thresh Lulu Renekton 0
LCKC ESPORTSTMNT01_2690210 Fredit BRION Challengers Karma Caitlyn Syndra Thresh Lulu Xin Zhao 0
LCKC ESPORTSTMNT01_2690210 Fredit BRION Challengers Karma Caitlyn Syndra Thresh Lulu LeBlanc 0
LCKC ESPORTSTMNT01_2690210 Fredit BRION Challengers Karma Caitlyn Syndra Thresh Lulu Samira 0
LCKC ESPORTSTMNT01_2690210 Fredit BRION Challengers Karma Caitlyn Syndra Thresh Lulu Leona 0
LCKC ESPORTSTMNT01_2690210 Nongshim RedForce Challengers Lee Sin Twisted Fate Zoe Nautilus Rell Gragas 1
LCKC ESPORTSTMNT01_2690210 Nongshim RedForce Challengers Lee Sin Twisted Fate Zoe Nautilus Rell Viego 1
LCKC ESPORTSTMNT01_2690210 Nongshim RedForce Challengers Lee Sin Twisted Fate Zoe Nautilus Rell Viktor 1
LCKC ESPORTSTMNT01_2690210 Nongshim RedForce Challengers Lee Sin Twisted Fate Zoe Nautilus Rell Jinx 1
LCKC ESPORTSTMNT01_2690210 Nongshim RedForce Challengers Lee Sin Twisted Fate Zoe Nautilus Rell Alistar 1
LCKC ESPORTSTMNT01_2690210 Fredit BRION Challengers Karma Caitlyn Syndra Thresh Lulu NaN 0
LCKC ESPORTSTMNT01_2690210 Nongshim RedForce Challengers Lee Sin Twisted Fate Zoe Nautilus Rell NaN 1

Data Cleaning and Analysis

cute poros :D Before we begin analysis, we must first clean, organize and aggregate our data.

Region Filtration

For this analysis, we are going to be focusing on tier-one leagues, Worlds, and MSI, since these leagues contain the best players and highest quality gameplay. We filter for these leagues in our DataFrame rows

Dropping Summary Rows

If we take a look at our DataFrame, we notice it contains two summary rows for each match. We will drop these rows in order to combine values in champion.

Correcting Result Column

We renamed the result column to win and converted it to type bool, as we thought this would make more sense intuitively.

Grouping and Aggregations

In order to create a DataFrame containing information about champions played and banned per match, we created two DataFrames. For both DataFrames, we grouped by league, gameid, and teamname. In the first DataFrame we created a custom aggregation to combine the champions played for each team into a list. As for the second DataFrame, we aggregate by the first series value to get champions banned, as this value is repeated for each match. We then performed an inner merge between the two DataFrames together by index.

Finding the Most Banned Champions

Using our DataFrame from the previous step, we counted how many times each champion was banned and sorted by count.

These were the top 15 most banned champions and their ban counts:

  1. Zeri: 1608
  2. Gwen: 1097
  3. Kalista: 1074
  4. Ahri: 984
  5. LeBlanc: 906
  6. Lucian: 885
  7. Twisted Fate: 798
  8. Sylas: 790
  9. Caitlyn: 776
  10. Lee Sin: 748
  11. Wukong: 697
  12. Yuumi: 693
  13. Ryze: 650
  14. Poppy: 648
  15. Renata Glasc: 642

We consider a champion to be a “top ban” if it is in the top 15 most banned champions. We chose to set 15 as our cutoff, as the top 15 champions banned make up 40% of the total bans.

Adding a num_top_banned and num_top_drafted column

Using a custom function, we then count how many times a top ban was banned in each match from our merged DataFrame, and add it to a num_top_banned column. Using a similar aggregation function, we count how many times a top ban was drafted, and add it to a num_top_drafted column and reset the index of our DataFrame.

Here are the first 10 rows of our cleaned DataFrame!

league gameid teamname ban1 ban2 ban3 ban4 ban5 win champion num_top_banned num_top_drafted
CBLOL ESPORTSTMNT01_2695708 FURIA Lee Sin Thresh Twisted Fate Kai'Sa Caitlyn False [Akali, Xin Zhao, Orianna, Jhin, Leona] 3 0
CBLOL ESPORTSTMNT01_2695708 LOUD Gwen Diana Jinx Vex Tryndamere True [Renekton, Viego, Corki, Aphelios, Nautilus] 1 0
CBLOL ESPORTSTMNT01_2695774 Flamengo Esports Nidalee Corki Diana Lee Sin Jayce False [Gwen, Xin Zhao, Orianna, Jhin, Maokai] 1 1
CBLOL ESPORTSTMNT01_2695774 Netshoes Miners Jinx Twisted Fate Caitlyn Viktor Syndra True [Tryndamere, Viego, Vex, Kai'Sa, Leona] 2 0
CBLOL ESPORTSTMNT01_2695807 INTZ Corki Jayce Akali Kennen Jax False [Gwen, Xin Zhao, LeBlanc, Sivir, Karma] 0 2
CBLOL ESPORTSTMNT01_2695807 KaBuM! e-Sports Ziggs Renekton Twisted Fate Jhin Ezreal True [Graves, Lee Sin, Viktor, Caitlyn, Nautilus] 1 2
CBLOL ESPORTSTMNT01_2695835 RED Canids Thresh Caitlyn Jinx Braum Karma True [Gwen, Xin Zhao, Akali, Samira, Rell] 1 1
CBLOL ESPORTSTMNT01_2695835 Rensga eSports Lee Sin Leona Twisted Fate Nautilus Rakan False [Gragas, Viego, Corki, Ezreal, Yuumi] 2 1
CBLOL ESPORTSTMNT01_2696159 Liberty Twisted Fate Leona Vex LeBlanc Akali True [Graves, Jarvan IV, Zoe, Caitlyn, Lux] 2 1
CBLOL ESPORTSTMNT01_2696159 Rensga eSports Gwen Corki Thresh Camille Renekton False [Jayce, Viego, Viktor, Jhin, Karma] 1 0

Univariate Analysis

Now that we have our cleaned DataFrame, let’s take a look at generally how many top bans a team bans. We can do so by plotting a histogram.

We can see that most teams ban 1 - 3 top bans during a match. Very rarely do teams use all their bans on top bans.

Bivariate Analysis

Let’s take a look at the average win rate per number of top bans banned. We utilize num_top_banned and win.

It seems like the more a team bans a “top ban” the more likely they are to lose! This is a bit counterintuitive, as one would think that banning more powerful champions would lead to higher win rate. However, we have yet to consider the fact that just because a champion wasn’t banned doesn’t mean that they were played. If no one chose to play that champion, it would be as if they were banned from the game.

Let’s take a look at how a top ban’s presence in a team’s draft impacts win rate. We can find the number of top bans present in champion and find the mean win rate per number of top bans present in a team.

This graph tells a very different story than our previous one. It seems that if a team drafts a “top ban” then their chances of winning increase! This makes sense, as top bans should be strong champions, helping to increace the overall strength of a team.

Interesting Aggregates

In our bivariate analysis, we analyzed the relationship between banning a top ban and win rate, and drafting a top ban and win rate. Let’s explore the relationship between num_top_banned, num_top_drafted, and win rate. The idea behind this is to look at what happens when a team chooses to ban a certain number of champions from top_bans and when they decide to play a certain number of them.

To do so we can utilize a pivot table that shows the mean win rate for each value of num_top_banned conditioned on the values of num_top_drafted. Essentially, our pivot table shows the mean win rate given x number of top bans banned, and y number of top bans drafted.

To ensure proper sample size, we only considered scenarios where there were at least 5 games played.

num_top_drafted 0 1 2 3 4
num_top_banned
0 0.524590 0.552326 0.644444 0.588235 0.444444
1 0.468085 0.509954 0.586558 0.567073 0.473684
2 0.451115 0.485774 0.520958 0.532338 0.612903
3 0.450450 0.456753 0.489855 0.489130 0.722222
4 0.427273 0.453988 0.549451 0.458333 NaN
5 0.368421 0.692308 0.285714 NaN NaN

It appears the fewer top bans a team bans, and the more a team drafts top bans, the greater the team’s win rate. However, it is important to note that this is not always true. For instance, banning 0 top bans and drafting 4 seems to be an exception.

In addition to that, there are times where when a team chooses too much from top_bans, their win rate also goes down. This could imply that there are other factors at play here outside the scope of our analysis that impacts the chances of a team winning. Another reason behind these discrepancies is that there is not as much data on these scenarios, so the win rate varies more.

Assessment of Missingness

caitlyndetective

NMAR Analysis

Before performing hypothesis testing, we need to first deal with missing values. We can begin by generating a dictionary containing the number of missing values per column

{'league': 0,
 'gameid': 0,
 'teamname': 0,
 'ban1': 5,
 'ban2': 4,
 'ban3': 12,
 'ban4': 9,
 'ban5': 20,
 'win': 0,
 'champion': 0,
 'num_top_banned': 0,
 'top_ban_present': 0}

All of our data that is missing is in a ban column. Perhaps this is because players chose to not ban a champion! Let’s investigate further.

Consider the match below:

league gameid teamname ban1 ban2 ban3 ban4 ban5 win champion num_top_banned top_ban_present
LCK ESPORTSTMNT01_2691557 Fredit BRION Yuumi Caitlyn Twisted Fate Viktor Ryze False [Gragas, Xin Zhao, Corki, Varus, Karma] 4 0
LCK ESPORTSTMNT01_2691557 T1 Lee Sin Renekton NaN Camille LeBlanc True [Gwen, Jarvan IV, Vex, Aphelios, Lulu] 2 1

If we take a look at the recording, we can see that T1 did not ban a champion for their third slot! According to the announcers, players will sometimes ban no one because they want to leave a powerful champion available to be picked for their own team.

Additionally, players sometimes forgo a ban because they see it as an opportunity to improve. Forcing oneself to go against some of the most powerful champions in the game can help players to learn how to counter such champions and improve.

Finally, there may be some misreports. Consider the match below:

league gameid teamname ban1 ban2 ban3 ban4 ban5 win champion num_top_banned top_ban_present
LPL 8473-8473_game_1 JD Gaming NaN NaN NaN NaN NaN False [Gragas, Viego, Viktor, Zeri, Leona] 0 1
LPL 8473-8473_game_1 Top Esports NaN NaN NaN NaN NaN True [Gnar, Lee Sin, Vex, Draven, Nautilus] 0 1

At first glance, it may appear no one on either team banned a champion. If we take a look at the recording, we can see that the teams did ban champions. Even though this occurrence would be a case of MCAR, it appears that the majority of the bans were correctly reported. As a result, we can conclude that the missing values in the ban columns are missing by design. When a player chooses not to ban a champion, there is no banned champion to report, so the data is missing.

Missingness Dependency

Although we have concluded that our data is missing by design, running analysis to see if the missigness is dependent on other columns can still prove valuable. Since ban5 contains the most missing values, we will perform our analysis on this column. We will run permutation tests to see ban5 is missing depending on both gameid and ban1.

ban5 and gameid

Null Hypothesis: The distribution of gameid when ban5 is missing is about the same as the distribution of the gameid when ban5 is not missing
Alternative Hypothesis: The distribution of gameid when ban5 is missing is different than the distribution of the gameid when ban5 is not missing
Test statistic: TVD between gameid and ban5, since gameid is categorical

We calculate a p-value of 0.0308. Since this is less than our significance level of .05, we reject the null, and conclude that the missingness of ban5 is dependent on gameid. Essentially, whether or not a team forgoes their last ban is dependent on the game.

Certain teams may be more comfortable forfeiting a ban depending on who they are up against. Forfeiting a ban is generally considered a bad idea. Since it isn’t advisable to not use a ban, it may be the case that teams forfeit bans only in matches where they feel very confident against their opponent. As a result, teams may be more willing to forfeit a ban depending on the match up, making the missing data in ban5 dependent on gameid.

ban5 and ban1

Null Hypothesis: The distribution of ban1 when ban5 is missing is about the same as the distribution of the ban1 when ban5 is not missing
Alternative Hypothesis: The distribution of ban1 when ban5 is missing is different than the distribution of the ban1 when ban5 is not missing
TVD between ban1 and ban5, since ban1 is categorical

We calculate a p-value of 0.0682. Since this is greater than our significance level of .05 we fail to reject the null, and conclude that the missingness of ban5 is not dependent on ban1. Essentially, whether or not a team choses to forfeit their last ban is not dependent on their first ban.

Hypothesis Testing

heimerdinger Now that we’ve cleaned the data, performed an exploratory data analysis, and assessed the missing data in our dataset, we are now ready to answer our question.

We will perform a permutation test with a significance level of 0.05 and with the following null and alternate hypothesis:

Null Hypothesis: If a team doesn’t ban at least 1 of the top banned champions, they have the same win rate as those who did ban at least 1 of the top banned champions.
Alternate Hypothesis: If a team doesn’t ban at least 1 of the top banned champions, they have a lower win rate as those who did ban at least 1 of the top banned champions.\

As for our test statistic, we will use the difference in means since we are interested in a direction and we can calculate the mean win rate depending on if at least one top champion was banned.

We calculate a p-value of 0.0008. Since this is below our significance level of .05, we reject our null. From this we can say that the data suggests that banning at least one top ban leads to a lower win rate in comparison to teams that did not ban a top ban. Since League of Legends is such a complex game, we cannot fully attribute lower win rate to banning more top bans; too many confounding factors exist.