Learn R Programming

BasketballAnalyzeR (version 0.5.0)

fourfactors: Calculates possessions, pace, offensive and defensive rating, and Four Factors

Description

Calculates possessions, pace, offensive and defensive rating, and Four Factors

Usage

fourfactors(TEAM, OPP)

Arguments

TEAM

a data frame whose rows are the analyzed teams and with columns referred to the team achievements in the considered games (a box score); required variables: Team, P2A, P2M, P3A, P3M, FTA, FTM, OREB, DREB, TOV, MIN (see Details).

OPP

a data frame whose rows are the analyzed teams and with columns referred to the achievements of the opponents of each team in the considered game; required variables: Team, P2A, P2M, P3A, P3M, FTA, FTM, OREB, DREB, TOV, MIN (see Details).

Value

An object of class fourfactors, i.e. a data frame with the following columns:

  • Team, a factor with the name of the analyzed team

  • POSS.Off, a numeric variable with the number of possessions of each team calculated with the formula \(POSS=(P2A+P3A)+0.44*FTA-OREB+TOV\)

  • POSS.Def, a numeric variable with the number of possessions of the opponents of each team calculated with the formula \(POSS=(P2A+P3A)+0.44*FTA-OREB+TOV\)

  • PACE.Off, a numeric variable with the pace of each team (number of possessions per minute played)

  • PACE.Def, a numeric variable with the pace of the opponents of each team (number of possessions per minute played)

  • ORtg, a numeric variable with the offensive rating (the points scored by each team per 100 possessions)

  • DRtg, a numeric variable with the defensive rating (the points scored by the opponents of each team per 100 possessions)

  • F1.Off, a numeric variable with the offensive first factor (effective field goal percentage)

  • F2.Off, a numeric variable with the offensive second factor (turnovers per possession)

  • F3.Off, a numeric variable with the offensive third factor (rebouding percentage)

  • F4.Off, a numeric variable with the offensive fourth factor (free throw rate)

  • F1.Def, a numeric variable with the defensive first factor (effective field goal percentage)

  • F2.Def, a numeric variable with the defensive second factor (turnovers per possession)

  • F3.Def, a numeric variable with the defensive third factor (rebouding percentage)

  • F4.Def, a numeric variable with the defensive fourth factor (free throw rate)

Details

The rows of the TEAM and the OPP data frames must be referred to the same teams in the same order.

Required columms:

  • Team, a factor with the name of the analyzed team

  • P2A, a numeric variable (integer) with the number of 2-points shots attempted

  • P2M, a numeric variable (integer) with the number of 2-points shots made

  • P3A, a numeric variable (integer) with the number of 3-points shots attempted

  • P3M, a numeric variable (integer) with the number of 3-points shots made

  • FTA, a numeric variable (integer) with the number of free throws attempted

  • FTM, a numeric variable (integer) with the number of free throws made

  • OREB, a numeric variable (integer) with the number of offensive rebounds

  • DREB, a numeric variable (integer) with the number of defensive rebounds

  • TOV, a numeric variable (integer) with the number of turnovers

  • MIN, a numeric variable (integer) with the number of minutes played

References

P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.

See Also

plot.fourfactors

Examples

Run this code
# NOT RUN {
selTeams <- c(2,6,10,11)
FF <- fourfactors(Tbox[selTeams,], Obox[selTeams,])
plot(FF)
# }

Run the code above in your browser using DataLab