## S3 method for class 'icenReg_fit'lines( x, y, newdata =NULL, fun ="surv", cis = F, ci_level =0.9, survRange = c(0.025,1), evalPoints =20,...)
Arguments
x: icenReg fit
y: new data.frame
newdata: new data.frame (ignored if y is included)
fun: Function to be plotted. Options include "surv" or "cdf"
cis: Should confidence/credible interval be plotted?
ci_level: Confidence/credible interval
survRange: Range of survival curve to be plotted
evalPoints: Number of evaluations of survival curve to be plotted.
...: additional arguments to be passed to the base plot function
Details
Plots survival function from either an ic_np, ic_sp, ic_par or ic_bayes
object. If newdata is NULL, the baseline distribution is plotted. Otherwise, newdata should be a data.frame with each row containing a set covariates for which the fit will be plotted. If multiple rows are included, the lines will be colored and a legend will be created using the rownames of newdata.
For ic_np and ic_sp, the MLE is plotted with no intervals (at the time of writing this, there is no formula for standard errors of baseline distributions for these methods).
For ic_par and ic_bayes, the output plotted is directly extracted from survCIs.
If the argument col is provided, it will be used to color each survival function in order of the rows provided in newdata.
Examples
# Fitting mice data set data(miceData) miceFit <- ic_par(cbind(l, u)~ grp, data = miceData)# Creating covariates we want plotted newData <- data.frame(grp = c("ce","ge"))# Naming rows for legend rownames(newData)<- c("Conventional","Germ-Free") plot(miceFit, newdata = newData, col = c('blue','orange'))