Skip to contents

Approximate the number of events in each subgroup level from the confidence intervals of the hazard ratios, for publications that do not report subgroup event counts.

Usage

group_data_events(patient, summary, lower, upper, confidence = 0.95)

Arguments

patient

Patient-level survival data, the output of group_data_patient().

summary

Summary subgroup statistics, the output of group_data_summary(), usually with events = NULL. The event counts in summary, if any, are ignored.

lower

Numeric vector with one element per row of summary: the lower bound \(b_k^-\) of the two-sided confidence interval of the hazard ratio of each subgroup level, on the natural scale (not the log scale). Every element must be finite and strictly positive.

upper

Numeric vector with one element per row of summary: the upper bound \(b_k^+\) of the two-sided confidence interval of the hazard ratio of each subgroup level, on the natural scale (not the log scale). Every element must be finite, strictly positive, and strictly greater than the corresponding element of lower.

confidence

Number strictly between 0 and 1, the confidence level \(1 - \alpha\) of the confidence intervals.

Value

A tibble with the same rows and columns as the output of group_data_summary(), in the same order as summary. The events column has the reconciled event counts. All other columns are the same as in summary.

Details

group_data_events() implements vignette("events", package = "retrogroup"), separately for each subgroup variable. It assumes the confidence interval of each hazard ratio is a Wald interval computed on the log scale, so the interval of the log hazard ratio \(\beta_k\) is symmetric about \(\beta_k\) with half-width \(c \sigma_k\). Equating \(\sigma_k^2\) with the variance approximation of Schoenfeld (1983), as in Parmar et al. (1998), the approximate number of events in subgroup level \(k\) is $$\hat{e}_k = \frac{1}{\bar{z} (1 - \bar{z})} \frac{4 c^2}{(\log(b_k^+) - \log(b_k^-))^2}$$ where \(b_k^-\) is lower, \(b_k^+\) is upper, \(c\) is the \(1 - \alpha / 2\) quantile of the standard normal distribution for confidence \(= 1 - \alpha\), and \(\bar{z}\) is the proportion of patients in patient randomized to treatment. Using \(\bar{z}\) for every level assumes the treatment allocation within each level matches the overall allocation, which randomization supports. The approximation does not use the hazard ratios in summary.

The approximate counts do not necessarily add up to the total number of events in patient, and they may exceed the number of patients of the level. So group_data_events() rounds each \(\hat{e}_k\) to the nearest integer and clamps it to between 0 and \(n_k\). Then it makes passes over the levels in the order of summary, adding 1 to (or subtracting 1 from) each level that has room, until the counts of each subgroup variable add up to the total number of events in patient. The result satisfies all the requirements on event counts of group_data_summary().

This is only one of many possible ways to choose event counts. The choice is a decision about the reconstruction, and it is your responsibility. Please disclose the event counts used and how they were chosen wherever the reconstructed data or downstream results are reported.

summary must satisfy the requirements of group_analysis_probability(), except that its event counts are ignored. Usually summary is the output of group_data_summary() with events = NULL.

References

Parmar MKB, Torri V, Stewart L (1998). Extracting summary statistics to perform meta-analyses of the published literature for survival endpoints. Statistics in Medicine, 17(24), 2815-2834. doi:10.1002/(SICI)1097-0258(19981230)17:24<2815::AID-SIM110>3.0.CO;2-8

Schoenfeld DA (1983). Sample-size formula for the proportional-hazards regression model. Biometrics, 39(2), 499-503. doi:10.2307/2531021

Examples

  patient <- group_data_patient(
    group_example_patient(),
    arm = "arm",
    treatment = "Lev+5FU",
    time = "time",
    event = "event"
  )
  data <- group_example_summary()
  summary <- group_data_summary(
    data,
    variable = "variable",
    level = "level",
    patients = "patients",
    events = NULL,
    hazard_ratio = "hazard_ratio"
  )
  summary
#> # A tibble: 6 × 5
#>   variable level      patients events hazard_ratio
#>   <chr>    <chr>         <int>  <int>        <dbl>
#> 1 age      under 60        280     NA        0.844
#> 2 age      60 or over      339     NA        0.579
#> 3 node4    no              453     NA        0.659
#> 4 node4    yes             166     NA        0.732
#> 5 sex      female          312     NA        0.863
#> 6 sex      male            307     NA        0.519
  group_data_events(
    patient,
    summary,
    lower = data$lower,
    upper = data$upper
  )
#> # A tibble: 6 × 5
#>   variable level      patients events hazard_ratio
#>   <chr>    <chr>         <int>  <int>        <dbl>
#> 1 age      under 60        280    131        0.844
#> 2 age      60 or over      339    160        0.579
#> 3 node4    no              453    176        0.659
#> 4 node4    yes             166    115        0.732
#> 5 sex      female          312    159        0.863
#> 6 sex      male            307    132        0.519
  data[, c("variable", "level", "events")]
#> # A tibble: 6 × 3
#>   variable level      events
#>   <chr>    <chr>       <int>
#> 1 age      under 60      129
#> 2 age      60 or over    162
#> 3 node4    no            177
#> 4 node4    yes           114
#> 5 sex      female        152
#> 6 sex      male          139