Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Percentile estimation #7

Open
sixtohg opened this issue Aug 3, 2022 · 0 comments
Open

Percentile estimation #7

sixtohg opened this issue Aug 3, 2022 · 0 comments

Comments

@sixtohg
Copy link

sixtohg commented Aug 3, 2022

Dear Authors,

the description of the parameters of the function percentile are not coherent with the implementation. In particular, the percent argument is not expressed in terms of probability but percentile (0 to 100). See the example below. In the case of the value argument, it only works if also the percent argument is included.
In my opinion, based on the current implementation if you define both as percentiles, in the range 0-100, and modify the description accordingly, the problem would be solved.

Best regards

#' @title Percentile
#' @description Calculate the value of a given probability value or the other way around.
#' @param var Vector
#' @param percent Number between 0 and 1 to calculate the value of a given probability.
#' @param value Number of the value for which the probability is going to be calculated.

percentile(c(1:10), percent = c(1/3,2/3))
0.3333333% 0.6666667%
1.03 1.06
percentile(c(1:10), percent = 100c(1/3,2/3))
33.33333% 66.66667%
4 7
percentile(c(1:10), percent = 100
c(1/3,2/3), value = c(33,66))
33.33333% 66.66667%
4 7
Warning message:
In percentile(c(1:10), percent = 100 * c(1/3, 2/3), value = c(33, :
Values were given to both percentile and value... value will be ignored (set to NULL)
percentile(c(1:10), percent = c(1/3,2/3), value = c(33,66))
0.3333333% 0.6666667%
1.03 1.06
Warning message:
In percentile(c(1:10), percent = c(1/3, 2/3), value = c(33, 66)) :
Values were given to both percentile and value... value will be ignored (set to NULL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant