jinseob2kim / jstable
Showing 1 of 3 files from the diff.
Other files ignored by Codecov
NEWS.md has changed.
NAMESPACE has changed.

@@ -38,7 +38,7 @@
Loading
38 38
#' @importFrom magrittr %>%
39 39
#' @importFrom tibble tibble
40 40
#' @importFrom survival coxph
41 -
#' @importFrom survey svycoxph
41 +
#' @importFrom survey svycoxph regTermTest
42 42
#' @importFrom stats confint coefficients
43 43
#' @importFrom utils tail
44 44
@@ -116,18 +116,15 @@
Loading
116 116
      label_val %>% purrr::map(~possible_svycoxph(formula, design = subset(data, get(var_subgroup) == .), x = TRUE)) -> model
117 117
      xlev <- survey::svycoxph(formula, design = data)$xlevels
118 118
      xlabel <- names(attr(model[[which(!is.na(model))[1]]]$x, "contrast"))[1]
119 -
      pvs_int <- possible_svycoxph(as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep=""), deparse(formula))), design = data) %>% summary %>% coefficients
119 +
      pvs_int <- possible_svycoxph(as.formula(gsub(xlabel, paste0(xlabel, "*", var_subgroup), deparse(formula))), design = data) %>% summary %>% coefficients
120 120
      pv_int <- round(pvs_int[nrow(pvs_int), ncol(pvs_int)], decimal.pvalue)
121 121
      if (!is.null(xlev) & length(xlev[[1]]) != 2) stop("Categorical independent variable must have 2 levels.")
122 122
      
123 123
      
124 124
      if (length(label_val) > 2){
125 -
        data.int <- data$variables
126 -
        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)
127 -
        model.int$call$formula <- as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep=""), deparse(formula)))
128 -
        model.int$call$data <- as.name("data.int")
129 -
        pv_anova <- anova(model.int)
130 -
        pv_int <- pv_anova[nrow(pv_anova), 4]
125 +
        model.int <- survey::svycoxph(as.formula(gsub(xlabel, paste0(xlabel, "*", var_subgroup), deparse(formula))), design = data)
126 +
        pv_anova <- survey::regTermTest(model.int, as.formula(paste0("~", xlabel, ":", var_subgroup)))
127 +
        pv_int <- round(pv_anova$p[1], decimal.pvalue)
131 128
      }
132 129
      res.kap <- purrr::map(label_val, ~survey::svykm(formula.km, design = subset(data, get(var_subgroup) == . )))
133 130
      mkz <- function(reskap){
@@ -142,13 +139,13 @@
Loading
142 139
      data %>% filter(!is.na(get(var_subgroup))) %>% select(var_subgroup) %>% table %>% names -> label_val
143 140
      xlev <- survival::coxph(formula, data = data)$xlevels
144 141
      xlabel <- names(attr(model[[which(!is.na(model))[1]]]$x, "contrast"))[1]
145 -
      model.int <- possible_coxph(as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep=""), deparse(formula))), data = data)  
142 +
      model.int <- possible_coxph(as.formula(gsub(xlabel, paste0(xlabel, "*", var_subgroup), deparse(formula))), data = data)  
146 143
      pvs_int <- model.int %>% summary %>% coefficients
147 144
      pv_int <- round(pvs_int[nrow(pvs_int), ncol(pvs_int)], decimal.pvalue)
148 145
      if (!is.null(xlev) & length(xlev[[1]]) != 2) stop("Categorical independent variable must have 2 levels.")
149 146
      
150 147
      if (length(label_val) > 2){
151 -
        model.int$call$formula <- as.formula(gsub(xlabel, paste(xlabel, "*", var_subgroup, sep=""), deparse(formula)))
148 +
        model.int$call$formula <- as.formula(gsub(xlabel, paste0(xlabel, "*", var_subgroup), deparse(formula)))
152 149
        model.int$call$data <- as.name("data")
153 150
        pv_anova <- anova(model.int)
154 151
        pv_int <- round(pv_anova[nrow(pv_anova), 4], decimal.pvalue)
Files Coverage
R 84.87%
Project Totals (13 files) 84.87%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading