## [1] "Year" "City" "Match.No" "Team" "Won"
## [6] "TossWon" "BatFrist" "HomeMatch" "PPRuns" "PPWickets"
## [11] "FourCount" "SixCount" "WicketsLost" "TotelRuns"
## '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 ...
## 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
## 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
##
## TossWon
## Won 0 1
## 0 27.29 22.88
## 1 22.71 27.12
## BatFrist
## Won 0 1
## 0 22.55 27.61
## 1 27.45 22.39
## HomeMatch
## Won 0 1
## 0 33.50 16.67
## 1 25.82 24.02
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
mean = round(mean(TotelRuns),2),
sd = round(sd(TotelRuns),2)),
by = (BatFrist)][order(BatFrist)]
tab1## BatFrist N mean sd
## 1: 0 306 154.81 32.08
## 2: 1 306 165.44 31.03
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
mean = round(mean(TotelRuns),2),
sd = round(sd(TotelRuns),2)),
by = (TossWon)][order(TossWon)]
tab1## TossWon N mean sd
## 1: 0 306 165.35 30.91
## 2: 1 306 154.90 32.22
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
mean = round(mean(TotelRuns),2),
sd = round(sd(TotelRuns),2)),
by = (HomeMatch)][order(HomeMatch)]
tab1## HomeMatch N mean sd
## 1: 0 363 157.20 32.21
## 2: 1 249 164.39 31.21
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
mean = round(mean(TotelRuns),2),
sd = round(sd(TotelRuns),2)),
by = (Won)][order(Won)]
tab1## Won N mean sd
## 1: 0 307 152.94 32.06
## 2: 1 305 167.36 30.26
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
TotelRuns = round(mean(TotelRuns),2),
PPRuns = round(mean(PPRuns),2),
PPWickets = round(mean(PPWickets),2),
FourCount = round(mean(FourCount),2),
SixCount = round(mean(SixCount),2),
WicketsLost = round(mean(WicketsLost),2)),
by = (TossWon)][order(TossWon)]
tab1## 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
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
TotelRuns = round(mean(TotelRuns),2),
PPRuns = round(mean(PPRuns),2),
PPWickets = round(mean(PPWickets),2),
FourCount = round(mean(FourCount),2),
SixCount = round(mean(SixCount),2),
WicketsLost = round(mean(WicketsLost),2)),
by = (BatFrist)][order(BatFrist)]
tab1## 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
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
TotelRuns = round(mean(TotelRuns),2),
PPRuns = round(mean(PPRuns),2),
PPWickets = round(mean(PPWickets),2),
FourCount = round(mean(FourCount),2),
SixCount = round(mean(SixCount),2),
WicketsLost = round(mean(WicketsLost),2)),
by = (HomeMatch)][order(HomeMatch)]
tab1## 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
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
TotelRuns = round(mean(TotelRuns),2),
PPRuns = round(mean(PPRuns),2),
PPWickets = round(mean(PPWickets),2),
FourCount = round(mean(FourCount),2),
SixCount = round(mean(SixCount),2),
WicketsLost = round(mean(WicketsLost),2)),
by = .(BatFrist,HomeMatch)][order(HomeMatch)]
tab1## 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
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
TotelRuns = round(mean(TotelRuns),2),
PPRuns = round(mean(PPRuns),2),
PPWickets = round(mean(PPWickets),2),
FourCount = round(mean(FourCount),2),
SixCount = round(mean(SixCount),2),
WicketsLost = round(mean(WicketsLost),2)),
by = .(TossWon,HomeMatch)][order(HomeMatch)]
tab1## 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
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
TotelRuns = round(mean(TotelRuns),2),
PPRuns = round(mean(PPRuns),2),
PPWickets = round(mean(PPWickets),2),
FourCount = round(mean(FourCount),2),
SixCount = round(mean(SixCount),2),
WicketsLost = round(mean(WicketsLost),2)),
by = .(TossWon,BatFrist)][order(BatFrist)]
tab1## 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
# summary statistics by groups
library(data.table)
IPLData.dt <- data.table(IPLData)
tab1 <- IPLData.dt[, .(N = .N,
TotelRuns = round(mean(TotelRuns),2),
PPRuns = round(mean(PPRuns),2),
PPWickets = round(mean(PPWickets),2),
FourCount = round(mean(FourCount),2),
SixCount = round(mean(SixCount),2),
WicketsLost = round(mean(WicketsLost),2)),
by = .(TossWon,BatFrist,HomeMatch)][order(HomeMatch)]
tab1## 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
library(dplyr)
# Subset of Continuous Data Columns
IPLData2 <- select(IPLData,c(9:14))
#dim(dt2)
# Create the Correlation matrix
corMat <- round(cor(IPLData2), 2)#corMat
corMat## 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