| coxstream | R Documentation |
Fits the Cox PH model using a single descending-time-order pass per
Newton-Raphson iteration. Peak RAM is O(p^2) regardless of n, making it
suitable for large datasets. Produces identical coefficients to
survival::coxph() with Efron tie correction.
coxstream(
formula,
data,
init = NULL,
max_iter = 25L,
tol = 1e-09,
verbose = FALSE
)
formula |
A formula with a |
data |
A data frame containing the variables in |
init |
Optional numeric vector of starting values for beta (length p). Defaults to zero. |
max_iter |
Maximum Newton-Raphson iterations. Default 25. |
tol |
Convergence tolerance on the max absolute score element. Default 1e-9. |
verbose |
Currently unused; reserved for future per-iteration output.
Default |
An object of class "coxstream" with components:
coefficients |
Named numeric vector of fitted coefficients. |
var |
Variance-covariance matrix (inverse of observed information). |
loglik |
Log-likelihood at convergence. |
n_iter |
Number of NR iterations taken. |
n |
Number of rows. |
formula |
The formula used. |
call |
The matched call. |
library(survival)
fit <- coxstream(Surv(time, status) ~ age + sex, data = lung)
coef(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.