Skip to content

Commit

Permalink
Apply automatic stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 24, 2024
1 parent 07813a5 commit c7054e1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/forestglm.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data,
model <- stats::glm(formula, data = data, x = T, family = family)
# if (!is.null(model$xlevels) & length(model$xlevels[[1]]) != 2) stop("Categorical independent variable must have 2 levels.")
}

xlev <- NA
if (length(model$xlevels[[xlabel]]) > 0){
if (length(model$xlevels[[xlabel]]) > 0) {
xlev <- model$xlevels[[xlabel]]
}

Expand Down Expand Up @@ -168,10 +168,10 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data,
names() -> label_val
label_val %>% purrr::map(~ possible_svyglm(formula, design = subset(data, get(var_subgroup) == .), x = TRUE, family = family.svyglm)) -> model
xlev <- NA
if (length(survey::svyglm(formula, design = data)$xlevels[[xlabel]]) > 0){
if (length(survey::svyglm(formula, design = data)$xlevels[[xlabel]]) > 0) {
xlev <- survey::svyglm(formula, design = data)$xlevels[[xlabel]]
}

# pv_int 구하기
pv_int <- tryCatch(
{
Expand Down Expand Up @@ -217,9 +217,9 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data,
select(dplyr::all_of(var_subgroup)) %>%
table() %>%
names() -> label_val

xlev <- NA
if (length(stats::glm(formula, data = data, family = family)$xlevels[[xlabel]]) > 0){
if (length(stats::glm(formula, data = data, family = family)$xlevels[[xlabel]]) > 0) {
xlev <- stats::glm(formula, data = data, family = family)$xlevels[[xlabel]]
}
model.int <- possible_glm(as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep = ""), deparse(formula))), data = data, family = family)
Expand Down

0 comments on commit c7054e1

Please sign in to comment.