vd_weights {NonProbEst} | R Documentation |
Calculates Valliant and Dever weights
Description
Computes weights from propensity estimates using the propensity stratification 1/p_i averaging formula introduced in Valliant and Dever (2011).
Usage
vd_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. |
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 Valliant and Dever (2019). 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(g_i)}{ \sum_{k \in g_i} \pi_k (x)}
where g_i
represents the strata to which i belongs, and n(g_i)
is the number of individuals in the g_i
strata.
Value
A vector with the corresponding weights.
References
Valliant, R., & Dever, J. A. (2011). Estimating propensity adjustments for volunteer web surveys. Sociological Methods & Research, 40(1), 105-137.
Cochran, W. G. (1968). The Effectiveness of Adjustment by Subclassification in Removing Bias in Observational Studies. Biometrics, 24(2), 295-313
Examples
covariates = c("education_primaria", "education_secundaria")
data_propensities = propensities(sampleNP, sampleP, covariates)
vd_weights(data_propensities$convenience, data_propensities$reference)