plotNPMLEsurv: Plot Survival/Event Curve(s) from the NPMLE

Description Usage Arguments See Also Examples

View source: R/plotNPMLEsurv.R

Description

A function to plot overall and conditional survival/event curve(s) from nonparametric maximum likelihood estimators (NPMLEs) of distribution functions.

Usage

1
2
plotNPMLEsurv(est, dist = "overall", curve = "survival", type = "s",
xlab = NULL, ylab = NULL, main = NULL, col = NULL, lty = NULL, lwd = 1, axes = T)

Arguments

est

the output object from the estimated NPMLE

dist

a character string specified with either "overall" or "cond". The default dist="overall" plots the overall distribution of the event time, and dist="cond" plots the conditional distribution for the logarithm of the event time for susceptible/non-cured subjects.

curve

a character string specifies the type of desired curves to be plotted. The default curve="survival" plots the survival curves, and. curve="event" plots event curves.

type

a character string specifies the type of plot, as in plot.

xlab

the title for x axis.

ylab

the title for y axis.

main

the main title of the plot.

col

a vector of colors.

lty

a vector of line types.

lwd

a numeric value specifies the line width.

axes

a logical value specifies whether axes should be drawn. If axes=FALSE, both x and y axes are not shown .

See Also

NPMLEsurv, plotMixture

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(simLTICdataA)

##### estimate the NPMLE #####
est=NPMLEsurv(formula=Surv(time1,time2,status)~X1,var.entry="entry",data=simLTICdataA)

### plot estimated survival curves with NPMLE
#win.graph(width=18,height=10)
#par(mfrow=c(1,2))
plot.NPMLE=plotNPMLEsurv(est,lty=c(2,2),col=c("red","blue"))
legend(20,0.4,legend=plot.NPMLE$legend,col=plot.NPMLE$col,lty=plot.NPMLE$lty,
       title=" Strata (Case / Total)")

plotD.NPMLE=plotNPMLEsurv(est,dist="cond",lty=c(2,2),col=c("red","blue"))
legend(3,0.4,legend=plotD.NPMLE$legend,col=plotD.NPMLE$col,lty=plotD.NPMLE$lty,
       title=" Strata (Case / Total)")

MixtureRegLTIC documentation built on May 1, 2019, 9:21 p.m.