hazsurv.plot: Hazard and survival plots

Description Usage Arguments Value Author(s)

View source: R/hazsurv.plot.r

Description

This function produces either a survival or hazard plot.

Usage

1
2
3
4
5
6
hazsurv.plot(x, eq, newdata, type = "surv", t.range = NULL, intervals = TRUE, 
             n.sim = 100, prob.lev = 0.05, 
             shade = FALSE, ylim, ylab, xlab, ls = 100, baseline = FALSE, 
             pop.name = NULL, pop.min = NULL,  pop.max = NULL, pop.bin = NULL, 
             pop.build = FALSE, pop.grid = 200, 
             min.dn = 1e-200, min.pr = 1e-200, max.pr = 1, ...)

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 have one row and must be provided.

type

The plot to produce, either "surv", "hazard" or "cumhaz".

t.range

Time variable range to be considered for plotting. 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.

ylim, ylab, xlab

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.

pop.name

Variable name with respect to which you want to stratify.

pop.min

Min. value of interval for the stratification variable. If you would like to use an open interval then do not specify a value for pop.max; in this case you would have pop.name > pop.min.

pop.max

Max. value of interval for the stratification variable. For an open interval do not specify pop.min (pop.name < pop.max).

pop.bin

Either 0 or 1. This means pop.name is a binary variable and you want to stratify wrt either 0 or 1. Note that in this case pop.min and pop.max need not be used as the choice of 0 or 1 takes the place of the range of values in a binary setting.

pop.build

The default is FALSE, which is the setting in which the user provides the data. When TRUE we are assuming a setting in which the user provides a fixed set of features and would like the average net survival for an individual whith pop.name in a certain range. Note that pop.bin can not be used in this setting as it would not make sense to do so (we would just have an individual net survival since it does not make sense to build a range of values for a binary variable).

pop.grid

Default values is 200 and it is only used if pop.build == TRUE. It represents the number of rows of the (internally built) dataset. In other terms it is the number of elements forming the sequence of extremities pop.min and pop.max.

min.dn, min.pr, max.pr

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

...

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


KironmoyDas/STAT0035_GJRM documentation built on Jan. 25, 2021, 12:31 a.m.