Skip to content

Commit

Permalink
fix: had incorrectly split variables for glm_ipd
Browse files Browse the repository at this point in the history
  • Loading branch information
timcadman committed Apr 12, 2024
1 parent 9c92f26 commit e244243
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions R/pool.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ poolCheckArgs <- function(imputed_glm, type, coh_names, family, exponentiate){
family = family,
coh_names = coh_names,
direction = "wide",
ci_format = "separate")
ci_format = "separate",
digits = 20)
)

if(type == "glm_slma"){
Expand Down Expand Up @@ -144,17 +145,16 @@ poolCheckArgs <- function(imputed_glm, type, coh_names, family, exponentiate){
splitCoefs <- function(tidied_coefs, type, coh_names){

cohort <- variable <- NULL

if (type == "glm_ipd"){
tidied_coefs <- tidied_coefs %>%
mutate(., cohort = coh_names)
}

if(type == "glm_slma"){
split_coefs <- tidied_coefs %>%
group_by(cohort, variable) %>%
group_split()

} else if (type == "glm_ipd"){
split_coefs <- list(tidied_coefs) %>%
map(~mutate(., cohort = coh_names))
}


return(split_coefs)

}
Expand Down

0 comments on commit e244243

Please sign in to comment.