compute_sandwich_se: Sandwich standard error for a penalized Cox borrowing...

View source: R/sandwich_variance.R

compute_sandwich_seR Documentation

Sandwich standard error for a penalized Cox borrowing estimator

Description

Computes the plug-in sandwich variance for the smoothed penalized Cox M-estimator. The Cox information and score residuals are evaluated at the penalized parameter estimate, and the penalty curvature is added to the (delta, delta) element of the bread. First-stage estimates are held fixed; this does not establish conditional or unconditional variance validity. Clipped curvature modifies the variance calculation without changing the fitted coefficients.

Usage

compute_sandwich_se(dat, delta_hat, theta_hat, beta_hat, pen_curv, xnames)

Arguments

dat

A data frame with columns time, status, T, Z, and covariates named in xnames.

delta_hat

Penalized estimate of the drift parameter.

theta_hat

Penalized estimate of the treatment effect.

beta_hat

Penalized estimate of the covariate coefficient vector.

pen_curv

Penalty curvature p''_{\lambda,\varepsilon}(\hat\delta).

xnames

Character vector of covariate names.

Value

A list with components:

se_sand

Sandwich standard error for theta_hat.

Var_sand

Full sandwich variance matrix.

coef_names, theta_idx, delta_idx

Coefficient bookkeeping.

pen_curv

Penalty curvature used in the bread.

note

Status note ("OK" on success).


fdb documentation built on Oct. 4, 2026, 5:07 p.m.