Skip to contents

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.

Usage

if_qri(y, weights = NULL, type = 6)

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–9 or HD for Harrell–Davis (default: 6) See csquantile documentation for a complete description.

Value

A numeric vector of influence function values (one for each observation)

Details

The influence function for the QRI is computed on each observation as $$ \widehat{z}_i = - \int_0^1 \frac{ \left( \frac{\frac{p}{2} - \mathbf{1}(y_i \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_i \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.

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

Other influence functions: if_gini(), if_qsr(), if_quantile()

Examples


# On synthetic data
eq_synth <- rlnorm(30, 9, 0.7)
IF_synth <- if_qri(y = eq_synth)

# On real data
eq <- synthouse$eq_income[1:30] ## Take some observations (as example)
w <- synthouse$weight[1:30]
IF_qri <- if_qri(y = eq, weights = w, type = 6)