Skip to contents

Survival times, in months, of 36 patients with hypernephroma (a malignant tumour of the kidney) treated with chemotherapy and immunotherapy, with or without a nephrectomy, and classified by age group (Collett, 2023, Example 3.4).

Usage

hyper

Format

A data frame with 36 rows and 4 variables:

nephrectomy

Whether the kidney was surgically removed: 0 = no, 1 = yes.

age

Age group at diagnosis: 1 = under 60 years, 2 = 60-70 years, 3 = over 70 years.

time

Survival time in months.

status

Event indicator: 1 = death, 0 = right-censored.

Source

Collett, D. (2023) Modelling Survival Data in Medical Research, 4th ed. Chapman & Hall/CRC, Example 3.4 (Table 3.6). Data from Lee and Wang (2013).

Details

The age of each patient has been grouped for the analysis (the underlying age in years is not included). The example is the running illustration of the Cox regression model: indicator variables for a factor with three levels, models with and without interaction, and the interpretation of the baseline hazard (Examples 3.4, 3.10, 3.11, 3.13 and 3.14), followed by the corresponding Weibull analysis (Examples 5.10, 6.1 and 6.4).

Aliases

The data set is available under the aliases d3.4, d3.10, d3.11, d3.13, d3.14, d5.10, d6.1, d6.4; dX.Y is the alias for the data set used in Example X.Y of Collett (2023). See dataset_by_exercise for the complete index.

Examples

# Collett (2023), Chapter 17 style -----------------------------------
# Examples 3.4, 3.10, 3.11, 3.13 and 3.14: Cox model with age group
fit_hyper <- survival::coxph(
  survival::Surv(time, status) ~ nephrectomy + factor(age),
  data = hyper
)
summary(fit_hyper)
#> Call:
#> survival::coxph(formula = survival::Surv(time, status) ~ nephrectomy + 
#>     factor(age), data = hyper)
#> 
#>   n= 36, number of events= 32 
#> 
#>                  coef exp(coef) se(coef)      z Pr(>|z|)   
#> nephrectomy  -1.40351   0.24573  0.51593 -2.720  0.00652 **
#> factor(age)2  0.02041   1.02062  0.42551  0.048  0.96175   
#> factor(age)3  1.36077   3.89918  0.59701  2.279  0.02265 * 
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#>              exp(coef) exp(-coef) lower .95 upper .95
#> nephrectomy     0.2457     4.0694   0.08939    0.6755
#> factor(age)2    1.0206     0.9798   0.44327    2.3500
#> factor(age)3    3.8992     0.2565   1.21004   12.5646
#> 
#> Concordance= 0.67  (se = 0.049 )
#> Likelihood ratio test= 12.36  on 3 df,   p=0.006
#> Wald test            = 14.36  on 3 df,   p=0.002
#> Score (logrank) test = 17.55  on 3 df,   p=5e-04
#> 

# Example 5.10: the corresponding Weibull model
survival::survreg(
  survival::Surv(time, status) ~ nephrectomy + factor(age),
  data = hyper, dist = "weibull"
)
#> Call:
#> survival::survreg(formula = survival::Surv(time, status) ~ nephrectomy + 
#>     factor(age), data = hyper, dist = "weibull")
#> 
#> Coefficients:
#>  (Intercept)  nephrectomy factor(age)2 factor(age)3 
#>   2.88668426   1.17011052  -0.05822745  -1.17137057 
#> 
#> Scale= 0.709002 
#> 
#> Loglik(model)= -142.8   Loglik(intercept only)= -151.4
#> 	Chisq= 17.13 on 3 degrees of freedom, p= 0.000665 
#> n= 36 

# Examples 6.1 and 6.4: piecewise exponential baseline hazard
# Chapter 17 fits this with phreg(dist = "pch", cuts = ...) in the eha package;
# pchreg() is the current name of the same fit.
eha::pchreg(
  survival::Surv(time, status) ~ factor(age) + nephrectomy,
  data = hyper,
  cuts = c(5, 6, 8, 9, 10, 12, 14, 15, 17, 18, 21, 26, 35, 36, 38,
           48, 52, 56, 68, 72, 84, 108, 115)
)
#> Call:
#> eha::pchreg(formula = survival::Surv(time, status) ~ factor(age) + 
#>     nephrectomy, data = hyper, cuts = c(5, 6, 8, 9, 10, 12, 14, 
#>     15, 17, 18, 21, 26, 35, 36, 38, 48, 52, 56, 68, 72, 84, 108, 
#>     115))
#> 
#> Covariate          W.mean      Coef Exp(Coef)  se(Coef)    Wald p
#> factor(age) 
#>                1    0.643     0         1           (reference)
#>                2    0.316     0.117     1.124     0.427     0.784 
#>                3    0.041     1.508     4.518     0.608     0.013 
#> nephrectomy         0.934    -1.536     0.215     0.530     0.004 
#> 
#> 
#> Events                    32 
#> Total time at risk          1340 
#> Max. log. likelihood      -124.35 
#> LR test statistic         13.95 
#> Degrees of freedom        3 
#> Overall p-value           0.00296981

# Modern tools --------------------------------------------------------
if (requireNamespace("flexsurv", quietly = TRUE)) {
  flexsurv::flexsurvspline(
    survival::Surv(time, status) ~ nephrectomy + factor(age),
    data = hyper, k = 1
  )
}
#> Call:
#> flexsurv::flexsurvspline(formula = survival::Surv(time, status) ~ 
#>     nephrectomy + factor(age), data = hyper, k = 1)
#> 
#> Estimates: 
#>               data mean  est       L95%      U95%      se        exp(est)
#> gamma0              NA   -6.28750  -9.26553  -3.30948   1.51943        NA
#> gamma1              NA    2.28656   1.22633   3.34680   0.54094        NA
#> gamma2              NA    0.18649  -0.00175   0.37473   0.09604        NA
#> nephrectomy    0.80556   -1.58233  -2.59447  -0.57019   0.51641   0.20549
#> factor(age)2   0.33333    0.14311  -0.64834   0.93455   0.40380   1.15385
#> factor(age)3   0.13889    1.72990   0.56312   2.89668   0.59531   5.64009
#>               L95%      U95%    
#> gamma0              NA        NA
#> gamma1              NA        NA
#> gamma2              NA        NA
#> nephrectomy    0.07469   0.56542
#> factor(age)2   0.52292   2.54606
#> factor(age)3   1.75614  18.11398
#> 
#> N = 36,  Events: 32,  Censored: 4
#> Total time at risk: 1340
#> Log-likelihood = -140.7226, df = 6
#> AIC = 293.4451
#>