From 456166b6ef8640a0f61b70c8935f510041ae9d7e Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 18 Dec 2024 08:51:46 +0100 Subject: [PATCH] remove experimental code for now --- R/rescale_weights.R | 7 ------- 1 file changed, 7 deletions(-) diff --git a/R/rescale_weights.R b/R/rescale_weights.R index 476916dc6..0c8269baf 100644 --- a/R/rescale_weights.R +++ b/R/rescale_weights.R @@ -142,15 +142,8 @@ rescale_weights <- function(data, .rescale_weights_kish <- function(nest, probability_weights, data_tmp, data, by, weight_non_na) { p_weights <- data_tmp[[probability_weights]] - # design effect according to Kish deff <- mean(p_weights^2) / (mean(p_weights)^2) - - # n_per_group <- as.vector(table(data_tmp[[by]])) - # b_bar <- mean(n_per_group) - # icc <- 0.05 - # deff <- nrow(data_tmp) * (mean(p_weights^2) / (mean(p_weights)^2)) * (1 + (b_bar - 1) * icc) - # rescale weights, so their mean is 1 z_weights <- p_weights * (1 / mean(p_weights)) # divide weights by design effect