R: Royston/Parmar spline survival distribution functions

Survsplinek {flexsurv} | R Documentation

## Royston/Parmar spline survival distribution functions

### Description

Probability density, distribution, quantile, random generation, hazard, cumulative hazard, mean and restricted mean functions for the Royston/Parmar spline model, with one argument per parameter. For the equivalent functions with all parameters collected together in a single argument, see `Survspline`.

### Usage

    mean_survspline0(
      gamma0,
      gamma1,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log"
    )

    mean_survspline1(
      gamma0,
      gamma1,
      gamma2,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log"
    )

    mean_survspline2(
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log"
    )

    mean_survspline3(
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log"
    )

    mean_survspline4(
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log"
    )

    mean_survspline5(
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log"
    )

    mean_survspline6(
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log"
    )

    mean_survspline7(
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      gamma8,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log"
    )

    rmst_survspline0(
      t,
      gamma0,
      gamma1,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log",
      start = 0
    )

    rmst_survspline1(
      t,
      gamma0,
      gamma1,
      gamma2,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log",
      start = 0
    )

    rmst_survspline2(
      t,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log",
      start = 0
    )

    rmst_survspline3(
      t,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log",
      start = 0
    )

    rmst_survspline4(
      t,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log",
      start = 0
    )

    rmst_survspline5(
      t,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log",
      start = 0
    )

    rmst_survspline6(
      t,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log",
      start = 0
    )

    rmst_survspline7(
      t,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      gamma8,
      knots = c(-10, 10),
      scale = "hazard",
      timescale = "log",
      start = 0
    )

    dsurvspline0(
      x,
      gamma0,
      gamma1,
      knots,
      scale = "hazard",
      timescale = "log",
      log = FALSE
    )

    dsurvspline1(
      x,
      gamma0,
      gamma1,
      gamma2,
      knots,
      scale = "hazard",
      timescale = "log",
      log = FALSE
    )

    dsurvspline2(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      knots,
      scale = "hazard",
      timescale = "log",
      log = FALSE
    )

    dsurvspline3(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      knots,
      scale = "hazard",
      timescale = "log",
      log = FALSE
    )

    dsurvspline4(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      knots,
      scale = "hazard",
      timescale = "log",
      log = FALSE
    )

    dsurvspline5(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      knots,
      scale = "hazard",
      timescale = "log",
      log = FALSE
    )

    dsurvspline6(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      knots,
      scale = "hazard",
      timescale = "log",
      log = FALSE
    )

    dsurvspline7(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      gamma8,
      knots,
      scale = "hazard",
      timescale = "log",
      log = FALSE
    )

    psurvspline0(
      q,
      gamma0,
      gamma1,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    psurvspline1(
      q,
      gamma0,
      gamma1,
      gamma2,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    psurvspline2(
      q,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    psurvspline3(
      q,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    psurvspline4(
      q,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    psurvspline5(
      q,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    psurvspline6(
      q,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    psurvspline7(
      q,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      gamma8,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    qsurvspline0(
      p,
      gamma0,
      gamma1,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    qsurvspline1(
      p,
      gamma0,
      gamma1,
      gamma2,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    qsurvspline2(
      p,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    qsurvspline3(
      p,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    qsurvspline4(
      p,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    qsurvspline5(
      p,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    qsurvspline6(
      p,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    qsurvspline7(
      p,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      gamma8,
      knots,
      scale = "hazard",
      timescale = "log",
      lower.tail = TRUE,
      log.p = FALSE
    )

    rsurvspline0(n, gamma0, gamma1, knots, scale = "hazard", timescale = "log")

    rsurvspline1(
      n,
      gamma0,
      gamma1,
      gamma2,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    rsurvspline2(
      n,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    rsurvspline3(
      n,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    rsurvspline4(
      n,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    rsurvspline5(
      n,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    rsurvspline6(
      n,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    rsurvspline7(
      n,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      gamma8,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    hsurvspline0(x, gamma0, gamma1, knots, scale = "hazard", timescale = "log")

    hsurvspline1(
      x,
      gamma0,
      gamma1,
      gamma2,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    hsurvspline2(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    hsurvspline3(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    hsurvspline4(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    hsurvspline5(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    hsurvspline6(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    hsurvspline7(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      gamma8,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    Hsurvspline0(x, gamma0, gamma1, knots, scale = "hazard", timescale = "log")

    Hsurvspline1(
      x,
      gamma0,
      gamma1,
      gamma2,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    Hsurvspline2(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    Hsurvspline3(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    Hsurvspline4(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    Hsurvspline5(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    Hsurvspline6(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      knots,
      scale = "hazard",
      timescale = "log"
    )

    Hsurvspline7(
      x,
      gamma0,
      gamma1,
      gamma2,
      gamma3,
      gamma4,
      gamma5,
      gamma6,
      gamma7,
      gamma8,
      knots,
      scale = "hazard",
      timescale = "log"
    )

### Arguments

`gamma0, gamma1, gamma2, gamma3, gamma4, gamma5, gamma6, gamma7, gamma8` | Parameters describing the baseline spline function, as described in `flexsurvspline`.
`knots` | Locations of knots on the axis of log time, supplied in increasing order. Unlike in `flexsurvspline`, these include the two boundary knots. If there are no additional knots, the boundary locations are not used. If there are one or more additional knots, the boundary knots should be at or beyond the minimum and maximum values of the log times. In `flexsurvspline` these are exactly at the minimum and maximum values. This may in principle be supplied as a matrix, in the same way as for `gamma`, but in most applications the knots will be fixed.
`scale` | `"hazard"`, `"odds"`, or `"normal"`, as described in `flexsurvspline`. With the default of no knots in addition to the boundaries, this model reduces to the Weibull, log-logistic and log-normal respectively. The scale must be common to all times.
`timescale` | `"log"` or `"identity"` as described in `flexsurvspline`.
`t` | Vector of times.
`start` | Optional left-truncation time or times. The returned restricted mean survival will be conditioned on survival up to this time.
`x` | Vector of times.
`log` | Return log density or probability.
`q` | Vector of times.
`lower.tail` | logical; if TRUE (default), probabilities are P(X <= x), otherwise, P(X > x).
`log.p` | Return log density or probability.
`p` | Vector of probabilities.
`n` | Number of random numbers to simulate.

### Details

These functions go up to 7 spline knots, or 9 parameters. If you'd like higher-dimension versions, just submit an issue at https://github.com/chjackson/flexsurv-dev/issues.

### Author(s)

Christopher Jackson <chris.jackson@mrc-bsu.cam.ac.uk>

[Package flexsurv version 2.0 Index]