Learn R Programming

NonProbEst (version 0.2.4)

lee_weights: Calculates Lee weights

Description

Computes weights from propensity estimates using the propensity stratification design weights averaging formula introduced in Lee (2006) and Lee and Valliant (2009).

Usage

lee_weights(convenience_propensities, reference_propensities, g = 5)

Arguments

convenience_propensities

A vector with the propensities associated with the convenience sample.

reference_propensities

A vector with the propensities associated with the reference sample.

g

The number of strata to use; by default, its value is 5.

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 Horvitz-Thompson estimator using the formula that can be found in Lee (2006) and Lee and Valliant (2009). The vector of propensities is divided in g strata (ideally five according to Cochran, 1968) aiming to have individuals with similar propensities in each strata. After the stratification, weight is calculated as follows for an individual i: $$w_i = \frac{n_r(g_i) / n_r}{n_v(g_i) / n_v}$$ where \(g_i\) represents the strata to which i belongs, \(n_r (g_i)\) and \(n_v (g_i)\) are the number of individuals in the \(g_i\) strata from the reference and the convenience sample respectively, and \(n_r\) and \(n_v\) are the sample sizes for the reference and the convenience sample respectively.

References

Lee, S. (2006). Propensity score adjustment as a weighting scheme for volunteer panel web surveys. Journal of official statistics, 22(2), 329.

Lee, S., & Valliant, R. (2009). Estimation for volunteer panel web surveys using propensity score adjustment and calibration adjustment. Sociological Methods & Research, 37(3), 319-343.

Cochran, W. G. (1968). The Effectiveness of Adjustment by Subclassification in Removing Bias in Observational Studies. Biometrics, 24(2), 295-313

Examples

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

Run the code above in your browser using DataLab