Learn R Programming

glmnet (version 3.0-2)

coxgrad: compute gradient for cox model

Description

Compute the gradient of the partial likelihood at a particular fit

Usage

coxgrad(f, time, d, w, eps = 1e-05)

Arguments

f

fit vector

time

time vector (can have ties)

d

death/censoring indicator 1/0

w

observation weights (default equal)

eps

(default 0.00001) Breaks ties between death and censoring by making death times eps earlier

Value

a single gradient vector the same length as f

Details

Compute a gradient vector at the fitted vector for the log partial likelihood. This is like a residual vector, and useful for manual screening of predictors for glmnet in applications where p is very large (as in GWAS). Uses the Breslow approach to ties

See Also

coxnet.deviance