I can use R summary function to get min, max and percentiles(25, 75).
How can i use summary to get arbitrary quantiles like 90th percentile and 99th percentile in summary stats?
I can use R summary function to get min, max and percentiles(25, 75).
How can i use summary to get arbitrary quantiles like 90th percentile and 99th percentile in summary stats?
Use quantile
function
quantile(x, c(.90, .99))
Example:
> set.seed(1)
> x <- rnorm(100)
> summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-2.2150 -0.4942 0.1139 0.1089 0.6915 2.4020
> quantile(x, c(.25, .50, .75, .90, .99))
25% 50% 75% 90% 99%
-0.4942425 0.1139092 0.6915454 1.1810651 2.1749017