MyNixOS website logo
Description

Survival Prediction with Multi-Task Logistic Regression.

An implementation of Multi-Task Logistic Regression (MTLR) for R. This package is based on the method proposed by Yu et al. (2011) which utilized MTLR for generating individual survival curves by learning feature weights which vary across time. This model was further extended to account for left and interval censored data.

MTLR

Build Status codecov

The goal of MTLR is to provide an R implementation for Multi-Task Logistic Regression. In addition to supplying the model provided by Yu et al. we have extended the model for left censoring, interval censoring, and a mixture of censoring types. Functionality includes training an MTLR model, predicting survival curves for new observations, and plotting these survival curves and feature weights estimated by MTLR.

Installation

You can install the version from CRAN or the development version from GitHub:

# CRAN:
install.packages("MTLR")

# GitHub:
# install.packages("devtools")
devtools::install_github("haiderstats/MTLR")

Example

Given a survival dataset containing event time and event status indicator (censored/uncensored) we can produce an MTLR model. For example, consider the lung dataset from the survival package:

# Load survival for the lung dataset and the Surv() function.
library(survival)
#Here we will use 9 intervals (10 time points) just for plotting purposes. 
#The default is sqrt the number of observations.
mod <- mtlr(Surv(time,status)~., data = lung, nintervals = 9)
print(mod)
#> 
#> Call:  mtlr(formula = Surv(time, status) ~ ., data = lung, nintervals = 9) 
#> 
#> Time points:
#>  [1]  62.3 145.4 179.3 210.4 241.4 284.5 308.2 383.5 476.3 642.8
#> 
#> 
#> Weights:
#>           Bias      inst      age      sex ph.ecog ph.karno pat.karno meal.cal  wt.loss
#> 62.27   0.1147 -0.017981  0.04891 -0.01249 0.00461 -0.00648   0.01352 -0.02617 -0.01325
#> 145.36  0.1362 -0.021147  0.03275 -0.00473 0.02312 -0.02227  -0.01753 -0.01105 -0.02974
#> 179.27  0.2119 -0.008203  0.02260 -0.02564 0.02394 -0.02046  -0.03161 -0.02310 -0.02218
#> 210.36  0.0398  0.000359  0.00816 -0.03638 0.04704 -0.02230  -0.04129 -0.01410 -0.03367
#> 241.36 -0.0996  0.009570 -0.01581 -0.04405 0.06690 -0.04139  -0.05453 -0.00808 -0.01288
#> 284.55 -0.2299  0.004869 -0.00476 -0.05180 0.04824 -0.02107  -0.03135  0.00237 -0.02552
#> 308.18 -0.3012 -0.007743 -0.00467 -0.05426 0.04908 -0.02280  -0.03264 -0.01608  0.02130
#> 383.45 -0.0289 -0.019985 -0.01030 -0.03263 0.02868 -0.00680  -0.02321 -0.01458 -0.00235
#> 476.27 -0.1285 -0.010232  0.00106 -0.02226 0.01715  0.01699  -0.01555 -0.02112 -0.01587
#> 642.82 -0.3513 -0.014975  0.02291 -0.02548 0.01847  0.00556  -0.00856  0.00373 -0.00552
#Plot feature weights:
plot(mod)
#Get survival curves for the lung dataset:
curves <- predict(mod)
#Plot the first 20 survival curves:
plotcurves(curves, 1:20)
Metadata

Version

0.2.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • 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