Description Usage Arguments Value Author(s) References See Also Examples
Inequality analysis
1 | inequality(data, nplayers)
|
data |
numeric vector containing the achievements (e.g. scored points) of the players whose inequality has to be analyzed. |
nplayers |
integer, number of players to include in the analysis (ranked in nondecreasing order according to the values in data). |
A list with the following elements: Lorenz
(cumulative distributions used to plot the Lorenz curve) and Gini
(Gini coefficient).
Marco Sandri, Paola Zuccolotto, Marica Manisera (basketballanalyzer.help@unibs.it)
P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.
1 2 3 4 | Pbox.BN <- subset(Pbox, Team=="Brooklyn Nets")
out <- inequality(Pbox.BN$PTS, nplayers=8)
print(out)
plot(out)
|
Loading required package: ggplot2
Registered S3 method overwritten by 'GGally':
method from
+.gg ggplot2
If you want to reproduce the figures contained in the book of
Zuccolotto and Manisera (2020) and
if the version of your R machine is >= 3.6.0, you need to type
RNGkind(sample.kind = "Rounding")
at the beginning of your working session
$Gini
[1] 9.59
$Lorenz
F Q
1 0.000 0.00000000
2 0.125 0.08433908
3 0.250 0.19109195
4 0.375 0.31264368
5 0.500 0.43591954
6 0.625 0.57183908
7 0.750 0.71307471
8 0.875 0.85531609
9 1.000 1.00000000
attr(,"class")
[1] "inequality" "list"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.