plot.icweib: Plot estimated survival function

Description Usage Arguments Details Value See Also Examples

View source: R/plot.icweib.R

Description

This function plots the estimated survival function along with associated pointwise 95% confidence intervals corresponding to the input strata and values of explanatory variables.

Usage

1
2
3
## S3 method for class 'icweib'
plot(x, strata = NULL, Z = NULL, tRange = NULL,
  tEst = NULL, ...)

Arguments

x

output returned by icweib function.

strata

the vector of strata for which the survival function is estimated and plotted. The default is NULL, corresponding to all strata.

Z

the vector of values of explanatory variables for which the survival function is estimated and plotted. The order and length should match the estimated coefficients as shown in x$coef. The default is NULL, corresponding to all 0 or baseline.

tRange

the range of time to plot. It should be in the format of c(t1, t2), which means that the range of time is t1 to t2. The default is NULL, corresponding to 0 to maximum observed time in the data.

tEst

the vector of times at which the survival function along with associated pointwise 95% confidence internval is estimated and output. The default is NULL, which means no estimated survival function is output.

...

arguments of plot function except col and lty. For example, the axis labels and title of the plot can be specified.

Details

The survival function and associated pointwise 95% confidence intervals are estimated for input values of time and covariates.

Value

If tEst is specified, then a dataframe of estimated survival function along with 95% confidence interval is returned.

See Also

icweib plot

Examples

1
2
3
4
data(tooth24)
fit <- icweib(L = left, R = right, data = tooth24, strata = dmf, covariates = ~sex)
surv <- plot(fit, Z = 1, tRange = c(1, 7), tEst=1:7, xlab = "Time", ylab = "Survival Function",
             main = "Estimated survival function for sex = 1 (girls)")

straweib documentation built on Jan. 11, 2020, 9:11 a.m.