From 725b631afd2b8d6b397c422979b321379cb9f35a Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 31 Dec 2024 16:14:24 +0100 Subject: [PATCH] fix --- R/rescale_weights.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/rescale_weights.R b/R/rescale_weights.R index be7487f3b..86f4a6835 100644 --- a/R/rescale_weights.R +++ b/R/rescale_weights.R @@ -216,7 +216,7 @@ rescale_weights <- function(data, } # split into groups, and calculate weights - out <- lapply(split(data_tmp, data_tmp$by), function(group_data) { + out <- lapply(split(data_tmp, data_tmp[by]), function(group_data) { p_weights <- group_data[[probability_weights]] # design effect according to Kish deff <- mean(p_weights^2) / (mean(p_weights)^2)