Exploratory Data Analysis

Reading Data into R Environment

Dimensions of the data frame

## [1] 612  14

Column names of the data frame

##  [1] "Year"        "City"        "Match.No"    "Team"        "Won"        
##  [6] "TossWon"     "BatFrist"    "HomeMatch"   "PPRuns"      "PPWickets"  
## [11] "FourCount"   "SixCount"    "WicketsLost" "TotelRuns"

Structure of the data frame

## 'data.frame':    612 obs. of  14 variables:
##  $ Year       : Factor w/ 6 levels "A2019","B2018",..: 3 3 3 3 3 3 3 3 3 3 ...
##  $ City       : Factor w/ 21 levels "Abu Dhabi","Ahemdabad",..: 9 9 16 16 18 18 10 10 3 3 ...
##  $ Match.No   : int  1 1 2 2 3 3 4 4 5 5 ...
##  $ Team       : Factor w/ 12 levels "CSK","DC","GL",..: 10 7 6 11 3 4 8 5 7 2 ...
##  $ Won        : Factor w/ 2 levels "0","1": 2 1 1 2 1 2 1 2 2 1 ...
##  $ TossWon    : Factor w/ 2 levels "0","1": 1 2 1 2 1 2 1 2 2 1 ...
##  $ BatFrist   : Factor w/ 2 levels "0","1": 2 1 2 1 2 1 2 1 2 1 ...
##  $ HomeMatch  : Factor w/ 2 levels "0","1": 2 1 1 2 1 1 1 1 2 1 ...
##  $ PPRuns     : int  59 54 61 59 52 73 50 50 41 43 ...
##  $ PPWickets  : int  1 1 1 1 1 0 1 1 2 2 ...
##  $ FourCount  : int  17 15 12 18 18 18 11 11 14 10 ...
##  $ SixCount   : int  9 6 11 6 8 8 7 7 7 5 ...
##  $ WicketsLost: int  4 10 8 3 4 0 6 4 8 9 ...
##  $ TotelRuns  : int  207 172 184 187 183 184 163 164 157 142 ...

Descriptive Statistics of the data frame

##               n   mean    sd median min max
## Year*       612   3.37  1.73    3.0   1   6
## City*       612  10.49  5.09   11.0   1  21
## Match.No    612  29.46 15.98   30.0   1  56
## Team*       612   5.76  3.23    5.0   1  12
## Won*        612   1.50  0.50    1.0   1   2
## TossWon*    612   1.50  0.50    1.5   1   2
## BatFrist*   612   1.50  0.50    1.5   1   2
## HomeMatch*  612   1.41  0.49    1.0   1   2
## PPRuns      612  47.67 12.01   48.0  15 105
## PPWickets   612   1.35  1.08    1.0   0   5
## FourCount   612  13.61  4.23   14.0   2  31
## SixCount    612   6.00  3.47    6.0   0  20
## WicketsLost 612   5.73  2.41    6.0   0  10
## TotelRuns   612 160.12 31.98  162.0  41 248

Summary Statistics of the data frame

##     Year            City        Match.No          Team     Won     TossWon
##  A2019:112   Mumbai   : 74   Min.   : 1.00   KXIP   : 79   0:307   0:306  
##  B2018:112   Kolkata  : 72   1st Qu.:16.00   RCB    : 78   1:305   1:306  
##  C2017:110   Bengaluru: 70   Median :30.00   DC     : 77                  
##  D2016:104   Delhi    : 70   Mean   :29.46   MI     : 77                  
##  E2015: 62   Hyderabad: 70   3rd Qu.:43.00   KKR    : 76                  
##  F2014:112   Mohali   : 42   Max.   :56.00   SRH    : 74                  
##              (Other)  :214                   (Other):151                  
##  BatFrist HomeMatch     PPRuns         PPWickets       FourCount    
##  0:306    0:363     Min.   : 15.00   Min.   :0.000   Min.   : 2.00  
##  1:306    1:249     1st Qu.: 40.00   1st Qu.:1.000   1st Qu.:11.00  
##                     Median : 48.00   Median :1.000   Median :14.00  
##                     Mean   : 47.67   Mean   :1.355   Mean   :13.61  
##                     3rd Qu.: 55.00   3rd Qu.:2.000   3rd Qu.:16.00  
##                     Max.   :105.00   Max.   :5.000   Max.   :31.00  
##                                                                     
##     SixCount       WicketsLost       TotelRuns    
##  Min.   : 0.000   Min.   : 0.000   Min.   : 41.0  
##  1st Qu.: 3.000   1st Qu.: 4.000   1st Qu.:142.0  
##  Median : 6.000   Median : 6.000   Median :162.0  
##  Mean   : 5.997   Mean   : 5.729   Mean   :160.1  
##  3rd Qu.: 8.000   3rd Qu.: 7.000   3rd Qu.:181.0  
##  Max.   :20.000   Max.   :10.000   Max.   :248.0  
## 

Two way Frequency Tables

Percentage winnings of IPL matches with TossWon

##    TossWon
## Won     0     1
##   0 27.29 22.88
##   1 22.71 27.12

Percentage winnings of IPL matches with BatFrist

##    BatFrist
## Won     0     1
##   0 22.55 27.61
##   1 27.45 22.39

Percentage winnings of IPL matches with HomeMatch

##    HomeMatch
## Won     0     1
##   0 33.50 16.67
##   1 25.82 24.02

Summary Statistics in Groups

Average TotelRuns,PPRuns,PPWickets,FourCount,SixCount,WicketsLost broken down by TossWon

##    TossWon   N TotelRuns PPRuns PPWickets FourCount SixCount WicketsLost
## 1:       0 306    165.35  46.82      1.31     13.85     6.27        5.89
## 2:       1 306    154.90  48.52      1.40     13.37     5.73        5.57

Average TotelRuns,PPRuns,PPWickets,FourCount,SixCount,WicketsLost broken down by BatFrist

##    BatFrist   N TotelRuns PPRuns PPWickets FourCount SixCount WicketsLost
## 1:        0 306    154.81  48.80      1.36     13.40     5.60        5.51
## 2:        1 306    165.44  46.54      1.35     13.82     6.39        5.95

Average TotelRuns,PPRuns,PPWickets,FourCount,SixCount,WicketsLost broken down by HomeMatch

##    HomeMatch   N TotelRuns PPRuns PPWickets FourCount SixCount WicketsLost
## 1:         0 363    157.20  47.09      1.37     13.37     5.68        5.81
## 2:         1 249    164.39  48.52      1.33     13.95     6.46        5.61

Average TotelRuns,PPRuns,PPWickets,FourCount,SixCount,WicketsLost broken down by HomeMatch,BatFrist

##    BatFrist HomeMatch   N TotelRuns PPRuns PPWickets FourCount SixCount
## 1:        0         0 205    152.59  48.00      1.39     13.15     5.36
## 2:        1         0 158    163.18  45.92      1.35     13.66     6.09
## 3:        1         1 148    167.85  47.21      1.34     13.99     6.72
## 4:        0         1 101    159.33  50.44      1.32     13.90     6.09
##    WicketsLost
## 1:        5.68
## 2:        5.99
## 3:        5.91
## 4:        5.16

Average TotelRuns,PPRuns,PPWickets,FourCount,SixCount,WicketsLost broken down by HomeMatch,TossWon

##    TossWon HomeMatch   N TotelRuns PPRuns PPWickets FourCount SixCount
## 1:       1         0 194    152.37  47.41      1.39     12.99     5.46
## 2:       0         0 169    162.74  46.72      1.34     13.81     5.92
## 3:       0         1 137    168.56  46.94      1.26     13.90     6.69
## 4:       1         1 112    159.29  50.45      1.42     14.02     6.18
##    WicketsLost
## 1:        5.65
## 2:        6.00
## 3:        5.74
## 4:        5.44

Average TotelRuns,PPRuns,PPWickets,FourCount,SixCount,WicketsLost broken down by BatFrist,TossWon

##    TossWon BatFrist   N TotelRuns PPRuns PPWickets FourCount SixCount
## 1:       1        0 271    155.26  48.97      1.36     13.45     5.75
## 2:       0        0  35    151.34  47.51      1.37     12.97     4.46
## 3:       0        1 271    167.15  46.73      1.30     13.96     6.50
## 4:       1        1  35    152.14  45.09      1.71     12.71     5.54
##    WicketsLost
## 1:        5.45
## 2:        5.97
## 3:        5.87
## 4:        6.54

Average TotelRuns,PPRuns,PPWickets,FourCount,SixCount,WicketsLost broken down by BatFrist,TossWon,HomeMatch

##    TossWon BatFrist HomeMatch   N TotelRuns PPRuns PPWickets FourCount
## 1:       1        0         0 180    152.57  48.02      1.37     13.14
## 2:       0        1         0 144    164.48  46.53      1.32     13.92
## 3:       0        0         0  25    152.72  47.84      1.48     13.16
## 4:       1        1         0  14    149.79  39.64      1.64     11.00
## 5:       0        1         1 127    170.19  46.96      1.28     14.01
## 6:       1        0         1  91    160.58  50.85      1.34     14.05
## 7:       1        1         1  21    153.71  48.71      1.76     13.86
## 8:       0        0         1  10    147.90  46.70      1.10     12.50
##    SixCount WicketsLost
## 1:     5.44        5.59
## 2:     6.12        5.94
## 3:     4.76        6.32
## 4:     5.71        6.43
## 5:     6.93        5.80
## 6:     6.35        5.16
## 7:     5.43        6.62
## 8:     3.70        5.10

Correlation Matrix

##             PPRuns PPWickets FourCount SixCount WicketsLost TotelRuns
## PPRuns        1.00     -0.42      0.45     0.26       -0.16      0.45
## PPWickets    -0.42      1.00     -0.27    -0.18        0.46     -0.33
## FourCount     0.45     -0.27      1.00     0.15       -0.24      0.66
## SixCount      0.26     -0.18      0.15     1.00       -0.24      0.67
## WicketsLost  -0.16      0.46     -0.24    -0.24        1.00     -0.27
## TotelRuns     0.45     -0.33      0.66     0.67       -0.27      1.00

Visualizing Correlation Matrix