data-dataKm: A Dummy Data for Survival Analysis

Description Format See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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"))

Example output

Loading required package: grid
Loading required package: Rcmdr
Loading required package: splines
Loading required package: RcmdrMisc
Loading required package: car
Loading required package: carData
Loading required package: sandwich
Loading required package: effects
lattice theme set by effectsTheme()
See ?effectsTheme for details.
The Commander GUI is launched only in interactive sessions

Attaching package: 'Rcmdr'

The following object is masked from 'package:car':

    Confint

Loading required package: ggplot2
Warning message:
no DISPLAY variable so Tk is not available 

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