'Trying to extract data from repeated univariate logistic regressions on an imputed dataset

I have a variable list var_list which contains the names of variables to test in the univariate regression. I have an multiple imputed dataset which contains the data for the outcome and test variable. The logistic regression equation looks like: outcome ~ X + var4 + var5 where X is each of the var_list variables. The first few lines of the piped code work, i.e. the regression runs for each imputed dataset, but it falls over when I try to pool() the output for each variable and extract the confidence intervals etc. Please help??

var_list <- c("var1", "var2", "var3")

var_list %>% 
str_c("outcome" ~ ",. , "+ var4 + var5") %>%
map(.f = ~with(imputed.df, glmer(as.formula(.x), family=binomial))) %>%
pool() %>%
summary(.x, exp = TRUE, conf.int = TRUE) %>%
bind_rows() %>%
mutate(across(where(is.numeric), round, digits=3))


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source