Description Usage Arguments Details Author(s) References See Also Examples
plot.npsurv
and plot.idf
are wrapper functions that call
either plotsurvidf
or plotgradidf
.
plotsurvidf
plots the survival function of the nonparametric
maximum likelihood estimate (NPMLE).
plotgradidf
plots the gradient function of the NPMLE.
1 2 3 4 5 6 7 8 9 | ## S3 method for class 'npsurv'
plot(x, ...)
## S3 method for class 'idf'
plot(x, data, fn=c("surv","grad"), ...)
plotsurvidf(f, style=c("box","uniform","left","right","midpoint"),
xlab="Time", ylab="Survival Probability", col="blue3", fill=0,
add=FALSE, lty=1, lty.inf=2, xlim, ...)
plotgradidf(f, data, w=1, col1="red3", col2="blue3",
xlab="Survival Time", ylab="Gradient", xlim, ...)
|
x |
an object of class |
fn |
either "surv" or "grad", to indicate plotting either the survival or the gradient function. |
f |
an object of class |
style |
for how to plot the survival function on a "maximal intersection interval": = = = = = |
xlab, ylab |
x- or y-axis label. |
add |
= = |
col |
color for all line segments, including box/rectangle borders. |
fill |
color for filling a box/rectangle. By default, a lighter semi-transparent color is used. |
lty |
line type |
lty.inf |
line type for the rectangle that may extend to infinity. |
data |
vector or matrix that stores observations, or an object of
class |
w |
additional weights/multiplicities of the observations stored in
|
col1 |
color for drawing maximal intersection intervals allocated with positive probabilities. |
col2 |
color for drawing all gradients and the maximal intersection intervals allocated with zero probabilities. |
xlim |
x-coordinate limit points. |
... |
arguments for other graphical parameters (see |
plotsurvidf
by default chooses a less saturated color for
fill
than col
.
plotgradidf
plots gradient values as vertical lines located as
the left endpoints of the maximal intersection intervals. Each maximal
intersection interval is plotted as a wider line on the horizontal
zero-gradient line, with a circle to represent the open left endpoint
of the interval and a solid point the closed right endpoint of the
interval. The maximal intersection intervals allocated with positive
probabilities have zero gradients, and hence no vertical lines are
drawn for them.
Yong Wang <[email protected]>
Wang, Y. (2008). Dimension-reduced nonparametric maximum likelihood computation for interval-censored data. Computational Statistics & Data Analysis, 52, 2388-2402.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(ap)
plot(r<-npsurv(ap)) # survival function
plot(r$f, ap, fn="g") # all gradients virtually zeros.
data(cancer)
cancerRT = with(cancer, cancer[group=="RT",1:2])
plot(rt<-npsurv(cancerRT), xlim=c(0,60)) # survival of RT
cancerRCT = with(cancer, cancer[group=="RCT",1:2])
plot(rct<-npsurv(cancerRCT), add=TRUE, col="green3") # survival of RCT
## as uniform dististrbutions.
plot(rt, add=TRUE, style="uniform", col="blue3")
plot(rct, add=TRUE, style="uniform", col="green3")
## plot gradients; must supply data
plot(rt, cancerRT, fn="g") # for group RT
plotgradidf(rct$f, cancerRCT) # or, for group RCT
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.