LoginSignup
8
2

More than 5 years have passed since last update.

任意のパーセンタイル値を求める方法

Posted at

最近知ったのでメモ。

quantile()は四分位数だけでなく、自分で取得したいところのパーセンタイル値を出力してくれる。

> x  <- rnorm(1000)
> quantile(x, c(0, 0.1, 0.45, 0.9, 1))
       0%       10%       45%       90%      100% 
-3.351967 -1.416228 -0.147615  1.290920  3.118316 
> quantile(x, c(0.33, 0.66))
       33%        66% 
-0.4488476  0.4264979 
> quantile(x, probs = 0.33)
       33% 
-0.4488476 

便利ですね。

8
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
2