I'm sorry for what may be a silly question. When I do:
> quantile(df$column, .75) #get 3rd quartile
I get something like
75% 1234.5
Is there a way to just get the value (1234.5) without the descriptive "75%" string? Thank you very much.
We often divide the distribution at 99 centiles or percentiles . The median is thus the 50th centile. For the 20th centile of FEV1, i =0.2 times 58 = 11.6, so the quantile is between the 11th and 12th observation, 3.42 and 3.48, and can be estimated by 3.42 + (3.48 - 3.42) times (11.6 - 11) = 3.46.
To group data, we use dplyr module. This module contains a function called group_by() in which the column to be grouped by has to be passed. To find quantiles of the grouped data we will call summarize method with quantiles() function.
You can also use unname
> result <- quantile(c(1,2,3,4),0.75) > unname(result) [1] 3.25
Also you can subset by using [[
> result[[1]] [1] 3.25
Now you can use names = FALSE
as argument.
> quantile(c(1,2,3,4),0.75, names = FALSE) [1] 3.25
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With