MyNixOS website logo
Description

Create 'shiny' Applications for Cox Proportional Hazards Models.

Takes one or more fitted Cox proportional hazards models and writes a 'shiny' application to a directory specified by the user. The 'shiny' application displays predicted survival curves based on user input, and contains none of the original data used to create the Cox model or models. The goal is towards visualization and presentation of predicted survival curves.

shinyCox

The goal of shinyCox is to provide a tool for researchers to easily create shiny applications to display one or more Cox model-predicted survival curves. This work was motivated by clinical research to provide an interactive summary of fitted Cox models, make it easy for researchers to generate these summaries for their own research, and to support dissemination by minimizing the use of subject-identifiable data.

Tables of hazard ratios remain an important summary of fitted Cox models, but predicted survival curves can provide a different summary that may be more interpretable to clinicians and patients.

While shiny apps are excellent tools for visualization, development of these apps can be challenging for unfamiliar users. This package allows a user to input their final Cox model(s) into the function shine_coxph() to create a shiny app for the user with minimal additional work required.

The function shine_coxph() initially uses the original data for internal verification purposes, but discards the original data when the app is made, containing only the bare necessities to make predictions (predictions are made in the application using the object returned by prep_coxfit()). When disseminating the final app, subject-identifiable data are not distributed.

Installation

You can install this package using:

install.packages("shinyCox")

You can install the development version of shinyCox from GitHub with:

# install.packages("devtools")
devtools::install_github("harryc598/shinyCox")

Example

Here is an example using multiple treatment arms, which will highlight the usefulness of this package. If you move around the inputs, you can see how for different combinations, one treatment might prevail over the other.

library(shinyCox)
library(survival)
# colon data has two event types, etype 2 is death 
colondeaths <- colon[colon$etype == 2, ]
split_colon <- split(colondeaths, colondeaths$rx)

colon_arm1 <- split_colon$Obs
colon_arm2 <- split_colon$Lev
colon_arm3 <- split_colon$`Lev+5FU`

colon1ph <- coxph(Surv(time, status) ~ factor(extent) + factor(obstruct) + nodes                   + factor(differ), 
                  colon_arm1,
                  x = TRUE, model = TRUE)
colon2ph <- coxph(Surv(time, status) ~ factor(extent) + factor(obstruct) + nodes                   + factor(differ), 
                  colon_arm2,
                  x = TRUE, model = TRUE)
colon3ph <- coxph(Surv(time, status) ~ factor(extent) + factor(obstruct) + nodes                   + factor(differ), 
                  colon_arm3,
                  x = TRUE, model = TRUE)
# This will write a shiny app into whatever your working directory is
# shine_coxph("Obs" = colon1ph, "Lev" = colon2ph, "Lev+5FU" = colon3ph, theme = "dashboard", app.dir = getwd())
Metadata

Version

1.1.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows