Skip to contents

The GBSG2 data

Usage

data(GBSG4)

Format

This data frame contains the observations of 662 women:

age

in years.

menostat

Menopausal status: a factor with levels Pre and Post.

tsize

tumor size (in mm).

estrec

estrogen receptor (in fmol).

progrec

progesterone receptor (in fmol).

tgrade

tumor grade (1,2,3).

ttype

tumor type, a factor with levels Solid, Others and Invasive.

time

recurrence free survival time (in ???).

cens

censoring indicator (0- censored, 1- event).

Details

THIS IS NOT PUBLIC !!! DO NOT CIRCULATE THIS DATA !!!

Source

Willi Sauerbrei

Examples


cleans <- function(x) { attr(x, "time") <- NULL; names(x) <- NULL; x }


data(GBSG4)
table(GBSG4$menostat)
#> 
#>  Pre Post 
#>  215  388 
table(GBSG4$ttype)
#> 
#>    Solid   Others Invasive 
#>      300      179      124 

# COX
d <- GBSG4

mod <- survfit(Surv(time, cens) ~ 1, data=d)
plot(mod, xlab="Zeit in Jahren", ylab="Wahrscheinlickeit")

a <- sbrier(Surv(d$time, d$cens), mod, btime=5)
a
#> Brier score 
#>   0.1958291 
#> attr(,"time")
#> [1] 5
b <- sbrier(Surv(d$time, d$cens), mod, btime = c(0,5))
#> Warning: btime[1] is smaller than min(time)
b
#>          [,1]
#> [1,] 0.114369
#> attr(,"names")
#> [1] "integrated Brier score"
#> attr(,"time")
#> [1] 0.002737851 4.999315537
stopifnot(all.equal(round(cleans(a), 3), 0.196))
stopifnot(all.equal(round(cleans(b), 3), 0.115))
#> Error: round(cleans(b), 3) and 0.115 are not equal:
#>   Attributes: < Modes: list, NULL >
#>   Attributes: < Lengths: 1, 0 >
#>   Attributes: < names for target but not for current >
#>   ....

COX <- as.numeric(d$age <= 40) + as.numeric(d$tsize > 20) + d$tgrade

COX[COX == 2] <- 1
COX[COX == 3] <- 2
COX[COX == 4 | COX == 5] <- 3

table(COX)
#> COX
#>   1   2   3 
#> 277 205 121 

mod <- survfit(Surv(time, cens) ~ COX, data=d)
plot(mod, xlab="Zeit in Jahren", ylab="Wahrscheinlichkeit")


pred <- c()

for (i in 1:nrow(d))
  pred <- c(pred,getsurv(mod[COX[i]], 5))

cat("COX t=5: ")
#> COX t=5: 
    print(sbrier(Surv(d$time, d$cens), pred, btime=5))
#> Brier score 
#>   0.1787611 
#> attr(,"time")
#> [1] 5

if (FALSE) { # \dontrun{
pred <- list()
for (i in 1:nrow(d))
  pred <- c(pred,list(mod[COX[i]]))

cat("COX integrated: ")
    print(sbrier(Surv(d$time, d$cens), pred, btime=c(0,5)))
# ==  0.1050987
} # }