Description Usage Format Source Examples
a prostate carcinoma dataset from a clinical trial David P. Byar and Sylvan B. Green. The choice of treatment for cancer patients based on covariate information: application to prostate cancer. Bulletin du Cancer, 67:477–490, 1980. The data can be found in the web: http://portal.uni-freiburg.de/imbi/Royston-Sauerbrei-book/index.html. We downloaded it form the supplementary material of Rosenkranz (2016) https://onlinelibrary.wiley.com/doi/full/10.1002/bimj.201500147 modified the data to keep relevant variables, and created categorical ones from age and weight.
1 |
A data frame with 475 rows and 15 variables:
survival time. Response variable
The status indicator, 0=alive, 1=dead
treatment received, 0=control, 1=treatment
existence of bone metastasis
history of cardiovascular events
disease stage (3 or 4)
performance
age
weight in kg.
dummy variable for 65 <= age < 75
dummy variable for age >= 75
dummy variable for 90 <= weight < 110
dummy variable for weight >= 110
age categorized in 3 groups
weight categorized in 3 groups
http://portal.uni-freiburg.de/imbi/Royston-Sauerbrei-book/index.html
https://onlinelibrary.wiley.com/doi/full/10.1002/bimj.201500147
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ## Not run:
# Code used to download the dataset and create variables
library(haven)
l1 <- "https://onlinelibrary.wiley.com/action/"
l2 <- "downloadSupplement?doi=10.1002%2Fbimj.201500147&attachmentId=2173117089"
data_url <- paste0(l1,l2)
temp <- tempfile()
download.file(data_url,temp)
prca0 <- read_sas(unz(temp, "adv_prostate_ca.sas7bdat"))
# Select the variables that we use for the analysis
prca <- prca0[,c("SURVTIME","CENS","RX","BM","HX","STAGE","PF", "AGE", "WT")]
# Change names of variables to lower case
names(prca)<- c("survtime","cens","rx","bm",
"hx","stage","pf","age", "wt")
# Create subgroups for Age and Weight and Stage
prca$age1 <- 1 * (prca$age > 65 & prca$age <= 75)
prca$age2 <- 1 * (prca$age > 75)
prca$wt1 <- 1 * (prca$wt > 90 & prca$wt <= 110)
prca$wt2 <- 1 * (prca$wt > 110)
# Create subgroups for Age and Weight and Stage with (-1,1) coding
prca$agegroup <- 1 + (1 * (prca$age > 65) + 1 * (prca$age > 75))
prca$wtgroup <- 1 + (1 * (prca$wt > 90) + 1 * (prca$wt > 110))
dat = prca
dat$agegroup = factor(dat$agegroup)
dat$wtgroup = factor(dat$wtgroup)
range(dat$age)
range(dat$wt)
levels(dat$agegroup) = c("[48,65]","(65,75]","(75,89]")
levels(dat$wtgroup) = c("[69,90]","(90,110]","(110,152]")
## We need variables as factors
dat$bm = factor(dat$bm)
dat$hx = factor(dat$hx)
dat$stage = factor(dat$stage)
dat$pf = factor(dat$pf)
dat$rx = factor(dat$rx) # Treatment
# Put labels to the variables so that they appear in the plot
names(dat)<- c("survtime",
"cens",
"rx",
"bm",
"hx",
"stage",
"pf",
"age",
"weight",
"age1",
"age2",
"wt1",
"wt2",
"age_group",
"weight_group")
prca <- dat
## devtools::use_data(prca, overwrite = T) ## Use it as dataset for the package
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.