Dataset requirements to make Kaplan-Meier plot with RcmdrPlugin.KMggplot2"

RcmdrPlugin.KMggplot2 depends survfit function of survival package. Dataset requirements are same as survfit function, which works with Surv objects.

Surv object

Surv objects are generated from Surv function. RcmdrPlugin.KMggplot2 calls as follows:

survfit(Surv(time = x, event = y, type = "right") ~ z + s + t, .df)

Arguments

RcmdrPlugin.KMggplot2 requires a data frame that at least includes time and event variables, and includes z, s, t if you needs

Data Example

data(dataKm, package = "RcmdrPlugin.KMggplot2")
exampleData <- dataKm[, c("time", "event", "trt", "sex", "marker")]
knitr::kable(head(exampleData, 10))

In this case:



Try the RcmdrPlugin.KMggplot2 package in your browser

Any scripts or data that you put into this service are public.

RcmdrPlugin.KMggplot2 documentation built on Sept. 17, 2019, 9:03 a.m.