Description Usage Arguments Details Examples
View source: R/plottingFunctions.R
Plotting for icenReg Fits
1 2 3 4 |
x |
icenReg fit |
y |
new data.frame |
newdata |
new data.frame (ignored if |
fun |
Function to be plotted. Options include |
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 |
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
.
1 2 3 4 5 6 7 8 9 10 11 | # 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'))
|
Loading required package: survival
Loading required package: Rcpp
Loading required package: coda
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.