tidy.std_surv: Provide tidy output from a std_surv object for use in...

View source: R/coxph_methods.R

tidy.std_survR Documentation

Provide tidy output from a std_surv object for use in downstream computations

Description

Tidy summarizes information about the components of the standardized model fit.

Usage

## S3 method for class 'std_surv'
tidy(x, ...)

Arguments

x

An object of class std_surv

...

Not currently used

Value

A data.frame

Examples

require(survival)
set.seed(8)
n <- 300
Z <- rnorm(n)
X <- rnorm(n, mean = Z)
time <- rexp(n, rate = exp(X + Z + X * Z)) # survival time
C <- rexp(n, rate = exp(X + Z + X * Z)) # censoring time
U <- pmin(time, C) # time at risk
D <- as.numeric(time < C) # event indicator
dd <- data.frame(Z, X, U, D)
x <- standardize_coxph(
  formula = Surv(U, D) ~ X + Z + X * Z,
  data = dd, values = list(X = seq(-1, 1, 0.5)), times = c(2,3,4)
)

tidy(x)


stdReg2 documentation built on April 13, 2025, 5:12 p.m.