dataKm {RcmdrPlugin.KMggplot2} | R Documentation |
A Dummy Data for Survival Analysis
Description
A Dummy Data for Survival Analysis
Format
A data frame with 200 observations on the following 8 variables.
time
time from entry (months)
age
age
height
height
weight
weight
event
event variable (0: censor, 1: event)
trt
treatment group (has three groups "Group-A", "Group-B", and "Group-C")
marker
a biomarker level (has two groups "High", and "Low")
sex
sex
See Also
km-class
Examples
# This data is generated by the code below:
# set.seed(5435678)
# age <- round(rnorm(200, 65, 10))
# height <- rep(c(170, 160), each = 50) + rnorm(200, 0, 6)
# weight <- rep(c(50, 45.5), each = 50) + 0.91 * (height - 152.4) + rnorm(200, 0, 7)
# event <- sample(c(0, 1), 200, rep = TRUE, prob = c(0.1, 0.9))
# trt <- factor(sample(c("Group-A", "Group-B", "Group-C"), 200, rep = TRUE))
# marker <- factor(sample(c("High", "Low"), 200, rep = TRUE, prob = c(0.3, 0.7)))
# sex <- factor(rep(c("M", "F"), each = 50))
# mu <- 10 + 0.1 * (age - 65) + as.numeric(sex) + as.numeric(marker) + 5 * (as.numeric(trt) - 2)
# time <- rgamma(200, mu, 1)
# time[time >= 20] <- 20
# event[time == 20] <- 0
# dataKm <- data.frame(time, age, height, weight, event, trt, marker, sex)
# save(dataKm, file = "dataKm.RData")
# try(data(dataKm, package = "RcmdrPlugin.KMggplot2"))
[Package RcmdrPlugin.KMggplot2 version 0.2-6 Index]