senate_weights() computes senate weights. These weights are used often to include more than one country with different sample size, yet to scale their weight to a common total.
Source:R/senate_weights.R
senate_weights.Rdsenate_weights() computes senate weights. These weights are used often to include more than one country with different sample size, yet to scale their weight to a common total.
Details
a collection of dplyr::mutate sequences to create normalized and effective sample weights (see Rabe-Hesketh & Skrondal, 2006; Snijder & Bosker, 2012)
Examples
library(dplyr)
#> Error in library(dplyr): there is no package called ‘dplyr’
data_frame_with_weights <- data_frame %>%
r4sda::senate_weights(.,
scale = 1000,
wt = 'wt',
id_k = 'id_k')
#> Error in data_frame %>% r4sda::senate_weights(., scale = 1000, wt = "wt", id_k = "id_k"): could not find function "%>%"