lsa_weights | R Documentation |
lsa_weights() computes normalized and effective sample size weights for pseudo maximum likelihood mixed models, with large scale assessment data
lsa_weights(data, id_i, id_j, id_k, wt, wi, wj)
data |
data frame object which contains the rest of the arguments |
id_i |
a numeric vector of a single variable |
id_j |
a numeric vector of a single variable |
id_k |
a numeric vector of a single variable |
wt |
observations final weight |
wi |
observations weigth within the primary sampling unit (i.e. students eight within the school) |
wj |
cluster weights (i.e. school weights) |
a collection of dplyr::mutate sequences to create normalized and effective sample weights (see Rabe-Hesketh & Skrondal, 2006; Snijder & Bosker, 2012)
the original data frame with the new weights at the end, where 'wa1' nad 'wa2' are level 1 and level 2 normalized weights; 'wb1' nad 'wb2' are level 1 and level 2 effectives sample weights.
library(dplyr)
data_frame_with_weights <- data_frame %>%
r4sda::lsa_weights(.,
id_i = 'id_i',
id_j = 'id_j',
id_k = 'id_k',
wt = 'wt',
wi = 'wi',
wj = 'wj' )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.