[Rd] quantile() names

Abby Spurdle @purd|e@@ @end|ng |rom gm@||@com
Mon Dec 14 22:47:45 CET 2020


The "value" is *not* 975.
It's 975.025.

The results that you're observing, are merely the byproduct of formatting.

Maybe, you should try:

    quantile (x, .975, type=4)

Which perhaps, using default options, produces the result you're expecting?


On Tue, Dec 15, 2020 at 8:55 AM Merkle, Edgar C. <merklee using missouri.edu> wrote:
>
> All,
>
> Consider the code below
>
> options(digits=2)
> x <- 1:1000
> quantile(x, .975)
>
> The value returned is 975 (the 97.5th percentile), but the name has been shortened to "98%" due to the digits option. Is this intended? I would have expected the name to also be "97.5%" here. Alternatively, the returned value might be 980 in order to match the name of "98%".
>
> Best,
> Ed
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list