SubgrPlots (version 0.1.0)

prca: Prostate Cancer Dataset

Description

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<U+2013>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.

Usage

data(prca)

Arguments

Format

A data frame with 475 rows and 15 variables:

survtime

survival time. Response variable

cens

The status indicator, 0=alive, 1=dead

rx

treatment received, 0=control, 1=treatment

bm

existence of bone metastasis

hx

history of cardiovascular events

stage

disease stage (3 or 4)

pf

performance

age

age

weight

weight in kg.

age1

dummy variable for 65 <= age < 75

age2

dummy variable for age >= 75

wt1

dummy variable for 90 <= weight < 110

wt2

dummy variable for weight >= 110

age_group

age categorized in 3 groups

weight_group

weight categorized in 3 groups

Examples

Run this code
# 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
# }

Run the code above in your browser using DataLab