Skip to contents

Produces a summary of the fitted CoxPH model with linkage error adjustment, including coefficient estimates, hazard ratios, standard errors, z-statistics, and p-values.

Usage

# S3 method for class 'coxphELE'
summary(object, conf.int = 0.95, ...)

Arguments

object

An object of class coxphELE.

conf.int

The confidence level for the confidence intervals (default is 0.95).

...

Additional arguments (currently ignored).

Value

An object of class summary.coxphELE containing:

call

The matched call.

coefficients

A matrix with columns for coefficients, hazard ratios (exp(coef)), standard errors, z-values, and p-values.

conf.int

A matrix of confidence intervals for the hazard ratios.

n

The number of observations.

nevent

The number of events.

Examples

library(survival)
set.seed(104)
n <- 200

# 1. Simulate covariates
age_centered <- rnorm(n, 0, 5)
treatment <- rbinom(n, 1, 0.5)

# 2. Simulate true survival times
true_time <- rexp(n, rate = exp(0.05 * age_centered - 0.6 * treatment))
cens_time <- rexp(n, rate = 0.2)
time <- pmin(true_time, cens_time)
status <- as.numeric(true_time <= cens_time)

# 3. Induce 15% Exchangeable Linkage Error (ELE)
mis_idx <- sample(1:n, size = floor(0.15 * n))
linked_age <- age_centered
linked_trt <- treatment

# False links drawn uniformly from the target population
false_link_idx <- sample(1:n, size = length(mis_idx), replace = TRUE)
linked_age[mis_idx] <- age_centered[false_link_idx]
linked_trt[mis_idx] <- treatment[false_link_idx]

linked_data <- data.frame(time = time, status = status,
                          age = linked_age, treatment = linked_trt)

# 4. Fit the adjusted Cox PH model
adj <- adjELE(linked.data = linked_data, m.rate = 0.15)
fit <- plcoxph(Surv(time, status) ~ age + treatment, adjustment = adj)

# 5. Generate and print the detailed statistical summary
sum_fit <- summary(fit)
print(sum_fit)
#> Call:
#> plcoxph(formula = Surv(time, status) ~ age + treatment, adjustment = adj)
#> 
#> n=200, number of events=41
#> 
#>               coef exp(coef) se(coef)      z Pr(>|z|)
#> age       -0.01234   0.98774  0.03724 -0.331    0.740
#> treatment  0.11545   1.12238  0.40019  0.289    0.773
#> 
#> Confidence Intervals for Hazard Ratios:
#>           exp(coef) lower 0.95 upper 0.95
#> age          0.9877     0.9182      1.063
#> treatment    1.1224     0.5123      2.459
#>