HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Percentiles are used in statistics to give you a number that describes the value that a given percent ofthe values are lower than
Percentiles are used in statistics to give you a number that describes the value that a given percent of the values are lower than.
If we take a look at the values of the wt
(weight) variable from the mtcars
data set:
1.513 | 1.615 | 1.835 | 1.935 | 2.140 | 2.200 | 2.320 | 2.465 |
2.620 | 2.770 | 2.780 | 2.875 | 3.150 | 3.170 | 3.190 | 3.215 |
3.435 | 3.440 | 3.440 | 3.440 | 3.460 | 3.520 | 3.570 | 3.570 |
3.730 | 3.780 | 3.840 | 3.845 | 4.070 | 5.250 | 5.345 | 5.424 |
What is the 75. percentile of the weight of the cars? The answer is 3.61 or 3 610 lbs, meaning that 75% or the cars weight 3 610 lbs or less:
Data_Cars <- mtcars
# c() specifies which percentile you want
quantile(Data_Cars$wt, c(0.75))
Result:
75% 3.61
If you run the quantile()
function without specifying the c()
parameter, you will get
the percentiles of 0, 25, 50, 75 and 100:
Data_Cars <- mtcars
quantile(Data_Cars$wt)
Result:
0% 25% 50% 75% 100% 1.51300 2.58125 3.32500 3.61000 5.42400
Quartiles are data divided into four parts, when sorted in an ascending order:
Use the quantile()
function to get the quartiles.