Skip to content

Commit

Permalink
update multisurvival, hide advanced functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalci committed Dec 4, 2023
1 parent b3380d4 commit 8e919e6
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 197 deletions.
87 changes: 5 additions & 82 deletions R/multisurvival.h.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
uselandmark = FALSE,
landmark = 3,
hr = FALSE,
sty = "t1",
km = FALSE,
endplot = 60,
byplot = 12,
ci95 = FALSE,
risktable = FALSE,
censored = FALSE,
pplot = TRUE, ...) {
sty = "t1", ...) {

super$initialize(
package="ClinicoPath",
Expand Down Expand Up @@ -157,34 +150,6 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
"t1",
"t3"),
default="t1")
private$..km <- jmvcore::OptionBool$new(
"km",
km,
default=FALSE)
private$..endplot <- jmvcore::OptionInteger$new(
"endplot",
endplot,
default=60)
private$..byplot <- jmvcore::OptionInteger$new(
"byplot",
byplot,
default=12)
private$..ci95 <- jmvcore::OptionBool$new(
"ci95",
ci95,
default=FALSE)
private$..risktable <- jmvcore::OptionBool$new(
"risktable",
risktable,
default=FALSE)
private$..censored <- jmvcore::OptionBool$new(
"censored",
censored,
default=FALSE)
private$..pplot <- jmvcore::OptionBool$new(
"pplot",
pplot,
default=TRUE)

self$.addOption(private$..elapsedtime)
self$.addOption(private$..tint)
Expand All @@ -206,13 +171,6 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
self$.addOption(private$..landmark)
self$.addOption(private$..hr)
self$.addOption(private$..sty)
self$.addOption(private$..km)
self$.addOption(private$..endplot)
self$.addOption(private$..byplot)
self$.addOption(private$..ci95)
self$.addOption(private$..risktable)
self$.addOption(private$..censored)
self$.addOption(private$..pplot)
}),
active = list(
elapsedtime = function() private$..elapsedtime$value,
Expand All @@ -234,14 +192,7 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
uselandmark = function() private$..uselandmark$value,
landmark = function() private$..landmark$value,
hr = function() private$..hr$value,
sty = function() private$..sty$value,
km = function() private$..km$value,
endplot = function() private$..endplot$value,
byplot = function() private$..byplot$value,
ci95 = function() private$..ci95$value,
risktable = function() private$..risktable$value,
censored = function() private$..censored$value,
pplot = function() private$..pplot$value),
sty = function() private$..sty$value),
private = list(
..elapsedtime = NA,
..tint = NA,
Expand All @@ -262,14 +213,7 @@ multisurvivalOptions <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Cla
..uselandmark = NA,
..landmark = NA,
..hr = NA,
..sty = NA,
..km = NA,
..endplot = NA,
..byplot = NA,
..ci95 = NA,
..risktable = NA,
..censored = NA,
..pplot = NA)
..sty = NA)
)

multisurvivalResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
Expand Down Expand Up @@ -498,13 +442,6 @@ multisurvivalBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
#' @param landmark .
#' @param hr .
#' @param sty .
#' @param km .
#' @param endplot .
#' @param byplot .
#' @param ci95 .
#' @param risktable .
#' @param censored .
#' @param pplot .
#' @return A results object containing:
#' \tabular{llllll}{
#' \code{results$todo} \tab \tab \tab \tab \tab a html \cr
Expand Down Expand Up @@ -539,14 +476,7 @@ multisurvival <- function(
uselandmark = FALSE,
landmark = 3,
hr = FALSE,
sty = "t1",
km = FALSE,
endplot = 60,
byplot = 12,
ci95 = FALSE,
risktable = FALSE,
censored = FALSE,
pplot = TRUE) {
sty = "t1") {

if ( ! requireNamespace("jmvcore", quietly=TRUE))
stop("multisurvival requires jmvcore to be installed (restart may be required)")
Expand Down Expand Up @@ -589,14 +519,7 @@ multisurvival <- function(
uselandmark = uselandmark,
landmark = landmark,
hr = hr,
sty = sty,
km = km,
endplot = endplot,
byplot = byplot,
ci95 = ci95,
risktable = risktable,
censored = censored,
pplot = pplot)
sty = sty)

analysis <- multisurvivalClass$new(
options = options,
Expand Down
65 changes: 29 additions & 36 deletions jamovi/multisurvival.a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ options:
permitted: [ numeric ]





- name: multievent
title: Multiple Event Levels
type: Bool
Expand Down Expand Up @@ -161,16 +158,11 @@ options:
type: Integer
default: 3





- name: hr
title: Hazards Regression Plot
type: Bool
default: false


- name: sty
title: Plot Style
type: List
Expand All @@ -183,10 +175,11 @@ options:
name: t3
default: t1

- name: km
title: Kaplan-Meier
type: Bool
default: false

# - name: km
# title: Kaplan-Meier
# type: Bool
# default: false


# - name: ac
Expand All @@ -202,36 +195,36 @@ options:
# permitted: [ factor ]


- name: endplot
title: Plot End Time
type: Integer
default: 60
# - name: endplot
# title: Plot End Time
# type: Integer
# default: 60


- name: byplot
title: Time Interval
type: Integer
default: 12
# - name: byplot
# title: Time Interval
# type: Integer
# default: 12

- name: ci95
title: '95% CI'
type: Bool
default: false
# - name: ci95
# title: '95% CI'
# type: Bool
# default: false

- name: risktable
title: risktable
type: Bool
default: false
# - name: risktable
# title: risktable
# type: Bool
# default: false

- name: censored
title: censored
type: Bool
default: false
# - name: censored
# title: censored
# type: Bool
# default: false

- name: pplot
title: p-value
type: Bool
default: true
# - name: pplot
# title: p-value
# type: Bool
# default: true

# - name: calculatedtime
# title: Add Calculated Time to Data
Expand Down
Loading

0 comments on commit 8e919e6

Please sign in to comment.