Skip to content

Commit

Permalink
Merge pull request #18 from cyk0315/master
Browse files Browse the repository at this point in the history
Fix: error in anova
  • Loading branch information
jinseob2kim authored Feb 15, 2024
2 parents d08fdac + cb1f212 commit efdfc30
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: jstable
Title: Create Tables from Different Types of Regression
Version: 1.1.5
Date: 2024-02-02
Version: 1.1.6
Date: 2024-02-15
Authors@R: c(person("Jinseob", "Kim", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9403-605X")),
person("Zarathu", role = c("cph", "fnd")),
person("Yoonkyoung","Jeon", role = c("aut"))
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# jstable 1.1.6

* Bugfix `TableSubgroupGLM`: thanks for `weisx2022`

# jstable 1.1.5

* Bugfix `TableSubgroupCox`: thanks for `ciciing`
Expand Down
10 changes: 7 additions & 3 deletions R/forestglm.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,13 @@ TableSubgroupGLM <- function(formula, var_subgroup = NULL, var_cov = NULL, data,
coefficients()
pv_int <- round(pvs_int[nrow(pvs_int), ncol(pvs_int)], decimal.pvalue)
# if (!is.null(xlev) & length(xlev[[1]]) != 2) stop("Categorical independent variable must have 2 levels.")
model.int <- survey::svyglm(as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep = ""), deparse(formula))), design = data, family = family.svyglm)


data.design<-data
if(family=='binomial'){
model.int <- survey::svyglm(as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep = ""), deparse(formula))), design = data.design, family = quasibinomial())
}
else{
model.int <- survey::svyglm(as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep = ""), deparse(formula))), design = data.design, family = gaussian())
}
if (sum(grepl(":", names(coef(model.int)))) > 1) {
pv_anova <- anova(model.int, method = "Wald")
pv_int <- round(pv_anova[[length(pv_anova)]][[7]], decimal.pvalue)
Expand Down

0 comments on commit efdfc30

Please sign in to comment.