Skip to content

Commit

Permalink
remove experimental code for now
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 18, 2024
1 parent 5463eb3 commit 456166b
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions R/rescale_weights.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 456166b

Please sign in to comment.