KMPlot: KM plot for SurvCART object

KMPlotR Documentation

KM plot for SurvCART object

Description

Generates KM plot for sub-groups (i.e., terminal nodes) associated with survival tree generated by SurvCART()

Usage

KMPlot(x, type = 1, overlay=TRUE, conf.type="log-log", mfrow=NULL, ...)

Arguments

x

a fitted object of class "SurvCART", containing a survival tree.

type

1 for KM plot of survival probabilities, 2 for KM plot of censoring probabilities

overlay

Logical inputs (TRUE or FALSE) whether the KM plots for different subgroups will be overlaid in the same plot or separate plots to be generated

conf.type

One of none, plain, log, or log-log. The first option causes confidence intervals not to be generated. This input is ignored when overlay=TRUE.

mfrow

Desired frame for fitting multiple plots. Default option is to include plots for all subgroups in the same frame. This input is ignored when overlay=TRUE.

...

arguments to be passed to or from other methods.

Author(s)

Madan Gopal Kundu madan_g.kundu@yahoo.com

References

Kundu, M. G., and Ghosh, S. (2021). Survival trees based on heterogeneity in time-to-event and censoring distributions using parameter instability test. Statistical Analysis and Data Mining: The ASA Data Science Journal, 14(5), 466-483.

See Also

text, plot, SurvCART, StabCat.surv, StabCont.surv

Examples


#--- Get the data
data(GBSG2)

#numeric coding of character variables
GBSG2$horTh1<- as.numeric(GBSG2$horTh)
GBSG2$tgrade1<- as.numeric(GBSG2$tgrade)
GBSG2$menostat1<- as.numeric(GBSG2$menostat)

#Add subject id
GBSG2$subjid<- 1:nrow(GBSG2)

#--- Run SurvCART() with time-to-event distribution: exponential, censoring distribution: None  
out<- SurvCART(data=GBSG2, patid="subjid", censorvar="cens", timevar="time", 
        gvars=c('horTh1', 'age', 'menostat1', 'tsize', 'tgrade1', 'pnodes', 'progrec', 'estrec'),  
        tgvars=c(0,1,0,1,0,1, 1,1),          
        event.ind=1,  alpha=0.05, minsplit=80, minbucket=40, print=TRUE)

#--- Plot tree
par(xpd = TRUE)
plot(out, compress = TRUE)
text(out, use.n = TRUE)

#Plot KM plot of survival probabilities for sub-groups identified by tree
KMPlot(out, xscale=365.25, type=1)
KMPlot(out, xscale=365.25, type=1, overlay=FALSE, mfrow=c(2,2), xlab="Year", ylab="Survival prob.")

#Plot KM plot of censoring probabilities for sub-groups identified by tree
KMPlot(out, xscale=365.25, type=2)
KMPlot(out, xscale=365.25, type=2, overlay=FALSE, mfrow=c(2,2), xlab="Year", ylab="Censoring prob.")


LongCART documentation built on May 18, 2022, 1:06 a.m.

Related to KMPlot in LongCART...