survey_IQR | R Documentation |
Calculates the interquartile range from complex survey data.
A wrapper for taking differences of svyquantile
at 0.25 and 0.75 quantiles,
and meant to be called from within summarize
(see srvyr package).
survey_IQR(x, na.rm = TRUE)
x |
A variable or expression |
na.rm |
logical, if |
a vector of interquartile ranges
Tom Elliott
library(survey)
library(srvyr)
data(api)
dstrata <- apistrat %>%
as_survey(strata = stype, weights = pw)
dstrata %>%
summarise(api99_iqr = survey_IQR(api99))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.