Skip to content

Commit

Permalink
fix kaplan meier p val in cmp anal
Browse files Browse the repository at this point in the history
  • Loading branch information
sl-eeper committed Dec 11, 2024
1 parent 18b3843 commit 47299de
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: jsmodule
Title: 'RStudio' Addins and 'Shiny' Modules for Medical Research
Version: 1.5.9
Date: 2024-09-29
Version: 1.5.10
Date: 2024-12-11
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 @@ -10,7 +10,8 @@ Authors@R: c(
person("Jinhwan", "Kim", email = "[email protected]", role = c("aut"), comment = c(ORCID = "0009-0009-3217-2417")),
person("Yoonkyoung", "Jeon", email = "[email protected]", role = c("aut")),
person("Jaewoong", "Heo", email = "[email protected]", role = c("aut")),
person("Youngsun", "Park", email = "[email protected]", role = c("aut"), comment = c(ORCID = "0009-0009-9336-2281")))
person("Youngsun", "Park", email = "[email protected]", role = c("aut"), comment = c(ORCID = "0009-0009-9336-2281")),
person("Hyungwoo", "Jo", email = "[email protected]", role = c("aut")))
Description: 'RStudio' addins and 'Shiny' modules for descriptive statistics, regression and survival analysis.
Depends: R (>= 3.4.0)
License: Apache License 2.0
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# jsmodule 1.5.10
## Update
- Add competing risk analysis in subgroup, Kaplan-meier, regression tab.

# jsmodule 1.5.9
## Bugfix:
- `sav` file load in `FilePSInput.R`, `FileRepeatedInput.R`, `FileSurveyInput.R`
Expand Down
18 changes: 7 additions & 11 deletions R/kaplan.R
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,10 @@ kaplanModule <- function(input, output, session, data, data_label, data_varStruc
data.km[[input$event_km]] <- as.numeric(as.vector(data.km[[input$event_km]]))
if(input$cmp_risk_check){
req(!is.null(input$cmp_event_km))
print(data.km %>% head())
print(input$event_km)
print('passing')
data.km[[input$cmp_event_km]]<- as.numeric(as.vector(data.km[[input$cmp_event_km]]))
data.km[[input$cmp_event_km]] <- as.numeric(as.vector(data.km[[input$cmp_event_km]]))
data.km$cmpp_time <- with(data.km, ifelse(data.km[[input$event_km]]==0, data.km[[input$cmp_time_km]], data.km[[input$time_km]]))
data.km$cmpp_event <- with(data.km, ifelse(data.km[[input$event_km]]==0, 2*data.km[[input$cmp_event_km]], 1))
print('passed')
print(data.km %>% head())
data.km$cmpp_event <- factor(data.km$cmpp_event, 0:2, labels=c("zero", "cmp", "cmprsk"))
}
if (input$subcheck == T) {
validate(
Expand Down Expand Up @@ -691,19 +687,19 @@ kaplanModule <- function(input, output, session, data, data_label, data_varStruc

if (is.null(design.survey)) {
status_cmprsk <- NULL
print(res.km)
print(data.km %>% head(., n= 50))
if (input$cmp_risk_check) {
status_cmprsk <- '1'
status_cmprsk <- 'cmp'
}
if (is.null(id.cluster)) {

if(input$cmp_risk_check){
return(
jskm::jskm(res.km,
pval = input$pval, marks = input$marks, table = input$table, ylab = ylab, ystrataname = yst.name, ystratalabs = yst.lab, ci = input$ci, timeby = input$timeby, xlims = input$xlims, ylims = input$ylims,
cumhaz = input$cumhaz, cluster.option = "None", cluster.var = NULL, data = data.km, pval.coord = pval.coord, legendposition = legend.p, linecols = pal, xlabs = text.x, dashed = dashed, cut.landmark = cut.landmark,
showpercent = input$showpercent, surv.scale = surv.scale, status.cmprsk = status_cmprsk
)
)
))

} else {
return(
jskm::jskm(res.km,
Expand Down

0 comments on commit 47299de

Please sign in to comment.