Professional Documents
Culture Documents
IPL2
IPL2
os
W25531
Student Appendix
rP
Soumya Roy, Soumyadeep Kundu, and Dipayan Roy wrote this student appendix as an aid to students in the classroom use of the
case The Indian Premier League: Gauging Player Performance, No. W25528. This appendix should not be used in any way that would
prejudice the future use of the case.
This publication may not be transmitted, photocopied, digitized, or otherwise reproduced in any form or by any means without the
permission of the copyright holder. Reproduction of this material is not covered under authorization by any reproduction rights
yo
organization. To order copies or request permission to reproduce materials, contact Ivey Publishing, Ivey Business School, Western
University, London, Ontario, Canada, N6G 0N1; (t) 519.661.3208; (e) cases@ivey.ca; www.iveycases.com. Our goal is to publish
materials of the highest quality; submit any errata to publishcases@ivey.ca. i1v2e5y5pubs
# Names of Variables
names(d)
# Player Names
players=d[,2]
players
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 2 W25531
t
## [49] "Robin Uthappa" "Rohit Sharma" "Sam Curran"
os
## [52] "Sanju Samson" "Sarfaraz Khan" "Shane Watson"
## [55] "Sherfane Rutherford" "Shikhar Dhawan" "Shimron Hetmyer"
## [58] "Shreyas Gopal" "Shreyas Iyer" "Shubman Gill"
## [61] "Steve Smith" "Stuart Binny" "Sunil Narine"
## [64] "Suresh Raina" "Suryakumar Yadav" "Umesh Yadav"
rP
## [67] "Vijay Shankar" "Virat Kohli" "Wriddhiman Saha"
## [70] "Yusuf Pathan"
yo
str(d)
# Summary Statistics
summary(d)
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 3 W25531
t
## 1st Qu.: 8.00 1st Qu.: 4.00 1st Qu.:0.3217
os
## Median :19.00 Median : 8.00 Median :0.7009
## Mean :22.40 Mean :10.51 Mean :0.9120
## 3rd Qu.:36.75 3rd Qu.:14.00 3rd Qu.:1.3281
## Max. :64.00 Max. :52.00 Max. :2.6562
rP
# Boxplot
boxplot(Salary,col="red",lwd=2)
yo
op
tC
# Inter‐Quartile Range
quantile(Salary,probs=0.75)‐quantile(Salary,probs=0.25)
## 75%
## 1.006468
# Correlation Matrix
Do
cor(d[,4:11])
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 4 W25531
t
## Avg 0.7348088 1.0000000 0.4587212 0.3704745 0.6568595 0.5707617 0.659
os
4927
## SR 0.3552689 0.4587212 1.0000000 0.1343445 0.2477918 0.2657353 0.579
0312
## Hundreds 0.4366210 0.3704745 0.1343445 1.0000000 0.2989482 0.4229155 0.192
8595
rP
## Fifties 0.8701533 0.6568595 0.2477918 0.2989482 1.0000000 0.7985036 0.675
4056
## Fours 0.9269084 0.5707617 0.2657353 0.4229155 0.7985036 1.0000000 0.565
4438
## Sixes 0.7698171 0.6594927 0.5790312 0.1928595 0.6754056 0.5654438 1.000
0000
## Salary 0.3234302 0.2919955 0.1055668 0.2331481 0.2900521 0.2550323 0.246
yo
8059
## Salary
## Runs 0.3234302
## Avg 0.2919955
## SR 0.1055668
## Hundreds 0.2331481
## Fifties 0.2900521
op
## Fours 0.2550323
## Sixes 0.2468059
## Salary 1.0000000
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 5 W25531
t
os
rP
yo
op
# Outstanding Players w.r.t. Batting Average and Strike Rate
boxplot(Avg)$out
Player[which(Avg==69.2)]
Player[which(Avg==83.2)]
boxplot(SR)$out
Player[which(SR==204.81)]
Player[which(SR==191.42)]
Do
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 6 W25531
t
os
# Principal Components
# scale=T for standardizing the variables
pr.out=prcomp(d.new,scale=T)
names(pr.out)
rP
## [1] "sdev" "rotation" "center" "scale" "x"
# Interpretation
pr.out$rotation=‐pr.out$rotation
pr.out$x=‐pr.out$x
yo
# Summary
summary(pr.out)
## Importance of components:
## PC1 PC2 PC3 PC4 PC5 PC6
## Standard deviation 2.0373 0.9884 0.62587 0.55014 0.39928 0.13728
## Proportion of Variance 0.6917 0.1628 0.06529 0.05044 0.02657 0.00314
op
## Cumulative Proportion 0.6917 0.8546 0.91985 0.97029 0.99686 1.00000
# Ranking
dim(pr.out$x)
## [1] 70 6
tC
pr.1.score=pr.out$x[,1]
# Rank
p=sort(pr.1.score,decreasing=T)
M=cbind(p,1:70)
colnames(M)=c("Score","Rank")
No
## Cluster Analysis
# Load Libraries
library(cluster)
library(factoextra)
oo.gl/ve3WBa
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 7 W25531
t
os
rP
yo
op
# Scale the variables
d.new.s=scale(d.new)
# Number of Clusters
tC
gap=clusGap(d.new.s,FUN=kmeans,nstart=20,K.max=10,B=100)
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 8 W25531
t
os
rP
yo
op
# K‐means Clustering for K=4
km.out=kmeans(d.new.s,4,nstart=20)
# Cluster Identification
tC
km.clus=km.out$cluster
Player[km.clus==1]
#Cluster Size
table(km.clus)
## km.clus
## 1 2 3 4
## 10 27 21 12
# Visualize cluster
fviz_cluster(km.out,d.new.s)
Do
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 9 W25531
t
os
rP
yo
op
# Silhouette Statistic
sil=silhouette(km.out$cluster, dist(d.new.s))
rownames(sil)=rownames(d.new)
fviz_silhouette(sil)
tC
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 10 W25531
t
os
rP
yo
op
# Negative Silhouette Statistic used for identifying the states which should
belong to different clusters
neg_sil_index=which(sil[, "sil_width"] < 0)
sil[neg_sil_index, , drop = FALSE]
tC
# Overall Average
A_M=apply(d.new,2,mean)
prop.table(T_P,margin=1)
## km.clus
## Team 1 2 3 4
## Chennai Super Kings 0.12500000 0.12500000 0.37500000 0.37500000
## Delhi Capitals 0.14285714 0.28571429 0.42857143 0.14285714
## Kings XI Punjab 0.22222222 0.66666667 0.11111111 0.00000000
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860
Page 11 W25531
t
## Kolkata Knight Riders 0.11111111 0.11111111 0.55555556 0.22222222
os
## Mumbai Indians 0.28571429 0.28571429 0.28571429 0.14285714
## Rajasthan Royals 0.00000000 0.54545455 0.36363636 0.09090909
## Royal Challengers Bangalore 0.12500000 0.50000000 0.25000000 0.12500000
## Sunrisers Hyderabad 0.18181818 0.45454545 0.09090909 0.27272727
rP
# Cluster and Salary
d$Cluster=km.clus
tapply(d$Salary,d$Cluster,mean)
## 1 2 3 4
## 1.4189310 0.7038378 1.0148814 0.7779758
mean(d$Salary)
yo
## [1] 0.9120164 op
tC
No
Do
This document is authorized for educator review use only by RAJAT BOHRA, Taxila Business School until Mar 2024. Copying or posting is an infringement of copyright.
Permissions@hbsp.harvard.edu or 617.783.7860