hazsurv.plot: Hazard and survival plots

hazsurv.plotR Documentation

Hazard and survival plots

Description

This function produces either a survival or hazard plot.

Usage


hazsurv.plot(x, eq, newdata, type = "surv", t.range = NULL, t.vec = NULL, 
             intervals = TRUE, n.sim = 100, prob.lev = 0.05, shade = FALSE, 
             bars = FALSE, ylim, ylab, xlab, pch, ls = 100, baseline = FALSE,
             min.dn = 1e-200, min.pr = 1e-200, max.pr = 1, plot.out = TRUE, 
             print.progress = TRUE, ...)



Arguments

x

A fitted gamlss/gjrm object.

eq

Equation number. This can be ignored for univariate models.

newdata

A data frame or list containing the values of the model covariates at which predictions are required. This must always be provided.

For the individual survival/hazard/cumulative hazard function, the data frame must have one row containing the values of the model covariates corresponding to the individual of interest.

For the (sub-)population survival/hazard/cumulative hazard function, the data frame must have as many rows as there are individuals in the (sub-)population of interest. Each row must contain the values of the model covariates of the corresponding individual.

type

The plot to produce, either "surv", "hazard" or "cumhaz". In the excess hazard setting these are, respectively, the net survival, the excess hazard and the cumulative excess hazard.

t.range

Time variable range to be considered for plotting. This must be a vector with only two elements: the minimum and maximum of the time range. If NULL then it is determined automatically based on the observed data.

t.vec

Vector of time values to be considered for plotting. This could also be a single time. Note you cannot provide both t.range and t.vec as they are two mutually exclusive ways of defining the time variable. If NULL then it is determined automatically based on the observed data.

intervals

If TRUE then intervals are also produced.

n.sim

Number of simulated coefficient vectors from the posterior distribution of the estimated model parameters. This is used for interval calculations.

prob.lev

Overall probability of the left and right tails of the probabilities' distributions used for interval calculations.

shade

If TRUE then it produces shaded regions as confidence bands.

bars

If TRUE then the confidence intervals are plotted as bars rather than continuous curves. If t.vec is used and only one time value is provided, this is the only possible plotting option for the confidence intervals. Note shade and bars are mutually exclusive.

ylim, ylab, xlab, pch

Usual plot arguments.

ls

Length of sequence to use for time variable.

baseline

If baseline is desired; this will set all covariate/smooth effects to zero.

min.dn, min.pr, max.pr

Allowed minimum and maximum for estimated probabities and densities for survival, hazard and cumulative hazard calculations.

plot.out

If FALSE then the function does not produce a plot. The default is TRUE.

print.progress

If FALSE then the function does not print progress made. The default is TRUE.

...

Other arguments to pass to plot.

Value

It produces a plot or set of plots.

Author(s)

Maintainer: Giampiero Marra giampiero.marra@ucl.ac.uk


GJRM documentation built on July 9, 2023, 7:15 p.m.