response.coxnet {glmnet}R Documentation

Make response for coxnet

Description

Internal function to make the response y passed to glmnet suitable for coxnet (i.e. glmnet with family = "cox"). Sanity checks are performed here too.

Usage

response.coxnet(y)

Arguments

y

Response variable. Either a class "Surv" object or a two-column matrix with columns named 'time' and 'status'.

Details

If y is a class "Surv" object, this function returns y with no changes. If y is a two-column matrix with columns named 'time' and 'status', it is converted into a "Surv" object.

Value

A class "Surv" object.


[Package glmnet version 4.1-8 Index]