diff --git a/CRAN-RELEASE b/CRAN-RELEASE deleted file mode 100644 index ca245aa..0000000 --- a/CRAN-RELEASE +++ /dev/null @@ -1,2 +0,0 @@ -This package was submitted to CRAN on 2020-11-26. -Once it is accepted, delete this file and tag the release (commit f1f2c35). diff --git a/DESCRIPTION b/DESCRIPTION index 74cb446..8f2954f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "jinseob2kim@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9403-605X")), person("Zarathu", role = c("cph", "fnd")) ) @@ -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: diff --git a/NAMESPACE b/NAMESPACE index 1d796a6..b4f9659 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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,":=") diff --git a/NEWS.md b/NEWS.md index ee3a631..54a16a5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. diff --git a/R/forestcox.R b/R/forestcox.R index e7cb616..1bda754 100644 --- a/R/forestcox.R +++ b/R/forestcox.R @@ -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){ @@ -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){ @@ -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