Learn R Programming

pcoxtime (version 1.0.4)

coef.pcoxtimecv: Extract coefficient estimates of pcoxtimecv object

Description

This function extracts cross-validation estimates for a particular lambda.

Usage

# S3 method for pcoxtimecv
coef(object, lambda, ...)

# S3 method for pcoxtimecv coefficients(object, lambda, ...)

Arguments

object

pcoxtimecv object

lambda

the value of lambda for which to return the coefficient estimates. It can be any of the character string, "min", "optimal" or "best" for optimal lambda; "1se" for 1 standard error lambda; or any numeric value for lambda. See details.

...

for future implementations

Value

A data frame of coefficient estimates.

A vector of coefficient estimates.

Details

Extract the coefficient estimates for optimal lambda-alpha pair or based on specified the value of lambda for an optimal alpha. If the value of lambda specified is not exact (not in lambdas), the nearest value is used, based on nearest <- function(values, value){values[which(abs(values-value)==min(abs(values-value)))]}. It requires that pcoxtimecv is run with refit = TRUE.