coxgrad {glmnet}R Documentation

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

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

Value

a single gradient vector the same length as f

Author(s)

Trevor Hastie
Maintainer: Trevor Hastie hastie@stanford.edu

See Also

coxnet.deviance


[Package glmnet version 4.0-2 Index]