Computes the quantile ratio index (QRI) estimator for measuring inequality on simple and complex sampling data
Arguments
- y
A numeric vector of strictly positive values (e.g. income, wealth, expenditure).
- weights
A numeric vector of sampling weights (optional)
- M
Integer, number of quantile ratios to average (default: 100)
- type
Quantile estimation type: integer 4-9 or HD for Harrell-Davis (default: 6). See
csquantiledocumentation for a complete description.- na.rm
Logical, should missing values be removed? (default: TRUE)
Value
A scalar numeric value representing the estimated inequality by the quantile ratio index (QRI).
Details
Consider a random sample \(s\) of size, where \(w_j\), \(j \in s\), defines the sampling weight associated to the \(j\)-th individual. The QRI estimator is defined as:
$$\widehat{QRI} = \frac{1}{M}\sum_{m=1}^M\left(1- \frac{\widehat{Q}(p_{m/2})}{\widehat{Q}(1 - p_{m/2})}\right)$$
where \(p_m = p_m = (m-0.5)/M\).
The estimated quantiles \(\widehat{Q}(p)\) are computed via the function
csquantile(), which accounts for sampling weights and the specified
quantile type. This allows \(\widehat{QRI}\) to be used both for simple
random samples and for complex survey data with design weights.
This index was proposed by Prendergast and Staudte (2018) , and extended to survey data by Scarpa et al. (2025) .
References
Prendergast LA, Staudte RG (2018). “A simple and effective inequality measure.” The American Statistician, 72, 328–343.
Scarpa S, Ferrante MR, Sperlich S (2025). “Inference for the quantile ratio inequality index in the context of survey data.” Journal of Survey Statistics and Methodology. doi:10.1093/jssam/smaf024 .
See also
qri_grouped for QRI estimation from pre-aggregated (grouped/binned) data,
superpop_qri for the theoretical QRI of a parametric distribution,
if_qri for the influence function used in variance estimation.
Other inequality indicators based on quantiles:
inequantiles(),
palma_ratio(),
plot_inequality_curve(),
qsr(),
ratio_quantiles()
Examples
data(synthouse)
eq <- synthouse$eq_income ### Income data
# Compute unweighted QRI with default type 6 quantile estimator
qri(y = eq)
#> [1] 0.5611575
# Consider the sampling weights and change quantile estimation type
w <- synthouse$weight
qri(y = eq, weights = w, type = 5)
#> [1] 0.5690882
# Compare QRI across macro-regions (NUTS1)
tapply(1:nrow(synthouse), synthouse$NUTS1, function(area) {
qri(y = synthouse$eq_income[area],
weights = synthouse$weight[area],
type = 6)
})
#> C N NE NO S
#> 0.5847404 0.5639082 0.5691184 0.5796789 0.5601799