Skip to content

Commit 4c156cb

Browse files
committed
zs
1 parent 25203d1 commit 4c156cb

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

Diff for: DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: jsmodule
22
Title: 'RStudio' Addins and 'Shiny' Modules for Medical Research
3-
Version: 1.0.3
4-
Date: 2019-11-12
3+
Version: 1.0.4
4+
Date: 2019-11-21
55
Authors@R: c(person("Jinseob", "Kim", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9403-605X")),
66
person("Zarathu", role = c("cph", "fnd"))
77
)

Diff for: NEWS.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# jsmodule 1.0.4
2+
3+
## Bug fixes
4+
5+
* **Cox model** of Basic statistics module.
6+
17
# jsmodule 1.0.3
28

39
## Bug fixes

Diff for: R/coxph.R

+7-2
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,11 @@ coxModule <- function(input, output, session, data, data_label, data_varStruct =
183183
function(v){
184184
if (is.null(id.cluster)){
185185
forms <- as.formula(paste("survival::Surv(", input$time_cox, ",", input$event_cox, ") ~ ", v, sep = ""))
186+
coef <- tryCatch(summary(survival::coxph(forms, data = data.cox))$coefficients, error = function(e){return(NULL)})
186187
} else{
187188
forms <- as.formula(paste("survival::Surv(", input$time_cox, ",", input$event_cox, ") ~ ", v, " + cluster(", id.cluster(), ")", sep = ""))
189+
coef <- tryCatch(summary(survival::coxph(forms, data = data.cox, robust = T))$coefficients, error = function(e){return(NULL)})
188190
}
189-
coef <- tryCatch(summary(survival::coxph(forms, data = data.cox, robust = T))$coefficients, error = function(e){return(NULL)})
190191
sigOK <- ifelse(is.null(coef), F, !all(coef[, "Pr(>|z|)"] > 0.05))
191192
return(sigOK)
192193
})
@@ -324,7 +325,11 @@ coxModule <- function(input, output, session, data, data_label, data_varStruct =
324325
)
325326

326327
if (is.null(design.survey)){
327-
cc <- substitute(survival::coxph(.form, data= data.cox, model = T, robust = T), list(.form= form.cox()))
328+
if (is.null(id.cluster)){
329+
cc <- substitute(survival::coxph(.form, data= data.cox, model = T), list(.form= form.cox()))
330+
} else{
331+
cc <- substitute(survival::coxph(.form, data= data.cox, model = T, robust = T), list(.form= form.cox()))
332+
}
328333
res.cox <- eval(cc)
329334
tb.cox <- jstable::cox2.display(res.cox, dec = input$decimal)
330335
tb.cox <- jstable::LabeljsCox(tb.cox, ref = label.regress)

0 commit comments

Comments
 (0)