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.
#Three-Pointers Made:
three_made<-c(4, 5, 3, 6, 7)
#Three-Pointers Attempted:
three_attempted<-c(9, 10, 8, 11, 12)
avg_game<-round(three_made/three_attempted,3)
avg_game
[1] 0.444 0.500 0.375 0.545 0.583
overall_avg<-round(mean(avg_game),2)
overall_avg
[1] 0.49
avg_total<-round(sum(three_made)/sum(three_attempted),3)
avg_total
[1] 0.5
overall_avg (0.49/ 49%): Represents the unweighted average of the
per-game percentages. It treats a game with 8 attempts the same as a
game with 12 attempts.avg_total (0.50/ 50%): Represents the true
cumulative shooting percentage. It weights each attempt equally, making
it the standard metric for sports analytics.
LS0tCnRpdGxlOiAiQWN0aXZpdHkgMTQiCm91dHB1dDogaHRtbF9ub3RlYm9vawotLS0KCkNvbnNpZGVyIHRoZSBmb2xsb3dpbmcgdmVjdG9ycyByZXByZXNlbnRpbmcgdGhlIG51bWJlciBvZiB0aHJlZS1wb2ludGVycyBtYWRlIGFuZCBhdHRlbXB0ZWQgYnkgYSBiYXNrZXRiYWxsIHBsYXllciBpbiBmaXZlIGdhbWVzOgoKVGhyZWUtUG9pbnRlcnMgTWFkZTogYyg0LCA1LCAzLCA2LCA3KSAKVGhyZWUtUG9pbnRlcnMgQXR0ZW1wdGVkOiBjKDksIDEwLCA4LCAxMSwgMTIpCgpDYWxjdWxhdGUgdGhlIHRocmVlLXBvaW50IHNob290aW5nIHBlcmNlbnRhZ2UgZm9yIGVhY2ggZ2FtZSBhbmQgc2VsZWN0IHRoZSBjb3JyZWN0IGF2ZXJhZ2UgdGhyZWUtcG9pbnQgc2hvb3RpbmcgcGVyY2VudGFnZSBmb3IgdGhlIGZpdmUgZ2FtZXMuCgoKYGBge3J9CiNUaHJlZS1Qb2ludGVycyBNYWRlOiAKdG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