SurvivalProcessingPipeline: Survival data procesing

Description Super class Methods

Description

Survival data procesing

Survival data procesing

Super class

ukcovidtools::PassthroughFilesystemCache -> SurvivalProcessingPipeline

Methods

Public methods

Inherited methods

Method new()

Usage
SurvivalProcessingPipeline$new(providerController, ...)

Method generateSurvivalData()

generate survival data and right censored data from

Usage
SurvivalProcessingPipeline$generateSurvivalData(
  df,
  idVar,
  startDateVar,
  endDateExpr,
  statusExpr = if_else(is.na({     {         endDateExpr     } }), 0, 1),
  censoredDateExpr = max({     {         endDateExpr     } }, na.rm = TRUE),
  ageVar = "age",
  ageBreaks = c(-Inf, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80,
    Inf),
  ageLabels = c("0-4", "5-9", "10-14", "15-19", "20-24", "25-29", "30-34", "35-39",
    "40-44", "45-49", "50-54", "55-59", "60-64", "65-69", "70-74", "75-79", "80+"),
  ageReferenceCat = NA_character_,
  statusLabels = c("censored", "died")
)
Arguments
path

- path to the ff100 file

Returns

data set in survival format including status, time, left, right, ageCat columns


Method generateNoAgeSurvivalData()

Usage
SurvivalProcessingPipeline$generateNoAgeSurvivalData(
  df,
  idVar,
  startDateVar,
  endDateExpr,
  statusExpr = if_else(is.na({     {         endDateExpr     } }), 0, 1),
  censoredDateExpr = max({     {         endDateExpr     } }, na.rm = TRUE),
  statusLabels = c("censored", "died")
)

Method getMaxDate()

Usage
SurvivalProcessingPipeline$getMaxDate(df, dateCols)

Method transitionMatrix()

generate transition matrix with enquoted tidy column sepecifications

Usage
SurvivalProcessingPipeline$transitionMatrix(...)
Arguments
...

a set of mappings

Returns

a transistion matrix


Method generateMultistateSurvivalData()

generate survival data and right censored data from a multistate model

Usage
SurvivalProcessingPipeline$generateMultistateSurvivalData(
  df,
  idVar,
  transMatrix,
  ageVar = "age",
  censoringDateExpr = getMaxDate(df, dateCols),
  startDateCol = names(allowableTransitions)[1],
  ageBreaks = c(-Inf, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80,
    Inf),
  ageLabels = c("0-4", "5-9", "10-14", "15-19", "20-24", "25-29", "30-34", "35-39",
    "40-44", "45-49", "50-54", "55-59", "60-64", "65-69", "70-74", "75-79", "80+"),
  ageReferenceCat = NA_character_,
  ...
)
Arguments
path

- path to the ff100 file

Returns

data set in survival format including status, time, left, right, ageCat columns


Method createSurvivalSurfaces()

for a set of model parameters, calculate the distributions and median

Usage
SurvivalProcessingPipeline$createSurvivalSurfaces(
  modelParameterDf,
  days = 30,
  timepoints = seq(0.1, days, length.out = 100)
)
Arguments
modelParameterDf

- a data frame set of parameters for a range of models as param, value columns

days

- the time frame of the prediction

Returns

an dataframe of ageCat and time varying surfaces, including pdfs, cdfs and medians, with high and low estimates


Method plotSurvivalSurface()

plot a survival surface as a CDF

Usage
SurvivalProcessingPipeline$plotSurvivalSurface(surfacesDf, distr)
Arguments
surfacesDf

- an dataframe of ageCat and time varying surfaces, including pdfs, cdfs and medians, with high and low estimates

distr

- a single distribution to plot

Returns

a plot of the survival surface (1-cdf)


Method plotIncidenceSurface()

plot a survival surface as a PDF

Usage
SurvivalProcessingPipeline$plotIncidenceSurface(surfacesDf, distr)
Arguments
surfacesDf

- an dataframe of ageCat and time varying surfaces, including pdfs, cdfs and medians, with high and low estimates

distr

- a single distribution to plot

Returns

a plot of the survival surface as pdf


Method plotProbabilityMatrix()

Usage
SurvivalProcessingPipeline$plotProbabilityMatrix(
  surfacesDf,
  distr,
  pExpr = "p"
)

Method clone()

The objects of this class are cloneable with this method.

Usage
SurvivalProcessingPipeline$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


terminological/uk-covid-datatools documentation built on June 24, 2021, 8:16 p.m.