2023-03-27

Dataset Information & Overview

  • For Module 4/5 Project I, let us take a look at the “Ultimate UFC Dataset”
  • Sourced from Kaggle, this set all comes from the official UFC site
  • Overview: This set contains data from every Ultimate Fighting Championship fight that has occurred from November ’93 to June ’19.
  • Specifically, we are provided fighter stats, wins, losses, referees, date, location, weight-class, etc.
  • Link to Kaggle dataset: https://www.kaggle.com/datasets/rajeevw/ufcdata?search=fight

Problem to Address

  • Which of the provided factors/variables are most influential on the probability of winning a UFC fight?
  • Specifically, we will perform data exploration and analysis to determine which of these variables have a large impact on the probability of winning a fight.

Loading our Libraries and Primary Dataset

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.0     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.1     ✔ tibble    3.1.8
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors
library(car)
## Loading required package: carData
## 
## Attaching package: 'car'
## 
## The following object is masked from 'package:dplyr':
## 
##     recode
## 
## The following object is masked from 'package:purrr':
## 
##     some
library(ggplot2)
ufc_data <- read.csv("/Users/scarlettevans/Desktop/ufc_data.csv")

Data Structure & Summary

  • So, we see that there are a total of 1514 observations with 147 total variables
## 'data.frame':    6012 obs. of  144 variables:
##  $ R_fighter                   : chr  "Adrian Yanez" "Trevin Giles" "Tai Tuivasa" "Cheyanne Buys" ...
##  $ B_fighter                   : chr  "Gustavo Lopez" "Roman Dolidze" "Harry Hunsucker" "Montserrat Conejo" ...
##  $ Referee                     : chr  "Chris Tognoni" "Herb Dean" "Herb Dean" "Mark Smith" ...
##  $ date                        : chr  "2021-03-20" "2021-03-20" "2021-03-20" "2021-03-20" ...
##  $ location                    : chr  "Las Vegas, Nevada, USA" "Las Vegas, Nevada, USA" "Las Vegas, Nevada, USA" "Las Vegas, Nevada, USA" ...
##  $ Winner                      : chr  "Red" "Red" "Red" "Blue" ...
##  $ title_bout                  : chr  "False" "False" "False" "False" ...
##  $ weight_class                : chr  "Bantamweight" "Middleweight" "Heavyweight" "WomenStrawweight" ...
##  $ B_avg_KD                    : num  0 0.5 NA NA 0.125 ...
##  $ B_avg_opp_KD                : num  0 0 NA NA 0 0 0.125 0 NA NA ...
##  $ B_avg_SIG_STR_pct           : num  0.42 0.66 NA NA 0.536 ...
##  $ B_avg_opp_SIG_STR_pct       : num  0.495 0.305 NA NA 0.579 ...
##  $ B_avg_TD_pct                : num  0.33 0.3 NA NA 0.185 ...
##  $ B_avg_opp_TD_pct            : num  0.36 0.5 NA NA 0.166 ...
##  $ B_avg_SUB_ATT               : num  0.5 1.5 NA NA 0.125 ...
##  $ B_avg_opp_SUB_ATT           : num  1 0 NA NA 0.188 ...
##  $ B_avg_REV                   : num  0 0 NA NA 0.25 ...
##  $ B_avg_opp_REV               : num  0 0 NA NA 0 ...
##  $ B_avg_SIG_STR_att           : num  50 65.5 NA NA 109.2 ...
##  $ B_avg_SIG_STR_landed        : num  20 35 NA NA 57.9 ...
##  $ B_avg_opp_SIG_STR_att       : num  84 50 NA NA 50.6 ...
##  $ B_avg_opp_SIG_STR_landed    : num  45 16.5 NA NA 28.4 ...
##  $ B_avg_TOTAL_STR_att         : num  76.5 113.5 NA NA 170.4 ...
##  $ B_avg_TOTAL_STR_landed      : num  41 68.5 NA NA 105.6 ...
##  $ B_avg_opp_TOTAL_STR_att     : num  114 68.5 NA NA 74.4 ...
##  $ B_avg_opp_TOTAL_STR_landed  : num  64 29 NA NA 44.2 ...
##  $ B_avg_TD_att                : num  1.5 2.5 NA NA 5.38 ...
##  $ B_avg_TD_landed             : num  1 1.5 NA NA 1.5 ...
##  $ B_avg_opp_TD_att            : num  9 0.5 NA NA 2 ...
##  $ B_avg_opp_TD_landed         : num  6.5 0.5 NA NA 0.625 ...
##  $ B_avg_HEAD_att              : num  39.5 46 NA NA 77.4 ...
##  $ B_avg_HEAD_landed           : num  11 20 NA NA 31.4 ...
##  $ B_avg_opp_HEAD_att          : num  63 36 NA NA 41.6 ...
##  $ B_avg_opp_HEAD_landed       : num  27.5 7.5 NA NA 22.6 ...
##  $ B_avg_BODY_att              : num  7.5 12 NA NA 31.2 ...
##  $ B_avg_BODY_landed           : num  7 8 NA NA 26.2 ...
##  $ B_avg_opp_BODY_att          : num  12 8 NA NA 7.69 ...
##  $ B_avg_opp_BODY_landed       : num  9 3 NA NA 4.94 ...
##  $ B_avg_LEG_att               : num  3 7.5 NA NA 0.625 ...
##  $ B_avg_LEG_landed            : num  2 7 NA NA 0.375 ...
##  $ B_avg_opp_LEG_att           : num  9 6 NA NA 1.38 ...
##  $ B_avg_opp_LEG_landed        : num  8.5 6 NA NA 0.875 ...
##  $ B_avg_DISTANCE_att          : num  35 58 NA NA 33.6 ...
##  $ B_avg_DISTANCE_landed       : num  12.5 30 NA NA 11 ...
##  $ B_avg_opp_DISTANCE_att      : num  43.5 48 NA NA 32.1 ...
##  $ B_avg_opp_DISTANCE_landed   : num  17.5 15.5 NA NA 13.9 ...
##  $ B_avg_CLINCH_att            : num  10.5 0.5 NA NA 39.1 ...
##  $ B_avg_CLINCH_landed         : num  4.5 0.5 NA NA 28.8 ...
##  $ B_avg_opp_CLINCH_att        : num  4 0.5 NA NA 13.3 ...
##  $ B_avg_opp_CLINCH_landed     : num  3 0.5 NA NA 10.8 ...
##  $ B_avg_GROUND_att            : num  4.5 7 NA NA 36.6 ...
##  $ B_avg_GROUND_landed         : num  3 4.5 NA NA 18.1 ...
##  $ B_avg_opp_GROUND_att        : num  36.5 1.5 NA NA 5.25 ...
##  $ B_avg_opp_GROUND_landed     : num  24.5 0.5 NA NA 3.75 ...
##  $ B_avg_CTRL_time.seconds.    : num  34 220 NA NA 390 ...
##  $ B_avg_opp_CTRL_time.seconds.: num  277.5 24.5 NA NA 156.3 ...
##  $ B_total_time_fought.seconds.: num  532 578 NA NA 764 ...
##  $ B_total_rounds_fought       : int  4 4 0 0 11 10 28 23 0 0 ...
##  $ B_total_title_bouts         : int  0 0 0 0 1 0 0 0 0 0 ...
##  $ B_current_win_streak        : int  0 2 0 0 3 4 0 0 0 0 ...
##  $ B_current_lose_streak       : int  1 0 0 0 0 0 1 1 0 0 ...
##  $ B_longest_win_streak        : int  1 2 0 0 3 4 1 5 0 0 ...
##  $ B_wins                      : int  1 2 0 0 4 4 4 8 0 0 ...
##  $ B_losses                    : int  1 0 0 0 1 0 6 2 0 0 ...
##  $ B_draw                      : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ B_win_by_Decision_Majority  : int  0 0 0 0 0 0 1 0 0 0 ...
##  $ B_win_by_Decision_Split     : int  0 1 0 0 0 0 0 2 0 0 ...
##  $ B_win_by_Decision_Unanimous : int  0 0 0 0 1 2 1 1 0 0 ...
##  $ B_win_by_KO.TKO             : int  0 1 0 0 2 0 2 3 0 0 ...
##  $ B_win_by_Submission         : int  1 0 0 0 1 2 0 2 0 0 ...
##  $ B_win_by_TKO_Doctor_Stoppage: int  0 0 0 0 0 0 0 0 0 0 ...
##  $ B_Stance                    : chr  "Orthodox" "Orthodox" "Orthodox" "Southpaw" ...
##  $ B_Height_cms                : num  165 188 188 152 180 ...
##  $ B_Reach_cms                 : num  170 193 190 155 183 ...
##  $ B_Weight_lbs                : num  135 205 241 115 135 145 170 185 135 125 ...
##  $ R_avg_KD                    : num  1 1.031 0.547 NA 0 ...
##  $ R_avg_opp_KD                : num  0 0.0625 0.1875 NA 0.000977 ...
##  $ R_avg_SIG_STR_pct           : num  0.5 0.577 0.539 NA 0.403 ...
##  $ R_avg_opp_SIG_STR_pct       : num  0.46 0.381 0.599 NA 0.555 ...
##  $ R_avg_TD_pct                : num  0 0.406 0 NA 0.512 ...
##  $ R_avg_opp_TD_pct            : num  0 0.116 0.312 NA 0.629 ...
##  $ R_avg_SUB_ATT               : num  0 0.25 0 NA 0.231 ...
##  $ R_avg_opp_SUB_ATT           : num  0 1.1875 0.25 NA 0.0312 ...
##  $ R_avg_REV                   : num  0 0.375 0 NA 0.0312 ...
##  $ R_avg_opp_REV               : num  0 0.25 0 NA 0.5 0.5 0.25 0 0 0.5 ...
##  $ R_avg_SIG_STR_att           : num  34 77.6 59.2 NA 109.3 ...
##  $ R_avg_SIG_STR_landed        : num  17 43.2 30.4 NA 44.4 ...
##  $ R_avg_opp_SIG_STR_att       : num  13 69.2 43.8 NA 148.8 ...
##  $ R_avg_opp_SIG_STR_landed    : num  6 27.6 24.8 NA 84.6 ...
##  $ R_avg_TOTAL_STR_att         : num  35 93.1 70.5 NA 137.2 ...
##  $ R_avg_TOTAL_STR_landed      : num  18 57.2 41.4 NA 70.2 ...
##  $ R_avg_opp_TOTAL_STR_att     : num  16 98.3 50.2 NA 172.5 ...
##  $ R_avg_opp_TOTAL_STR_landed  : num  9 52.5 30.9 NA 106.7 ...
##  $ R_avg_TD_att                : num  0 1.2812 0.0312 NA 2.2617 ...
##  $ R_avg_TD_landed             : num  0 0.781 0 NA 1.262 ...
##  $ R_avg_opp_TD_att            : num  3 4.69 2.84 NA 3.14 ...
##  $ R_avg_opp_TD_landed         : num  0 0.438 1.75 NA 1.771 ...
##  $ R_avg_HEAD_att              : num  32 71.1 42.5 NA 86.4 ...
##  $ R_avg_HEAD_landed           : num  15 38.1 16.8 NA 26 ...
##   [list output truncated]
##   R_fighter          B_fighter           Referee              date          
##  Length:6012        Length:6012        Length:6012        Length:6012       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##    location            Winner           title_bout        weight_class      
##  Length:6012        Length:6012        Length:6012        Length:6012       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##     B_avg_KD       B_avg_opp_KD    B_avg_SIG_STR_pct B_avg_opp_SIG_STR_pct
##  Min.   :0.0000   Min.   :0.0000   Min.   :0.0000    Min.   :0.0000       
##  1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.:0.3765    1st Qu.:0.3510       
##  Median :0.0156   Median :0.0000   Median :0.4500    Median :0.4275       
##  Mean   :0.2475   Mean   :0.1768   Mean   :0.4533    Mean   :0.4343       
##  3rd Qu.:0.5000   3rd Qu.:0.2500   3rd Qu.:0.5275    3rd Qu.:0.5100       
##  Max.   :5.0000   Max.   :3.0000   Max.   :1.0000    Max.   :1.0000       
##  NA's   :1427     NA's   :1427     NA's   :1427      NA's   :1427         
##   B_avg_TD_pct    B_avg_opp_TD_pct B_avg_SUB_ATT    B_avg_opp_SUB_ATT
##  Min.   :0.0000   Min.   :0.0000   Min.   :0.0000   Min.   :0.0000   
##  1st Qu.:0.0312   1st Qu.:0.0332   1st Qu.:0.0000   1st Qu.:0.0000   
##  Median :0.2500   Median :0.2000   Median :0.1485   Median :0.0984   
##  Mean   :0.2926   Mean   :0.2687   Mean   :0.4789   Mean   :0.4093   
##  3rd Qu.:0.5000   3rd Qu.:0.4228   3rd Qu.:0.7500   3rd Qu.:0.5312   
##  Max.   :1.0000   Max.   :1.0000   Max.   :8.0000   Max.   :7.0000   
##  NA's   :1427     NA's   :1427     NA's   :1427     NA's   :1427     
##    B_avg_REV      B_avg_opp_REV    B_avg_SIG_STR_att B_avg_SIG_STR_landed
##  Min.   :0.0000   Min.   :0.0000   Min.   :  0.00    Min.   :  0.00      
##  1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.: 38.26    1st Qu.: 17.00      
##  Median :0.0000   Median :0.0000   Median : 66.50    Median : 29.69      
##  Mean   :0.1567   Mean   :0.1413   Mean   : 76.29    Mean   : 33.34      
##  3rd Qu.:0.1250   3rd Qu.:0.1250   3rd Qu.:104.75    3rd Qu.: 45.50      
##  Max.   :4.0000   Max.   :3.0000   Max.   :456.00    Max.   :186.00      
##  NA's   :1427     NA's   :1427     NA's   :1427      NA's   :1427        
##  B_avg_opp_SIG_STR_att B_avg_opp_SIG_STR_landed B_avg_TOTAL_STR_att
##  Min.   :  0.00        Min.   :  0.00           Min.   :  0.00     
##  1st Qu.: 36.41        1st Qu.: 15.56           1st Qu.: 55.48     
##  Median : 64.31        Median : 27.34           Median : 89.75     
##  Mean   : 73.09        Mean   : 31.05           Mean   : 97.64     
##  3rd Qu.: 99.88        3rd Qu.: 42.00           3rd Qu.:132.47     
##  Max.   :403.00        Max.   :202.00           Max.   :524.00     
##  NA's   :1427          NA's   :1427             NA's   :1427       
##  B_avg_TOTAL_STR_landed B_avg_opp_TOTAL_STR_att B_avg_opp_TOTAL_STR_landed
##  Min.   :  0.00         Min.   :  0.00          Min.   :  0.00            
##  1st Qu.: 28.94         1st Qu.: 52.99          1st Qu.: 26.88            
##  Median : 48.00         Median : 85.53          Median : 44.41            
##  Mean   : 52.28         Mean   : 92.72          Mean   : 48.50            
##  3rd Qu.: 70.00         3rd Qu.:125.73          3rd Qu.: 65.19            
##  Max.   :242.00         Max.   :433.00          Max.   :232.00            
##  NA's   :1427           NA's   :1427            NA's   :1427              
##   B_avg_TD_att    B_avg_TD_landed   B_avg_opp_TD_att B_avg_opp_TD_landed
##  Min.   : 0.000   Min.   : 0.0000   Min.   : 0.000   Min.   : 0.000     
##  1st Qu.: 0.625   1st Qu.: 0.0625   1st Qu.: 1.000   1st Qu.: 0.125     
##  Median : 2.000   Median : 0.7500   Median : 2.055   Median : 0.750     
##  Mean   : 2.727   Mean   : 1.1091   Mean   : 2.861   Mean   : 1.073     
##  3rd Qu.: 4.000   3rd Qu.: 1.5625   3rd Qu.: 4.000   3rd Qu.: 1.500     
##  Max.   :19.000   Max.   :10.9688   Max.   :20.000   Max.   :11.500     
##  NA's   :1427     NA's   :1427      NA's   :1427     NA's   :1427       
##  B_avg_HEAD_att   B_avg_HEAD_landed B_avg_opp_HEAD_att B_avg_opp_HEAD_landed
##  Min.   :  0.00   Min.   :  0.00    Min.   :  0.00     Min.   :  0.00       
##  1st Qu.: 29.30   1st Qu.: 10.50    1st Qu.: 27.88     1st Qu.:  9.00       
##  Median : 51.19   Median : 18.34    Median : 49.61     Median : 16.28       
##  Mean   : 59.98   Mean   : 21.39    Mean   : 57.06     Mean   : 19.40       
##  3rd Qu.: 81.50   3rd Qu.: 28.82    3rd Qu.: 77.33     3rd Qu.: 26.50       
##  Max.   :397.00   Max.   :138.00    Max.   :373.00     Max.   :126.00       
##  NA's   :1427     NA's   :1427      NA's   :1427       NA's   :1427         
##  B_avg_BODY_att   B_avg_BODY_landed B_avg_opp_BODY_att B_avg_opp_BODY_landed
##  Min.   : 0.000   Min.   : 0.000    Min.   : 0.00      Min.   : 0.000       
##  1st Qu.: 3.586   1st Qu.: 2.375    1st Qu.: 3.50      1st Qu.: 2.250       
##  Median : 7.500   Median : 5.077    Median : 7.50      Median : 5.000       
##  Mean   : 9.684   Mean   : 6.682    Mean   : 9.37      Mean   : 6.352       
##  3rd Qu.:13.500   3rd Qu.: 9.297    3rd Qu.:13.00      3rd Qu.: 8.781       
##  Max.   :71.000   Max.   :64.000    Max.   :71.00      Max.   :64.000       
##  NA's   :1427     NA's   :1427      NA's   :1427       NA's   :1427         
##  B_avg_LEG_att    B_avg_LEG_landed B_avg_opp_LEG_att B_avg_opp_LEG_landed
##  Min.   : 0.000   Min.   : 0.000   Min.   : 0.000    Min.   : 0.000      
##  1st Qu.: 1.876   1st Qu.: 1.438   1st Qu.: 2.000    1st Qu.: 1.625      
##  Median : 4.500   Median : 3.625   Median : 4.984    Median : 3.938      
##  Mean   : 6.620   Mean   : 5.268   Mean   : 6.667    Mean   : 5.298      
##  3rd Qu.: 9.250   3rd Qu.: 7.282   3rd Qu.: 9.125    3rd Qu.: 7.356      
##  Max.   :62.830   Max.   :51.636   Max.   :69.000    Max.   :58.000      
##  NA's   :1427     NA's   :1427     NA's   :1427      NA's   :1427        
##  B_avg_DISTANCE_att B_avg_DISTANCE_landed B_avg_opp_DISTANCE_att
##  Min.   :  0.00     Min.   :  0.00        Min.   :  0.00        
##  1st Qu.: 23.00     1st Qu.:  8.00        1st Qu.: 22.50        
##  Median : 48.69     Median : 17.00        Median : 47.12        
##  Mean   : 60.06     Mean   : 22.31        Mean   : 58.57        
##  3rd Qu.: 84.72     3rd Qu.: 31.57        3rd Qu.: 83.00        
##  Max.   :422.00     Max.   :161.00        Max.   :391.00        
##  NA's   :1427       NA's   :1427          NA's   :1427          
##  B_avg_opp_DISTANCE_landed B_avg_CLINCH_att B_avg_CLINCH_landed
##  Min.   :  0.00            Min.   : 0.00    Min.   : 0.000     
##  1st Qu.:  7.75            1st Qu.: 2.50    1st Qu.: 1.516     
##  Median : 16.50            Median : 5.75    Median : 3.750     
##  Mean   : 21.29            Mean   : 8.07    Mean   : 5.514     
##  3rd Qu.: 29.75            3rd Qu.:11.08    3rd Qu.: 7.625     
##  Max.   :159.00            Max.   :87.00    Max.   :68.000     
##  NA's   :1427              NA's   :1427     NA's   :1427       
##  B_avg_opp_CLINCH_att B_avg_opp_CLINCH_landed B_avg_GROUND_att
##  Min.   :  0.000      Min.   : 0.000          Min.   : 0.000  
##  1st Qu.:  2.456      1st Qu.: 1.445          1st Qu.: 1.960  
##  Median :  5.312      Median : 3.438          Median : 5.062  
##  Mean   :  7.477      Mean   : 5.046          Mean   : 8.159  
##  3rd Qu.: 10.250      3rd Qu.: 7.000          3rd Qu.:11.004  
##  Max.   :105.000      Max.   :84.000          Max.   :88.000  
##  NA's   :1427         NA's   :1427            NA's   :1427    
##  B_avg_GROUND_landed B_avg_opp_GROUND_att B_avg_opp_GROUND_landed
##  Min.   : 0.000      Min.   :  0.000      Min.   : 0.0000        
##  1st Qu.: 1.141      1st Qu.:  1.094      1st Qu.: 0.7539        
##  Median : 3.500      Median :  3.875      Median : 2.5000        
##  Mean   : 5.510      Mean   :  7.042      Mean   : 4.7195        
##  3rd Qu.: 7.625      3rd Qu.:  9.000      3rd Qu.: 6.0000        
##  Max.   :48.000      Max.   :141.000      Max.   :84.0000        
##  NA's   :1427        NA's   :1427         NA's   :1427           
##  B_avg_CTRL_time.seconds. B_avg_opp_CTRL_time.seconds.
##  Min.   :   0.00          Min.   :  0.00              
##  1st Qu.:  36.00          1st Qu.: 35.09              
##  Median :  99.21          Median : 94.12              
##  Mean   : 137.28          Mean   :132.59              
##  3rd Qu.: 200.19          3rd Qu.:192.38              
##  Max.   :1020.20          Max.   :835.00              
##  NA's   :1427             NA's   :1427                
##  B_total_time_fought.seconds. B_total_rounds_fought B_total_title_bouts
##  Min.   :   7.0               Min.   : 0.000        Min.   : 0.0000    
##  1st Qu.: 419.0               1st Qu.: 1.000        1st Qu.: 0.0000    
##  Median : 638.5               Median : 5.000        Median : 0.0000    
##  Mean   : 611.4               Mean   : 9.442        Mean   : 0.2773    
##  3rd Qu.: 846.4               3rd Qu.:13.000        3rd Qu.: 0.0000    
##  Max.   :1500.0               Max.   :94.000        Max.   :16.0000    
##  NA's   :1427                                                          
##  B_current_win_streak B_current_lose_streak B_longest_win_streak
##  Min.   : 0.0000      Min.   :0.0000        Min.   : 0.000      
##  1st Qu.: 0.0000      1st Qu.:0.0000        1st Qu.: 0.000      
##  Median : 0.0000      Median :0.0000        Median : 1.000      
##  Mean   : 0.9473      Mean   :0.3972        Mean   : 1.631      
##  3rd Qu.: 1.0000      3rd Qu.:1.0000        3rd Qu.: 3.000      
##  Max.   :16.0000      Max.   :5.0000        Max.   :16.000      
##                                                                 
##      B_wins          B_losses         B_draw  B_win_by_Decision_Majority
##  Min.   : 0.000   Min.   : 0.00   Min.   :0   Min.   :0.00000           
##  1st Qu.: 0.000   1st Qu.: 0.00   1st Qu.:0   1st Qu.:0.00000           
##  Median : 1.000   Median : 1.00   Median :0   Median :0.00000           
##  Mean   : 2.585   Mean   : 1.54   Mean   :0   Mean   :0.01613           
##  3rd Qu.: 4.000   3rd Qu.: 2.00   3rd Qu.:0   3rd Qu.:0.00000           
##  Max.   :23.000   Max.   :16.00   Max.   :0   Max.   :2.00000           
##                                                                         
##  B_win_by_Decision_Split B_win_by_Decision_Unanimous B_win_by_KO.TKO  
##  Min.   :0.0000          Min.   : 0.0000             Min.   : 0.0000  
##  1st Qu.:0.0000          1st Qu.: 0.0000             1st Qu.: 0.0000  
##  Median :0.0000          Median : 0.0000             Median : 0.0000  
##  Mean   :0.2184          Mean   : 0.8382             Mean   : 0.8957  
##  3rd Qu.:0.0000          3rd Qu.: 1.0000             3rd Qu.: 1.0000  
##  Max.   :5.0000          Max.   :10.0000             Max.   :11.0000  
##                                                                       
##  B_win_by_Submission B_win_by_TKO_Doctor_Stoppage   B_Stance        
##  Min.   : 0.0000     Min.   :0.00000              Length:6012       
##  1st Qu.: 0.0000     1st Qu.:0.00000              Class :character  
##  Median : 0.0000     Median :0.00000              Mode  :character  
##  Mean   : 0.5695     Mean   :0.04208                                
##  3rd Qu.: 1.0000     3rd Qu.:0.00000                                
##  Max.   :14.0000     Max.   :2.00000                                
##                                                                     
##   B_Height_cms    B_Reach_cms     B_Weight_lbs      R_avg_KD     
##  Min.   :152.4   Min.   :147.3   Min.   :115.0   Min.   :0.0000  
##  1st Qu.:172.7   1st Qu.:177.8   1st Qu.:145.0   1st Qu.:0.0000  
##  Median :180.3   Median :182.9   Median :170.0   Median :0.0472  
##  Mean   :179.0   Mean   :183.2   Mean   :170.6   Mean   :0.2435  
##  3rd Qu.:185.4   3rd Qu.:190.5   3rd Qu.:185.0   3rd Qu.:0.4375  
##  Max.   :210.8   Max.   :213.4   Max.   :770.0   Max.   :4.0000  
##  NA's   :10      NA's   :891     NA's   :8       NA's   :712     
##   R_avg_opp_KD    R_avg_SIG_STR_pct R_avg_opp_SIG_STR_pct  R_avg_TD_pct   
##  Min.   :0.0000   Min.   :0.0000    Min.   :0.0000        Min.   :0.0000  
##  1st Qu.:0.0000   1st Qu.:0.3762    1st Qu.:0.3472        1st Qu.:0.0666  
##  Median :0.0000   Median :0.4500    Median :0.4218        Median :0.2500  
##  Mean   :0.1880   Mean   :0.4572    Mean   :0.4253        Mean   :0.3009  
##  3rd Qu.:0.2525   3rd Qu.:0.5300    3rd Qu.:0.5000        3rd Qu.:0.5000  
##  Max.   :3.0000   Max.   :1.0000    Max.   :1.0000        Max.   :1.0000  
##  NA's   :712      NA's   :712       NA's   :712           NA's   :712     
##  R_avg_opp_TD_pct R_avg_SUB_ATT    R_avg_opp_SUB_ATT   R_avg_REV     
##  Min.   :0.0000   Min.   :0.0000   Min.   :0.0000    Min.   :0.0000  
##  1st Qu.:0.0371   1st Qu.:0.0000   1st Qu.:0.0000    1st Qu.:0.0000  
##  Median :0.1917   Median :0.1875   Median :0.1250    Median :0.0000  
##  Mean   :0.2544   Mean   :0.4635   Mean   :0.3939    Mean   :0.1414  
##  3rd Qu.:0.4026   3rd Qu.:0.7267   3rd Qu.:0.5156    3rd Qu.:0.1250  
##  Max.   :1.0000   Max.   :9.0000   Max.   :8.0000    Max.   :3.0000  
##  NA's   :712      NA's   :712      NA's   :712       NA's   :712     
##  R_avg_opp_REV    R_avg_SIG_STR_att R_avg_SIG_STR_landed R_avg_opp_SIG_STR_att
##  Min.   :0.0000   Min.   :  0.00    Min.   :  0.00       Min.   :  0.00       
##  1st Qu.:0.0000   1st Qu.: 41.88    1st Qu.: 18.93       1st Qu.: 38.66       
##  Median :0.0000   Median : 69.50    Median : 30.50       Median : 66.98       
##  Mean   :0.1432   Mean   : 79.35    Mean   : 34.81       Mean   : 76.07       
##  3rd Qu.:0.1250   3rd Qu.:106.00    3rd Qu.: 46.00       3rd Qu.:103.50       
##  Max.   :4.0000   Max.   :419.32    Max.   :212.14       Max.   :454.00       
##  NA's   :712      NA's   :712       NA's   :712          NA's   :712          
##  R_avg_opp_SIG_STR_landed R_avg_TOTAL_STR_att R_avg_TOTAL_STR_landed
##  Min.   :  0.00           Min.   :  0.00      Min.   :  0.00        
##  1st Qu.: 16.03           1st Qu.: 58.27      1st Qu.: 30.94        
##  Median : 27.85           Median : 94.00      Median : 48.54        
##  Mean   : 31.89           Mean   :100.59      Mean   : 53.69        
##  3rd Qu.: 43.00           3rd Qu.:133.74      3rd Qu.: 70.00        
##  Max.   :175.00           Max.   :440.34      Max.   :248.12        
##  NA's   :712              NA's   :712         NA's   :712           
##  R_avg_opp_TOTAL_STR_att R_avg_opp_TOTAL_STR_landed  R_avg_TD_att   
##  Min.   :  0.00          Min.   :  0.00             Min.   : 0.000  
##  1st Qu.: 54.25          1st Qu.: 27.50             1st Qu.: 0.750  
##  Median : 88.50          Median : 44.75             Median : 2.000  
##  Mean   : 95.55          Mean   : 49.26             Mean   : 2.944  
##  3rd Qu.:128.48          3rd Qu.: 65.50             3rd Qu.: 4.271  
##  Max.   :461.00          Max.   :202.86             Max.   :30.000  
##  NA's   :712             NA's   :712                NA's   :712     
##  R_avg_TD_landed   R_avg_opp_TD_att R_avg_opp_TD_landed R_avg_HEAD_att  
##  Min.   : 0.0000   Min.   : 0.000   Min.   : 0.0000     Min.   :  0.00  
##  1st Qu.: 0.1875   1st Qu.: 1.000   1st Qu.: 0.1328     1st Qu.: 32.08  
##  Median : 0.8125   Median : 2.016   Median : 0.6641     Median : 54.00  
##  Mean   : 1.1841   Mean   : 2.823   Mean   : 1.0187     Mean   : 62.28  
##  3rd Qu.: 1.7344   3rd Qu.: 4.000   3rd Qu.: 1.5000     3rd Qu.: 83.00  
##  Max.   :11.0000   Max.   :22.000   Max.   :13.0000     Max.   :368.18  
##  NA's   :712       NA's   :712      NA's   :712         NA's   :712     
##  R_avg_HEAD_landed R_avg_opp_HEAD_att R_avg_opp_HEAD_landed R_avg_BODY_att  
##  Min.   :  0.00    Min.   :  0.00     Min.   :  0.00        Min.   : 0.000  
##  1st Qu.: 11.61    1st Qu.: 29.11     1st Qu.:  9.50        1st Qu.: 4.000  
##  Median : 19.02    Median : 51.48     Median : 16.94        Median : 7.918  
##  Mean   : 22.34    Mean   : 59.78     Mean   : 20.16        Mean   :10.019  
##  3rd Qu.: 29.38    3rd Qu.: 81.73     3rd Qu.: 27.15        3rd Qu.:13.750  
##  Max.   :173.16    Max.   :400.00     Max.   :139.00        Max.   :71.000  
##  NA's   :712       NA's   :712        NA's   :712           NA's   :712     
##  R_avg_BODY_landed R_avg_opp_BODY_att R_avg_opp_BODY_landed R_avg_LEG_att   
##  Min.   : 0.000    Min.   : 0.000     Min.   : 0.000        Min.   : 0.000  
##  1st Qu.: 2.717    1st Qu.: 3.750     1st Qu.: 2.500        1st Qu.: 2.000  
##  Median : 5.431    Median : 7.750     Median : 5.062        Median : 4.781  
##  Mean   : 6.871    Mean   : 9.552     Mean   : 6.442        Mean   : 7.046  
##  3rd Qu.: 9.377    3rd Qu.:13.500     3rd Qu.: 8.982        3rd Qu.: 9.997  
##  Max.   :54.000    Max.   :75.000     Max.   :43.350        Max.   :71.570  
##  NA's   :712       NA's   :712        NA's   :712           NA's   :712     
##  R_avg_LEG_landed R_avg_opp_LEG_att R_avg_opp_LEG_landed R_avg_DISTANCE_att
##  Min.   : 0.000   Min.   : 0.000    Min.   : 0.000       Min.   :  0.00    
##  1st Qu.: 1.500   1st Qu.: 2.147    1st Qu.: 1.688       1st Qu.: 25.69    
##  Median : 3.937   Median : 4.899    Median : 3.844       Median : 51.03    
##  Mean   : 5.593   Mean   : 6.737    Mean   : 5.291       Mean   : 62.68    
##  3rd Qu.: 7.948   3rd Qu.: 9.161    3rd Qu.: 7.333       3rd Qu.: 87.81    
##  Max.   :62.352   Max.   :77.387    Max.   :55.427       Max.   :396.11    
##  NA's   :712      NA's   :712       NA's   :712          NA's   :712       
##  R_avg_DISTANCE_landed R_avg_opp_DISTANCE_att R_avg_opp_DISTANCE_landed
##  Min.   :  0.00        Min.   :  0.00         Min.   :  0.00           
##  1st Qu.:  9.00        1st Qu.: 24.97         1st Qu.:  8.00           
##  Median : 18.40        Median : 50.52         Median : 17.50           
##  Mean   : 23.46        Mean   : 61.61         Mean   : 22.19           
##  3rd Qu.: 32.75        3rd Qu.: 86.50         3rd Qu.: 31.50           
##  Max.   :192.65        Max.   :440.00         Max.   :169.00           
##  NA's   :712           NA's   :712            NA's   :712              
##  R_avg_CLINCH_att R_avg_CLINCH_landed R_avg_opp_CLINCH_att
##  Min.   : 0.000   Min.   : 0.000      Min.   : 0.000      
##  1st Qu.: 2.688   1st Qu.: 1.692      1st Qu.: 2.620      
##  Median : 5.750   Median : 3.750      Median : 5.500      
##  Mean   : 7.923   Mean   : 5.409      Mean   : 7.545      
##  3rd Qu.:10.750   3rd Qu.: 7.048      3rd Qu.:10.034      
##  Max.   :82.000   Max.   :61.000      Max.   :82.000      
##  NA's   :712      NA's   :712         NA's   :712         
##  R_avg_opp_CLINCH_landed R_avg_GROUND_att  R_avg_GROUND_landed
##  Min.   : 0.000          Min.   :  0.000   Min.   : 0.000     
##  1st Qu.: 1.562          1st Qu.:  2.000   1st Qu.: 1.404     
##  Median : 3.500          Median :  5.375   Median : 3.688     
##  Mean   : 5.061          Mean   :  8.746   Mean   : 5.942     
##  3rd Qu.: 6.675          3rd Qu.: 11.594   3rd Qu.: 8.000     
##  Max.   :51.000          Max.   :141.000   Max.   :68.000     
##  NA's   :712             NA's   :712       NA's   :712        
##  R_avg_opp_GROUND_att R_avg_opp_GROUND_landed R_avg_CTRL_time.seconds.
##  Min.   :  0.000      Min.   : 0.000          Min.   :  0.00          
##  1st Qu.:  1.156      1st Qu.: 0.750          1st Qu.: 38.28          
##  Median :  4.000      Median : 2.656          Median :104.87          
##  Mean   :  6.912      Mean   : 4.640          Mean   :144.22          
##  3rd Qu.:  9.250      3rd Qu.: 6.225          3rd Qu.:211.14          
##  Max.   :104.000      Max.   :68.000          Max.   :996.75          
##  NA's   :712          NA's   :712             NA's   :712             
##  R_avg_opp_CTRL_time.seconds. R_total_time_fought.seconds.
##  Min.   :  0.0                Min.   :   7.0              
##  1st Qu.: 34.0                1st Qu.: 438.5              
##  Median : 89.5                Median : 655.8              
##  Mean   :125.1                Mean   : 633.3              
##  3rd Qu.:176.5                3rd Qu.: 851.1              
##  Max.   :812.0                Max.   :1500.0              
##  NA's   :712                  NA's   :712                 
##  R_total_rounds_fought R_total_title_bouts R_current_win_streak
##  Min.   : 0.00         Min.   : 0.0000     Min.   : 0.000      
##  1st Qu.: 3.00         1st Qu.: 0.0000     1st Qu.: 0.000      
##  Median : 9.00         Median : 0.0000     Median : 1.000      
##  Mean   :13.67         Mean   : 0.5822     Mean   : 1.315      
##  3rd Qu.:20.00         3rd Qu.: 1.0000     3rd Qu.: 2.000      
##  Max.   :88.00         Max.   :16.0000     Max.   :16.000      
##                                                                
##  R_current_lose_streak R_longest_win_streak     R_wins          R_losses     
##  Min.   :0.0000        Min.   : 0.000       Min.   : 0.000   Min.   : 0.000  
##  1st Qu.:0.0000        1st Qu.: 1.000       1st Qu.: 1.000   1st Qu.: 0.000  
##  Median :0.0000        Median : 2.000       Median : 3.000   Median : 1.000  
##  Mean   :0.3891        Mean   : 2.313       Mean   : 3.757   Mean   : 2.071  
##  3rd Qu.:1.0000        3rd Qu.: 3.000       3rd Qu.: 6.000   3rd Qu.: 3.000  
##  Max.   :4.0000        Max.   :16.000       Max.   :23.000   Max.   :17.000  
##                                                                              
##      R_draw  R_win_by_Decision_Majority R_win_by_Decision_Split
##  Min.   :0   Min.   :0.00000            Min.   :0.0000         
##  1st Qu.:0   1st Qu.:0.00000            1st Qu.:0.0000         
##  Median :0   Median :0.00000            Median :0.0000         
##  Mean   :0   Mean   :0.02794            Mean   :0.3069         
##  3rd Qu.:0   3rd Qu.:0.00000            3rd Qu.:0.0000         
##  Max.   :0   Max.   :2.00000            Max.   :5.0000         
##                                                                
##  R_win_by_Decision_Unanimous R_win_by_KO.TKO  R_win_by_Submission
##  Min.   : 0.000              Min.   : 0.000   Min.   : 0.0000    
##  1st Qu.: 0.000              1st Qu.: 0.000   1st Qu.: 0.0000    
##  Median : 1.000              Median : 1.000   Median : 0.0000    
##  Mean   : 1.251              Mean   : 1.298   Mean   : 0.7962    
##  3rd Qu.: 2.000              3rd Qu.: 2.000   3rd Qu.: 1.0000    
##  Max.   :10.000              Max.   :11.000   Max.   :13.0000    
##                                                                  
##  R_win_by_TKO_Doctor_Stoppage   R_Stance          R_Height_cms  
##  Min.   :0.00000              Length:6012        Min.   :152.4  
##  1st Qu.:0.00000              Class :character   1st Qu.:172.7  
##  Median :0.00000              Mode  :character   Median :180.3  
##  Mean   :0.06919                                 Mean   :179.0  
##  3rd Qu.:0.00000                                 3rd Qu.:185.4  
##  Max.   :2.00000                                 Max.   :210.8  
##                                                  NA's   :4      
##   R_Reach_cms     R_Weight_lbs       B_age           R_age     
##  Min.   :152.4   Min.   :115.0   Min.   :18.00   Min.   :19.0  
##  1st Qu.:177.8   1st Qu.:145.0   1st Qu.:26.00   1st Qu.:27.0  
##  Median :182.9   Median :170.0   Median :29.00   Median :29.0  
##  Mean   :183.6   Mean   :170.7   Mean   :29.29   Mean   :29.6  
##  3rd Qu.:190.5   3rd Qu.:185.0   3rd Qu.:32.00   3rd Qu.:32.0  
##  Max.   :213.4   Max.   :345.0   Max.   :51.00   Max.   :47.0  
##  NA's   :406     NA's   :2       NA's   :172     NA's   :63

Data Exploration

  • Delving deeper into the number of unique winners, we see that there are a total of 1058 unique winners.
  • Interestingly, the fighter with the most number of wins is Georges St-Pierre with 20 total wins, with a quick Google search we can see this aligns with the actual UFC results
## # A tibble: 3 × 3
##   Winner     n percent
##   <chr>  <int>   <dbl>
## 1 Red     3979   66.2 
## 2 Blue    1923   32.0 
## 3 Draw     110    1.83

Corner of the Winner Distribution

  • Starting with a variable that likely does not directly influence the winner probability: which corner is winning (red v blue)
  • So, we create a plot to further analyze and, we can conclude that the RED corner wins more UFC fights

Fighter Statistics

  • Now, let us look at the variables that are more likely to directly affect a fighter’s performance / ability to win a fight
  • These include the fighter’s WEIGHT, HEIGHT, & AGE

Age vs. Winner Outcome

  • Looking at the relationship between age & the outcome of the fight
  • Implement a density plot that displays the age difference by winner
## Warning: Removed 63 rows containing non-finite values (`stat_density()`).

* Through this density plot, we can conclude there is not a significant difference between the age of winning fighters and losing fighters

Weight vs Winner Outcome

  • Next, let us look at the relationship between weight and the winning/losing fighters
  • Again, we are doing so via a density plot of the weight differences
## Warning: Removed 2 rows containing non-finite values (`stat_density()`).

Height vs Winner Outcome

  • Lastly, we are looking at the relationship between height and outcome
  • Analyzing the density plot, there does not seem to be a large difference between these two factors
## Warning: Removed 4 rows containing non-finite values (`stat_density()`).

Creating Binary Winner Column

  • As part of data wrangling and cleanup, I found it necessary to mutate the data to ensure our winner data conformed to being binary, as shown:
ufc_data <- ufc_data %>%
  mutate(R_wins = ifelse(Winner == "Red", 1, 0))

Logistic Regresion Model - Factors for Fighter Win Chances

  • Using the glm function, let’s create a logistic regression model to analyze the specific fight statistics to include strike attempts, landed strikes, knockdowns, significant strikes, etc.
  • Our goal is to determine which of these are higher predictors for a fight win utilizing a p-value of 0.05 as our basis
  • Thus, the significant predictors of the winner of a fight are having a higher average number of significant landed strikes, hhigher distance strikes, and higher average ground strikes.
  • Interestingly, on the opposite end, fighters with a higher number of clinch strikes and body strikes are somewhat associated with a lesser probability of winning

Code Snippets from Logistic Regression Model

## 
## Call:
## glm(formula = R_wins ~ R_Height_cms + R_Reach_cms + R_Weight_lbs + 
##     B_Height_cms + B_Reach_cms + B_Weight_lbs, family = binomial, 
##     data = ufc_data)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6855  -1.3547   0.9192   0.9931   1.2096  
## 
## Coefficients:
##                Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.3730358  1.0107260   0.369  0.71207   
## R_Height_cms -0.0063266  0.0081691  -0.774  0.43867   
## R_Reach_cms   0.0190443  0.0063512   2.999  0.00271 **
## R_Weight_lbs  0.0088164  0.0029413   2.997  0.00272 **
## B_Height_cms -0.0007267  0.0081875  -0.089  0.92928   
## B_Reach_cms  -0.0132359  0.0064091  -2.065  0.03891 * 
## B_Weight_lbs -0.0069766  0.0029757  -2.345  0.01905 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 6591.6  on 4961  degrees of freedom
## Residual deviance: 6556.8  on 4955  degrees of freedom
##   (1050 observations deleted due to missingness)
## AIC: 6570.8
## 
## Number of Fisher Scoring iterations: 4

Real-World Application

  • Now, having data analysis and exploration like this is beneficial to fight watchers who want to predict fight outcomes, however, this is also beneficial to the fighters themselves
  • Knowing which types of factors increase their likelihood of winning is essential to formulating better training strategies and identifying which variables are within their control