RcmdrPlugin.KMggplot2 depends survfit function of survival package. Dataset requirements are same as survfit function, which works with Surv objects.
Surv objectSurv objects are generated from Surv function. RcmdrPlugin.KMggplot2 calls as follows:
survfit(Surv(time = x, event = y, type = "right") ~ z + s + t, .df)time
event
type
RcmdrPlugin.KMggplot2 can only handle “right” censoring.z, s, t
z) and the facet (s, t) variables (factor variables)..df
RcmdrPlugin.KMggplot2 requires a data frame that at least includes time and event variables, and includes z, s, t if you needs
| time | event | trt | sex | marker |
|---|---|---|---|---|
| 17.540935 | 1 | Group-C | M | Low |
| 16.520777 | 1 | Group-A | M | Low |
| 6.530335 | 0 | Group-A | M | High |
| 10.701766 | 0 | Group-B | M | High |
| 4.779544 | 1 | Group-A | M | Low |
| 20.000000 | 0 | Group-C | M | Low |
| 19.527943 | 1 | Group-B | M | Low |
| 13.065791 | 1 | Group-B | M | High |
| 8.710817 | 1 | Group-A | M | High |
| 14.460404 | 1 | Group-B | M | Low |