Consider the following vectors representing the number of three-pointers made and attempted by a basketball player in five games:
Three-Pointers Made: c(4, 5, 3, 6, 7) Three-Pointers Attempted: c(9, 10, 8, 11, 12) Calculate the three-point shooting percentage for each game and select the correct average three-point shooting percentage for the five games.
X3P <- c(4, 5, 3, 6, 7)
X3PA <- c(9, 10, 8, 11, 12)
# Calculate three-point shooting percentage for each game
X3P_pct <- (X3P / X3PA) * 100
# Calculate the average three-point shooting percentage
avgX3P_pct <- mean(X3P_pct)
# Output the result
X3P_pct
## [1] 44.44444 50.00000 37.50000 54.54545 58.33333
avgX3P_pct
## [1] 48.96465