Skip to contents

as.data.frame() gives the tests of an aalen_additive() fit, one row per term.

Usage

# S3 method for class 'aalen_additive'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  ...,
  conf_level = x$conf_level
)

Arguments

x

An aalen_additive() fit.

row.names, optional

Unused. They're part of the as.data.frame() generic.

...

Unused.

conf_level

The confidence level. The default is the level the model was fit with.

Value

A data frame with the columns term, slope, estimate (the scaled statistic), std_error, statistic (the z statistic), p_value, conf_low, and conf_high.

Examples

lung <- data.frame(
  time = c(306, 455, 1010, 210, 883, 1022, 310, 361, 218, 166, 170, 654, 728, 71, 567, 144,
    613, 707, 61, 88),
  status = c(2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
  age = c(74, 68, 56, 57, 60, 74, 68, 71, 53, 61, 57, 68, 68, 60, 57, 67, 70, 63, 56, 57),
  sex = c(1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1)
)
fit <- aalen_additive(Surv(time, status) ~ age + sex, data = lung)
as.data.frame(fit)
#>        term         slope     estimate   std_error  statistic   p_value
#> 1 Intercept  0.0184023486  0.311098307 0.203075025  1.5319378 0.1255378
#> 2       age -0.0001858702 -0.003067174 0.003140455 -0.9766654 0.3287348
#> 3       sex -0.0010190200 -0.013134247 0.039072139 -0.3361538 0.7367549
#>       conf_low   conf_high
#> 1 -0.086921428 0.709118041
#> 2 -0.009222353 0.003088005
#> 3 -0.089714232 0.063445739