# NOT RUN {
library(reda)
### Example 1. valve-seat data
valveMcf <- mcf(Survr(ID, Days, No.) ~ 1, data = valveSeats)
## plot sample MCF
plot(valveMcf, conf.int = TRUE, mark.time = TRUE) + ggplot2::xlab("Days")
### Example 2. sample simulated data
simuMcf <- mcf(Survr(ID, time, event) ~ group + gender,
data = simuDat, ID %in% 1 : 50, logConfInt = FALSE)
## create customized levels in legend
levs <- with(simuDat, expand.grid(levels(group), levels(gender)))
levs <- do.call(paste, c(as.list(levs), sep = " & "))
## plot sample MCF
plot(simuMcf, conf.int = TRUE, lty = 1 : 4,
legendName = "Treatment & Gender", legendLevels = levs)
## For estimated MCF from a fitted model,
## see examples given in function rateReg.
# }
Run the code above in your browser using DataLab