Skip to content

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseob2kim committed Jun 24, 2021
1 parent c5bcd88 commit 9418241
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 0 additions & 2 deletions CRAN-RELEASE

This file was deleted.

6 changes: 3 additions & 3 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.0.2
Date: 2021-03-13
Version: 1.0.3
Date: 2021-06-24
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"))
)
Expand All @@ -11,7 +11,7 @@ License: Apache License 2.0
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
Imports: geepack, lme4, stats, data.table, labelled, tableone, coxme, survival (>= 3.0.0), survey, methods, dplyr, purrr, magrittr, tibble, car
Imports: geepack, lme4, stats, data.table, labelled, tableone, coxme, survival (>= 3.0.0), survey, methods, dplyr, purrr, magrittr, tibble
URL: https://github.com/jinseob2kim/jstable
BugReports: https://github.com/jinseob2kim/jstable/issues
Suggests:
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export(svyCreateTableOne2)
export(svyCreateTableOneJS)
export(svycox.display)
export(svyregress.display)
importFrom(car,Anova)
importFrom(coxme,coxme)
importFrom(coxme,fixef)
importFrom(data.table,":=")
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# jstable 1.0.3

* Remove dependency with `car` packages



# jstable 1.0.2

* Bugfix `CreateTableOneJS`, `svyCreateTableOneJS`: when with labeldata, variables other than numeric or factor types are excluded.
Expand Down
9 changes: 4 additions & 5 deletions R/forestcox.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#' @importFrom survival coxph
#' @importFrom survey svycoxph
#' @importFrom stats confint coefficients
#' @importFrom car Anova
#' @importFrom utils tail

TableSubgroupCox <- function(formula, var_subgroup = NULL, var_cov = NULL, data, time_eventrate = 3 * 365, decimal.hr = 2, decimal.percent = 1, decimal.pvalue = 3){
Expand Down Expand Up @@ -127,8 +126,8 @@ TableSubgroupCox <- function(formula, var_subgroup = NULL, var_cov = NULL, data,
model.int <- survival::coxph(as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep=""), deparse(formula))), data = data.int, weights = get(names(data$allprob)), robust =T)
model.int$call$formula <- as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep=""), deparse(formula)))
model.int$call$data <- as.name("data.int")
pv_anova <- car::Anova(model.int, test.statistics = "Wald")
pv_int <- pv_anova[nrow(pv_anova), 3]
pv_anova <- anova(model.int)
pv_int <- pv_anova[nrow(pv_anova), 4]
}
res.kap <- purrr::map(label_val, ~survey::svykm(formula.km, design = subset(data, get(var_subgroup) == . )))
mkz <- function(reskap){
Expand All @@ -151,8 +150,8 @@ TableSubgroupCox <- function(formula, var_subgroup = NULL, var_cov = NULL, data,
if (length(label_val) > 2){
model.int$call$formula <- as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep=""), deparse(formula)))
model.int$call$data <- as.name("data")
pv_anova <- car::Anova(model.int, test.statistics = "Wald")
pv_int <- round(pv_anova[nrow(pv_anova), 3], decimal.pvalue)
pv_anova <- anova(model.int)
pv_int <- round(pv_anova[nrow(pv_anova), 4], decimal.pvalue)
}
res.kap.times <- data %>% filter(!is.na(get(var_subgroup))) %>% group_split(get(var_subgroup)) %>% purrr::map(~survival::survfit(formula.km, data = .)) %>% purrr::map(~summary(., times = time_eventrate, extend = T))
prop <- res.kap.times %>% purrr::map(~round(100 * (1 - .[["surv"]]), decimal.percent)) %>% dplyr::bind_cols() %>% t
Expand Down

0 comments on commit 9418241

Please sign in to comment.