plot.tsriadditive {tsriadditive} | R Documentation |
Plotting Predicted Survival Function or Cumulative Incidence Function with Pointwise Confidence Intervals
Description
The function will plot the predicted survival function when fitting a survival model and the predicted cumulative incidence function when fitting a competing risks model. Corresponding pointwise confidence intervals at level alpha are also included.
Usage
## S3 method for class 'tsriadditive'
plot(x, newtreatment = NULL, newIV = NULL,
newcovariates = NULL, alpha = 0.05, unit = "", ...)
Arguments
x |
the fitting object after fitting our model |
newtreatment |
a new treatment value |
newIV |
a new instrumental variable value |
newcovariates |
a new observed covariates |
alpha |
the confidence level 1 - alpha for confidence interval |
unit |
the time unit we focus |
... |
the other arguments you want to put in the built-in plot function |
Value
No return value, called for side effects
Examples
survtime <- rexp(100)
cause <- rbinom(100, 1, 0.7)
treatment <- rbinom(100, 1, 0.5)
IV <- rnorm(100)
covariates <- rnorm(100)
fit <- tsriadditive(survtime, cause, treatment, IV, covariates)
plot(fit, 1, 0, 0)
[Package tsriadditive version 1.0.0 Index]