Skip to contents

Creates waterfall and spider plots to visualize tumor response data following RECIST criteria

Value

A list containing plot object and summary statistics

Super classes

jmvcore::Analysis -> ClinicoPathDescriptives::waterfallBase -> waterfallClass

Examples

data <- data.frame(
  PatientID = paste0("PT", 1:10),
  Response = c(-100, -45, -30, -20, -10, 0, 10, 20, 30, 40),
  Time = c(1,2,3,4,5,6,7,8,9,10)
)
waterfall(data, "PatientID", "Response", "Time")
#> 
#>  TREATMENT RESPONSE ANALYSIS
#> 
#>  Response Categories Based on RECIST v1.1 Criteria 
#>  ───────────────────────────────────────────────── 
#>    Category    Number of Patients    Percentage   
#>  ───────────────────────────────────────────────── 
#>    CR     ᵃ                     1           10%   
#>    PR     ᵇ                     2           20%   
#>    SD     ᵈ                     5           50%   
#>    PD     ᵉ                     2           20%   
#>  ───────────────────────────────────────────────── 
#>    ᵃ Complete Response (CR): Complete
#>    disappearance of all target lesions.
#>    ᵇ Partial Response (PR): At least 30%
#>    decrease in sum of target lesions.
#>    ᵈ Stable Disease (SD): Neither PR nor PD
#>    criteria met.
#>    ᵉ Progressive Disease (PD): At least 20%
#>    increase in sum of target lesions.
#> 
#> 
#>  Clinical Response Metrics                    
#>  ──────────────────────────────────────────── 
#>    Metric                             Value   
#>  ──────────────────────────────────────────── 
#>    Objective Response Rate (CR+PR)    30%     
#>    Disease Control Rate (CR+PR+SD)    80%     
#>  ──────────────────────────────────────────── 
#> 
#> $data
#> $data$waterfall
#> # A tibble: 10 × 5
#>    PatientID Response  Time response category
#>    <chr>        <dbl> <dbl>    <dbl> <fct>   
#>  1 PT1           -100     1     -100 CR      
#>  2 PT2            -45     2      -45 PR      
#>  3 PT3            -30     3      -30 PR      
#>  4 PT4            -20     4      -20 SD      
#>  5 PT5            -10     5      -10 SD      
#>  6 PT6              0     6        0 SD      
#>  7 PT7             10     7       10 SD      
#>  8 PT8             20     8       20 SD      
#>  9 PT9             30     9       30 PD      
#> 10 PT10            40    10       40 PD      
#> 
#> $data$spider
#>    PatientID Response Time response
#> 1        PT1     -100    1     -100
#> 2        PT2      -45    2      -45
#> 3        PT3      -30    3      -30
#> 4        PT4      -20    4      -20
#> 5        PT5      -10    5      -10
#> 6        PT6        0    6        0
#> 7        PT7       10    7       10
#> 8        PT8       20    8       20
#> 9        PT9       30    9       30
#> 10      PT10       40   10       40
#> 
#> 
#> $data_waterfall
#> # A tibble: 10 × 5
#>    PatientID Response  Time response category
#>    <chr>        <dbl> <dbl>    <dbl> <fct>   
#>  1 PT1           -100     1     -100 CR      
#>  2 PT2            -45     2      -45 PR      
#>  3 PT3            -30     3      -30 PR      
#>  4 PT4            -20     4      -20 SD      
#>  5 PT5            -10     5      -10 SD      
#>  6 PT6              0     6        0 SD      
#>  7 PT7             10     7       10 SD      
#>  8 PT8             20     8       20 SD      
#>  9 PT9             30     9       30 PD      
#> 10 PT10            40    10       40 PD      
#> 
#> $data_spider
#>    PatientID Response Time response
#> 1        PT1     -100    1     -100
#> 2        PT2      -45    2      -45
#> 3        PT3      -30    3      -30
#> 4        PT4      -20    4      -20
#> 5        PT5      -10    5      -10
#> 6        PT6        0    6        0
#> 7        PT7       10    7       10
#> 8        PT8       20    8       20
#> 9        PT9       30    9       30
#> 10      PT10       40   10       40
#> 
#> $options
#> $options$patientID
#> [1] "PatientID"
#> 
#> $options$response
#> [1] "Response"
#> 
#> $options$timeVar
#> [1] "Time"
#> 
#> $options$sortBy
#> [1] "response"
#> 
#> $options$showThresholds
#> [1] FALSE
#> 
#> $options$labelOutliers
#> [1] FALSE
#> 
#> $options$colorScheme
#> [1] "jamovi"
#> 
#> $options$barWidth
#> [1] 0.7
#> 
#> $options$barAlpha
#> [1] 1
#> 
#> $options$showMedian
#> [1] FALSE
#> 
#> $options$showCI
#> [1] FALSE
#> 
#> $options$minResponseForLabel
#> [1] 50
#> 
#> 
#> $metrics
#> $metrics$summary
#>    category n percent
#> CR       CR 1      10
#> PR       PR 2      20
#> SD       SD 5      50
#> PD       PD 2      20
#> 
#> $metrics$ORR
#> [1] 30
#> 
#> $metrics$DCR
#> [1] 80
#>