Learn R Programming

NonProbEst (version 0.2.4)

valliant_weights: Calculates Valliant weights

Description

Computes weights from propensity estimates using the 1/pi_i formula introduced in Valliant (2019).

Usage

valliant_weights(propensities)

Arguments

propensities

A vector with the propensities associated to the elements of the convenience sample.

Value

A vector with the corresponding weights.

Details

The function takes the vector of propensities \(\pi(x)\) and calculates the weights to be applied in the Hajek estimator using the formula that can be found in Valliant (2019). For an individual i, weight is calculated as follows: $$w_i = 1/\pi_i (x)$$

References

Valliant, R. (2019). Comparing Alternatives for Estimation from Nonprobability Samples. Journal of Survey Statistics and Methodology, smz003, https://doi.org/10.1093/jssam/smz003

Examples

Run this code
# NOT RUN {
covariates = c("education_primaria", "education_secundaria")
data_propensities = propensities(sampleNP, sampleP, covariates)
valliant_weights(data_propensities$convenience)
# }

Run the code above in your browser using DataLab