[R] the quantile function and problems.

Uwe Brauer oub @end|ng |rom m@t@ucm@e@
Fri Jul 15 21:29:19 CEST 2022


>>> "IK" == Ivan Krylov <krylov.r00t using gmail.com> writes:

> В Thu, 14 Jul 2022 14:58:17 +0200
> Uwe Brauer <oub using mat.ucm.es> пишет:

>> What turns me crazy is that the way R, matlab and the JCR calculate
>> the quartiles gives different results.

> R by itself can give up to 9 slightly different results:

> sapply(1:9, function(type) quantile(1:267, 1:3/4, type = type))
> #     [,1] [,2] [,3]   [,4]   [,5] [,6]  [,7]      [,8]     [,9]
> # 25%   67   67   67  66.75  67.25   67  67.5  67.16667  67.1875
> # 50%  134  134  134 133.50 134.00  134 134.0 134.00000 134.0000
> # 75%  201  201  200 200.25 200.75  201 200.5 200.83333 200.8125

Thanks, number 3 is the best for my purpose. 

Very useful



-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 


More information about the R-help mailing list