Learn R Programming

SmoothHazard (version 1.0.9)

plot.shr: Plot method for a survival model.

Description

Plot estimated baseline survival function from an object of class shr. Confidence bands are allowed.

Usage

## S3 method for class 'shr':
plot(x, type="shr", add = FALSE, newdata=NULL, cause=NULL, col, lty, lwd,
	ylim, xlim, xlab="Time" ,ylab, legend=TRUE, confint=TRUE, timeOrigin=0,
	axes=TRUE, percent=TRUE,...)

Arguments

x
a shrWeib or a shrPl class object (output from calling shr function).
type
type of function to plot. The default is "shr".
add
boolean.
newdata
newdata.
cause
cause.
col
col.
lty
lty.
lwd
lwd.
ylim
ylim.
xlim
xlim.
xlab
xlab.
ylab
ylab.
legend
legend.
confint
confint.
timeOrigin
timeOrigin.
axes
axes.
percent
percent.
...
other graphical parameters.

Value

  • Print a plot of a suvival model.

See Also

plot.shr

Examples

Run this code
# Weibull survival model 
data(test)
fit.su <- shr(Hist(time=list(l,r),id)~cov,data=test) 

# confidence bands
plot(fit.su)

# no confidence bands
plot(fit.su,confint=FALSE)

Run the code above in your browser using DataLab