※ 当サイトは、アフィリエイト広告を利用しています。

データで見るゴールデンステイト・ウォリアーズの特徴と傾向【NBA2009-10 レギュラー・シーズン】

記事内に広告が含まれています。
スポンサーリンク

※参考<統計ソフトRに入力するコマンド>

 統計ソフトRのインストール手順をまとめた記事も作成していますので、よろしければご参考ください。

library(BasketballAnalyzeR)
library(gridExtra)
library(dplyr)
Pbox0910 <- read.csv(file="Pbox_0910.csv")
dts.PbP.0910 <- read.csv(file="PbP_0910.csv")
PbP0910 <- PbPmanipulation(dts.PbP.0910)

# Bubble plot of the players
Pbox0910b <- subset(Pbox0910, MIN>=500)
data0910b <- subset(Pbox0910b, Team=="Golden State Warriors")
attach(data0910b)
X2 <- data.frame(P=Player, P2M=P2M/GP, P3M=P3M/GP, FTp, AS=(P2A+P3A+FTA)/GP)
detach(data0910b)
labs1 <- c("2-point shots made per Game", "3-point shots made per Game", "free throws (% made)", "Total shots attempted per Game")
bubbleplot(X2, id="P", x="P2M", y="P3M", col="FTp", size="AS", labels=labs1, title="Bubble plot of Golden State Warriors' players: Shooting stats and shots attempted (NBA 2009 - 2010 Regular season)", text.size=3.5, mx = mean(Pbox0910b$P2M/Pbox0910b$GP), my = mean(Pbox0910b$P3M/Pbox0910b$GP))

attach(data0910b)
Y2 <- data.frame(P=Player, DREB=DREB/GP, STL=STL/GP, BLK=BLK/GP, PM=PM/GP)
detach(data0910b)
labs2 <- c("Defensive Rebounds per Game", "Blocks per Game", "Plus-Minus per Game", "Steals per Game")
bubbleplot(Y2, id="P", x="DREB", y="BLK", col="PM", size="STL", labels=labs2, title="Bubble plot of Golden State Warriors' players: Defensive stats and Plus-Minus (NBA 2009 - 2010 Regular season)", text.size=3.5, mx = mean(Pbox0910b$DREB/Pbox0910b$GP), my = mean(Pbox0910b$BLK/Pbox0910b$GP))

# Radar chart of the players
Pbox0910r <- subset(Pbox0910, MIN>=500)
attach(Pbox0910r)
T <- data.frame(P2M,P3M, FTM, REB=OREB+DREB, AST, STL, BLK)/MIN
detach(Pbox0910r)
T2 <- data.frame(Team=Pbox0910r$Team, Player=Pbox0910r$Player, T)
listplots <- radialprofile(data=T2[3:9], title=T2$Player, std=TRUE)
listplotsT <- listplots[T2$Team=="Golden State Warriors"]
grid.arrange(grobs=listplotsT[1:15], ncol=5)
grid.arrange(grobs=listplotsT[13:24], ncol=4)

# Variability diagram of the traditional stats
Pbox0910v <- subset(Pbox0910, Team=="Golden State Warriors" & MIN>=500)
vrb <- variability(data=Pbox0910v, data.var=c("P2M", "P3M", "FTM", "OREB", "DREB","AST","STL","BLK","TOV"), size.var=c("MIN"))
plot(vrb, title="Variability diagram of the traditional stats, Golden State Warriors' players (NBA 2009 - 2010 Regular season)")

# Shot chart of the team
PbP0910sc <- subset(PbP0910, data_set!="2009-10 Playoffs" & team=="GSW")
PbP0910sc$xx <- PbP0910sc$original_x/-10
PbP0910sc$yy <- PbP0910sc$original_y/10-41.75
shotchart(data=PbP0910sc, x="xx", y="yy", z="playlength", num.sect=5, type="sectors", scatter=FALSE, result="result")
shotchart(data=PbP0910sc, x="xx", y="yy", type="density-hexbin", nbins=50, palette="bwr")

# Density estimation of the field shots
data0910d <- subset(PbP0910, data_set!="2009-10 Playoffs" & result!="" & shot_distance!="" & team=="GSW")
densityplot(data=data0910d, shot.type="field", var="shot_distance", best.score=TRUE, title="Density estimation of the field shots of Golden State Warriors, with respect to shot distance (NBA 2009 - 2010 Regular Season)")
densityplot(data=data0910d, shot.type="field", var="totalTime", best.score=TRUE, title="Density estimation of the field shots of Golden State Warriors, with respect to total time (NBA 2009 - 2010 Regular Season)")
densityplot(data=data0910d, shot.type="field", var="playlength", best.score=TRUE, title="Density estimation of the field shots of Golden State Warriors, with respect to play length (NBA 2009 - 2010 Regular Season)")

# Expected points of the teams
data0910t <- subset(PbP0910, data_set!="2009-10 Playoffs" & result!="" & shot_distance!="" & team=="GSW")
data0910o <- subset(PbP0910, data_set!="2009-10 Playoffs" & result!="" & shot_distance!="" & oppTeam=="GSW")
data0910t <- mutate(data0910t, player = "Golden State Warriors")
data0910o <- mutate(data0910o, player = "Opponent teams")
data0910TO <- bind_rows(data0910t, data0910o)
pl <- c("Golden State Warriors","Opponent teams")
mypal <- colorRampPalette(c("red","blue"))
expectedpts(data0910TO, players=pl, col.team="gray", palette=mypal, col.hline="transparent", var="shot_distance", xlab="Shot distance", title="Expected points of Golden State Warriors and opponent teams, with respect to shot distance (NBA 2009 - 2010 Regular Season)")
expectedpts(data0910TO, bw=1500, players=pl, col.team="gray", palette=mypal, col.hline="transparent", var="totalTime", xlab="Total time", title="Expected points of Golden State Warriors and opponent teams, with respect to total time (NBA 2009 - 2010 Regular Season)")
expectedpts(data0910TO, players=pl, col.team="gray", palette=mypal, col.hline="transparent", var="playlength", xlab="Play length", title="Expected points of Golden State Warriors and opponent teams, with respect to play length (NBA 2009 - 2010 Regular Season)")

# Network of assists
PbP0910an <- subset(PbP0910, data_set!="2009-10 Playoffs" & team=="GSW")
PbP0910AN <- PbP0910an[!(PbP0910an$event_type=="shot" & PbP0910an$result=="missed"),]
netdataAN <- assistnet(PbP0910AN)
plot(netdataAN, layout="circle", edge.thr=20, node.col="FGPTS", node.size="ASTPTS")
TABan <- netdataAN$assistTable
Xan <- netdataAN$nodeStats
names(Xan)[1] <- "Player"
dataAN <- merge(Xan, Pbox0910, by="Player")
dataANsp <- subset(dataAN, Team=="Golden State Warriors")
mypal <- colorRampPalette(c("blue", "yellow", "red"))
scatterplot(dataANsp, data.var=c("ASTPTS", "FGPTS"), z.var="MIN", labels=dataANsp$Player, palette=mypal, repel_labels=TRUE, title="Scatter plot of Golden State Warriors' players: ASTPTS and FGPTS (NBA 2009 - 2010 Regular Season)")
selan <- which(dataAN$MIN>1500 & dataAN$Team=="Golden State Warriors")
tabAN <- TABan[selan, selan]
no.pl <- nrow(tabAN)
pR <- pM <- vector(no.pl, mode="list")
GiniM <- array(NA, no.pl)
GiniR <- array(NA, no.pl)
for (pl in 1:no.pl){
      ineqplM <- inequality(tabAN[pl,], npl=no.pl)
      GiniM[pl] <- ineqplM$Gini
      ineqplR <- inequality(tabAN[,pl], npl=no.pl)
      GiniR[pl] <- ineqplR$Gini
      title <- rownames(tabAN)[pl]
      pM[[pl]] <- plot(ineqplM, title=title)
      pR[[pl]] <- plot(ineqplR, title=title)
      }

grid.arrange(grobs=pM, nrow=2)
grid.arrange(grobs=pR, nrow=2)

# Shot chart of the opponent teams
PbP0910sco <- subset(PbP0910, data_set!="2009-10 Playoffs" & oppTeam=="GSW")
PbP0910sco$xx <- PbP0910sco$original_x/-10
PbP0910sco$yy <- PbP0910sco$original_y/10-41.75
shotchart(data=PbP0910sco, x="xx", y="yy", z="playlength", num.sect=5, type="sectors", scatter=FALSE, result="result")
shotchart(data=PbP0910sco, x="xx", y="yy", type="density-hexbin", nbins=50, palette="bwr")

# Density estimation of the field shots of the opponent teams
data0910do <- subset(PbP0910, data_set!="2009-10 Playoffs" & result!="" & shot_distance!="" & oppTeam=="GSW")
densityplot(data=data0910do, shot.type="field", var="shot_distance", best.score=TRUE, title="Density estimation of field shots of Golden State Warriors' opponents, with respect to shot distance (NBA 2009 - 2010 Regular Season)")

⇐ 2008-09 |🏀| 2010-11 ⇒

※データ分析を実践する際に参考にしている書籍『Basketball Data Science: With Applications in R』の紹介記事も書いていますので、よろしければ下記よりご確認ください。

タイトルとURLをコピーしました