Description Usage Arguments Details Value References Examples
Computes weights from propensity estimates using the 1/pi_i formula introduced in Valliant (2019).
1 |
propensities |
A vector with the propensities associated to the elements of the convenience sample. |
The function takes the vector of propensities π(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/π_i (x)
A vector with the corresponding weights.
Valliant, R. (2019). Comparing Alternatives for Estimation from Nonprobability Samples. Journal of Survey Statistics and Methodology, smz003, https://doi.org/10.1093/jssam/smz003
1 2 3 | covariates = c("education_primaria", "education_secundaria")
data_propensities = propensities(sampleNP, sampleP, covariates)
valliant_weights(data_propensities$convenience)
|
Loading required package: lattice
Loading required package: ggplot2
[1] 2.095137 1.821317 2.057692 2.095137 2.057692 2.095137 1.821317 2.057692
[9] 2.057692 1.821317 2.057692 1.821317 2.095137 1.821317 1.821317 1.821317
[17] 2.095137 2.095137 1.821317 2.095137 1.821317 1.821317 1.821317 1.821317
[25] 1.821317 2.057692 2.057692 2.095137 2.057692 1.821317 2.095137 2.095137
[33] 2.095137 2.095137 2.095137 1.821317 2.095137 2.057692 1.821317 2.095137
[41] 2.095137 1.821317 1.821317 1.821317 1.821317 2.095137 2.095137 2.057692
[49] 1.821317 1.821317 1.821317 2.095137 1.821317 2.057692 2.095137 1.821317
[57] 2.095137 2.095137 1.821317 2.095137 2.095137 2.095137 1.821317 2.095137
[65] 2.095137 2.095137 2.057692 1.821317 2.095137 1.821317 2.095137 2.095137
[73] 2.095137 1.821317 1.821317 2.095137 2.057692 2.095137 2.057692 1.821317
[81] 2.095137 2.057692 1.821317 2.095137 2.057692 2.095137 2.057692 1.821317
[89] 2.095137 2.095137 2.095137 2.095137 1.821317 2.095137 1.821317 2.095137
[97] 2.095137 1.821317 2.095137 1.821317 1.821317 2.095137 2.057692 2.095137
[105] 2.095137 1.821317 2.095137 2.095137 2.057692 2.095137 2.095137 1.821317
[113] 1.821317 2.095137 2.095137 2.095137 2.057692 2.057692 2.095137 2.095137
[121] 2.095137 1.821317 1.821317 2.095137 2.095137 1.821317 2.095137 2.095137
[129] 2.095137 2.057692 2.095137 2.095137 1.821317 2.057692 2.095137 2.095137
[137] 2.057692 2.095137 2.095137 2.095137 2.095137 2.095137 2.057692 1.821317
[145] 2.095137 1.821317 1.821317 1.821317 1.821317 2.057692 2.057692 1.821317
[153] 2.095137 2.095137 2.095137 1.821317 2.095137 2.095137 1.821317 2.095137
[161] 2.095137 2.057692 2.057692 2.057692 2.057692 2.057692 2.057692 2.095137
[169] 2.057692 2.095137 1.821317 2.057692 2.057692 1.821317 1.821317 2.095137
[177] 1.821317 2.095137 2.095137 2.057692 2.095137 1.821317 2.095137 2.095137
[185] 1.821317 2.095137 2.057692 1.821317 2.095137 2.057692 2.095137 2.057692
[193] 2.095137 2.095137 2.095137 2.095137 2.095137 2.095137 1.821317 1.821317
[201] 1.821317 2.095137 2.095137 2.095137 1.821317 2.095137 1.821317 2.095137
[209] 2.057692 1.821317 2.095137 1.821317 2.057692 2.057692 2.095137 1.821317
[217] 1.821317 2.095137 1.821317 2.095137 2.095137 2.095137 1.821317 1.821317
[225] 2.095137 2.095137 1.821317 1.821317 2.095137 2.095137 2.095137 1.821317
[233] 2.057692 1.821317 2.095137 2.057692 2.057692 1.821317 2.095137 1.821317
[241] 1.821317 1.821317 2.095137 2.057692 2.095137 2.095137 1.821317 2.057692
[249] 1.821317 2.057692 1.821317 2.095137 2.095137 2.095137 2.095137 2.095137
[257] 1.821317 2.057692 2.057692 1.821317 2.057692 1.821317 1.821317 2.095137
[265] 2.057692 1.821317 2.057692 1.821317 2.095137 2.095137 2.057692 2.057692
[273] 2.057692 1.821317 2.095137 2.057692 2.095137 2.095137 2.095137 2.057692
[281] 2.095137 2.057692 1.821317 2.057692 2.057692 2.095137 2.057692 1.821317
[289] 2.095137 1.821317 2.095137 2.057692 2.095137 1.821317 1.821317 2.057692
[297] 1.821317 2.095137 1.821317 2.095137 2.057692 2.095137 2.057692 2.095137
[305] 2.095137 2.095137 2.095137 2.095137 2.057692 1.821317 1.821317 2.095137
[313] 2.057692 1.821317 2.057692 2.057692 2.095137 2.095137 2.095137 1.821317
[321] 1.821317 1.821317 2.057692 2.057692 2.095137 2.095137 1.821317 2.095137
[329] 2.095137 2.095137 2.095137 1.821317 1.821317 2.095137 1.821317 2.095137
[337] 1.821317 2.057692 2.057692 2.095137 2.095137 1.821317 2.095137 2.095137
[345] 2.095137 2.095137 1.821317 2.095137 2.057692 2.095137 2.095137 1.821317
[353] 1.821317 2.095137 1.821317 2.095137 1.821317 2.095137 2.057692 2.095137
[361] 2.095137 1.821317 2.095137 1.821317 2.095137 2.095137 1.821317 2.095137
[369] 1.821317 1.821317 2.095137 1.821317 1.821317 2.095137 2.057692 2.095137
[377] 2.095137 1.821317 1.821317 2.057692 2.057692 2.095137 2.057692 2.095137
[385] 2.095137 2.095137 2.095137 1.821317 1.821317 2.095137 2.095137 2.095137
[393] 2.095137 2.057692 1.821317 2.057692 1.821317 1.821317 2.095137 2.095137
[401] 2.057692 1.821317 2.057692 1.821317 2.095137 1.821317 2.095137 1.821317
[409] 2.057692 2.095137 1.821317 2.057692 1.821317 2.095137 2.095137 1.821317
[417] 1.821317 2.095137 2.095137 2.057692 1.821317 2.057692 2.057692 2.095137
[425] 2.057692 1.821317 2.095137 1.821317 1.821317 2.095137 2.095137 2.057692
[433] 2.095137 2.095137 2.095137 2.057692 2.095137 1.821317 2.095137 2.095137
[441] 2.095137 2.095137 2.057692 2.095137 2.057692 2.095137 1.821317 1.821317
[449] 2.095137 2.057692 2.095137 1.821317 1.821317 2.095137 2.095137 2.095137
[457] 1.821317 2.057692 1.821317 2.057692 2.057692 2.095137 1.821317 2.095137
[465] 1.821317 1.821317 1.821317 2.057692 1.821317 2.095137 2.057692 2.095137
[473] 2.095137 1.821317 2.095137 2.095137 2.095137 2.095137 2.057692 2.095137
[481] 2.057692 2.095137 1.821317 2.057692 2.095137 2.057692 2.057692 2.057692
[489] 1.821317 2.057692 2.095137 2.057692 1.821317 1.821317 2.057692 2.095137
[497] 2.095137 1.821317 2.095137 2.095137 2.057692 2.095137 1.821317 1.821317
[505] 2.095137 2.057692 1.821317 2.095137 1.821317 2.095137 2.095137 2.095137
[513] 2.057692 1.821317 1.821317 1.821317 2.057692 2.095137 2.057692 2.095137
[521] 1.821317 2.057692 1.821317 2.095137 2.095137 2.095137 2.095137 1.821317
[529] 1.821317 2.057692 2.095137 2.095137 2.095137 2.095137 2.057692 2.095137
[537] 2.057692 2.095137 2.095137 2.095137 2.095137 1.821317 2.095137 2.057692
[545] 2.095137 2.095137 1.821317 2.057692 2.095137 2.095137 2.095137 2.095137
[553] 2.095137 1.821317 2.095137 2.057692 1.821317 2.095137 2.057692 1.821317
[561] 2.095137 1.821317 2.095137 1.821317 2.095137 2.057692 2.095137 2.095137
[569] 2.057692 1.821317 2.095137 2.095137 1.821317 2.057692 2.095137 2.095137
[577] 2.095137 2.057692 2.057692 2.095137 2.057692 2.095137 2.095137 1.821317
[585] 2.095137 2.095137 1.821317 1.821317 2.057692 2.057692 2.095137 1.821317
[593] 2.057692 2.095137 2.057692 1.821317 2.095137 2.095137 2.095137 2.095137
[601] 2.095137 1.821317 2.095137 2.057692 2.095137 2.057692 1.821317 1.821317
[609] 2.095137 2.095137 2.057692 2.057692 1.821317 1.821317 1.821317 1.821317
[617] 1.821317 2.095137 2.057692 2.095137 2.057692 2.095137 2.095137 1.821317
[625] 2.095137 2.057692 2.057692 2.095137 2.057692 2.095137 1.821317 1.821317
[633] 2.095137 1.821317 2.095137 2.095137 2.095137 2.057692 2.095137 1.821317
[641] 1.821317 2.095137 2.095137 2.095137 2.095137 2.095137 2.057692 2.095137
[649] 2.057692 2.057692 1.821317 1.821317 2.095137 2.057692 2.057692 1.821317
[657] 2.057692 2.095137 1.821317 1.821317 1.821317 2.095137 2.095137 2.095137
[665] 2.057692 2.057692 1.821317 2.057692 2.057692 1.821317 1.821317 2.095137
[673] 1.821317 2.095137 1.821317 1.821317 2.057692 1.821317 2.095137 2.095137
[681] 2.095137 1.821317 2.095137 1.821317 1.821317 2.095137 1.821317 1.821317
[689] 2.095137 2.095137 2.057692 1.821317 2.057692 2.057692 2.095137 2.095137
[697] 2.095137 1.821317 2.057692 2.095137 1.821317 1.821317 2.095137 1.821317
[705] 2.095137 2.095137 2.095137 2.057692 1.821317 2.095137 2.095137 1.821317
[713] 2.095137 1.821317 2.057692 2.095137 2.057692 2.057692 1.821317 1.821317
[721] 2.057692 2.057692 1.821317 2.095137 2.095137 2.095137 2.095137 2.095137
[729] 1.821317 2.095137 2.095137 2.095137 2.057692 2.095137 1.821317 1.821317
[737] 2.057692 2.057692 2.095137 2.095137 2.095137 2.095137 1.821317 2.095137
[745] 2.095137 2.095137 2.095137 2.057692 1.821317 2.057692 1.821317 1.821317
[753] 1.821317 1.821317 1.821317 2.095137 1.821317 2.095137 2.095137 2.095137
[761] 1.821317 1.821317 1.821317 2.095137 2.057692 2.057692 2.057692 1.821317
[769] 2.095137 2.095137 1.821317 2.095137 1.821317 2.095137 1.821317 2.095137
[777] 2.095137 2.057692 1.821317 2.095137 2.095137 2.057692 2.095137 2.095137
[785] 2.095137 1.821317 1.821317 2.057692 1.821317 1.821317 1.821317 2.057692
[793] 2.057692 2.095137 2.057692 1.821317 1.821317 1.821317 2.057692 1.821317
[801] 1.821317 1.821317 2.057692 2.095137 1.821317 1.821317 1.821317 2.095137
[809] 1.821317 2.095137 2.095137 2.095137 2.095137 2.095137 2.095137 2.057692
[817] 1.821317 1.821317 2.095137 1.821317 1.821317 2.057692 2.095137 1.821317
[825] 1.821317 1.821317 2.095137 2.095137 2.095137 2.095137 1.821317 2.095137
[833] 2.095137 1.821317 2.095137 2.057692 2.095137 1.821317 1.821317 1.821317
[841] 2.057692 2.095137 2.095137 2.095137 2.095137 2.095137 2.095137 2.057692
[849] 1.821317 2.057692 2.095137 2.095137 2.095137 1.821317 2.057692 2.095137
[857] 2.095137 1.821317 1.821317 2.095137 2.095137 2.057692 2.095137 1.821317
[865] 2.057692 2.095137 1.821317 2.057692 2.095137 1.821317 2.057692 2.057692
[873] 2.095137 1.821317 2.095137 2.095137 1.821317 1.821317 2.095137 2.095137
[881] 2.095137 2.057692 2.095137 2.095137 2.095137 2.057692 1.821317 2.095137
[889] 2.095137 1.821317 2.095137 1.821317 2.095137 2.057692 1.821317 2.057692
[897] 1.821317 2.095137 2.095137 2.057692 2.095137 1.821317 1.821317 2.095137
[905] 2.057692 2.095137 2.057692 2.095137 2.095137 1.821317 2.095137 1.821317
[913] 1.821317 2.057692 1.821317 1.821317 2.095137 1.821317 2.095137 2.095137
[921] 2.057692 2.095137 1.821317 1.821317 2.095137 2.095137 2.095137 2.095137
[929] 2.095137 1.821317 1.821317 2.095137 1.821317 2.095137 2.095137 2.057692
[937] 1.821317 2.057692 2.095137 2.095137 2.095137 2.095137 1.821317 2.095137
[945] 2.095137 2.057692 2.095137 1.821317 2.095137 2.095137 1.821317 2.095137
[953] 2.095137 2.095137 1.821317 2.095137 2.095137 2.057692 2.095137 2.095137
[961] 2.095137 1.821317 2.095137 2.095137 1.821317 2.095137 2.095137 2.095137
[969] 2.095137 2.095137 2.057692 1.821317 1.821317 2.095137 1.821317 2.095137
[977] 2.095137 2.095137 1.821317 2.095137 2.057692 2.095137 2.095137 2.095137
[985] 2.095137 2.095137 1.821317 2.095137 1.821317 2.057692 1.821317 2.095137
[993] 2.095137 1.821317 1.821317 2.095137 2.095137 1.821317 1.821317 2.095137
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.