get.pctile | R Documentation |
Given a vector of numbers (a dataset), and one or more specific values of interest,
determine at what percentile(s) are those selected values. In other words,
what fraction of all of the numbers (actually weighted based on cumulative sum of weights)
are smaller than (or tied with) the selected value(s) of interest?
Based on analyze.stuff::pct.above (analyze.stuff::pct.above()
)
get.pctile(x, values, wts = 1, or.tied = TRUE, na.rm = TRUE)
x |
Vector of numeric values (the distribution within which percentiles are sought) |
values |
Required vector of one or more numbers for which percentiles are sought. |
wts |
Optional weights, default is 1 (equal weighting). Useful to find for example what percent of people have an x score (at or) below a given value. |
or.tied |
Default is TRUE which means percentile represents what fraction have x at or below value, not just below value. |
na.rm |
Logical, optional, TRUE by default. Should NA values (missing data) be removed first to get percentile of those with valid (nonmissing) data. |
make.bin.pctile.cols()
and assign.pctiles()
get.pctile(89:95, 1:100)
get.pctile(89:95, 1:100, c(rep(1,90), rep(10000,10)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.