Skip to content

Commit

Permalink
Merge pull request #60 from sl-eeper/master
Browse files Browse the repository at this point in the history
fix complete data for jsmodule
  • Loading branch information
jinseob2kim authored Dec 4, 2024
2 parents 0185055 + 5cd2541 commit 1ce0712
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/forestglm.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data,
if (any(class(data) == "survey.design")) {
### survey data인 경우 ###
vars_in_formula <- all.vars(as.formula(formula))
complete_data <- data$variables[complete.cases(data$variables[, vars_in_formula]), ]
complete_data <- data$variables[complete.cases(dplyr::select(data$variables, all_of(vars_in_formula))), ]
data$variables[[var_subgroup]] %>%
table() %>%
names() -> label_val
Expand Down Expand Up @@ -290,7 +290,7 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data,
Count <- as.vector(table(complete_data[[var_subgroup]]))
} else {
vars_in_formula <- all.vars(as.formula(formula))
complete_data <- data[complete.cases(data[, vars_in_formula]), ]
complete_data <- data[complete.cases(dplyr::select(data, all_of(vars_in_formula))), ]
data %>%
subset(!is.na(get(var_subgroup))) %>%
group_split(get(var_subgroup)) %>%
Expand Down Expand Up @@ -417,7 +417,7 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data,

if (is_mixed_effect) {
vars_in_formula <- all.vars(as.formula(formula))
complete_data <- data[complete.cases(data[, vars_in_formula]), ]
complete_data <- data[complete.cases(dplyr::select(data, all_of(vars_in_formula))), ]
model <- data %>%
subset(!is.na(get(var_subgroup))) %>%
group_split(get(var_subgroup)) %>%
Expand Down

0 comments on commit 1ce0712

Please sign in to comment.