Computes the influence function of the quantile ratio index (QRI) in the context of finite population for all observations, as defined in Scarpa et al. (2025) , under simple and complex sampling. See Deville (1999) for an introduction to the definition of influence function in finite population theory.
Arguments
- y
A numeric vector of data values
- weights
A numeric vector of sampling weights (optional). If
NULL, equal weights are assumed.- type
Quantile estimation type: integer
4–9or"HD"for Harrell–Davis (default:6). Seecsquantile.- na.rm
Logical. Should missing values be removed? Default is
TRUE.
Value
A numeric vector of influence function values (one per observation),
returned in the same order as the input y.
Details
The influence function for the QRI is computed on each observation as $$ {I}(\widehat{QRI})_{k} = - \int_0^1 \frac{ \left( \frac{\frac{p}{2} - \mathbf{1}(y_k \leq \widehat{Q}(p/2))} {\widehat{f}(\widehat{Q}(p/2)) \, \widehat{N}} \right) \widehat{Q}(1 - p/2) - \left( \frac{(1 - \frac{p}{2}) - \mathbf{1}(y_k \leq \widehat{Q}(1 - p/2))} {\widehat{f}(\widehat{Q}(1 - p/2)) \, \widehat{N}} \right) \widehat{Q}(p/2) }{ \widehat{Q}(1 - p/2)^2 } \, dp $$
where:
\(\widehat{Q}(p)\) is the weighted sample quantile of order \(p\), computed using the internal function
csquantile(),\(\widehat{f}(\cdot)\) denotes the estimated income density function,
\(\widehat{N} = \sum_i w_i\) is the estimated population size, where \( w_i\) is the sampling weight associated to the \(i\)-th individual.
The density function \(\widehat{f}(y)\) is estimated via a Gaussian kernel smoother: $$ \widehat{f}(y) = \frac{1}{\widehat{N}} \sum_{j \in s} w_j K\!\left(\frac{y - y_j}{h}\right) = \frac{1}{\widehat{N}\, h \sqrt{2\pi}} \sum_{j \in s} w_j \exp\!\left\{ -\frac{(y - y_j)^2}{2h^2} \right\}, $$ where \(K(\cdot)\) is the Gaussian kernel.
The bandwidth is chosen as: $$ h = 0.79 \cdot \mathrm{IQR} \cdot \widehat{N}^{-1/5}, $$ where \(\mathrm{IQR}\) is the interquartile range of the weighted sample.
References
Deville J (1999). “Variance estimation for complex statistics and estimators: linearization and residual techniques.” Survey methodology, 25, 193–204.
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 for the QRI inequality indicator estimator, csquantile
for weighted quantile estimation.
Other influence functions:
if_gini(),
if_quantile(),
if_ratio_quantiles(),
if_share_ratio()