Fit a Cox model with a ridge penalty on all covariates

Share:

Description

Fits a simple Cox model with a ridge penalty on all coefficients. The penalty weight can be optimized using a REML-type likelihood method or be chosen by the user.

Usage

1
2
cox.ridge(formula, lambda = 1, lambdaFixed = FALSE, eps = 10e-6, data = sys.parent(),
iter.max = 200, mon = FALSE)

Arguments

formula

a formula object, with the response on the left of a '~' operator, and the terms on the right. The response must be a survival object as returned by the 'Surv' function.

lambdaFixed

when TRUE the function does not seek to optimize the penalty weight.

lambda

When lambdaFixed is FALSE lambda is a scalar giving the starting value for the weight of the penalty. When lambdaFixed is true lambda is the chosen weight of the penalty.

eps

a small value. The criterion of convergance.

data

an optional data frame containing the variables named in the formula.

iter.max

maximum number of iterations, default is 200.

mon

when true the function prints out the computed lambda weigh in each iteration.

Value

cox.ridge returns an object of class "cox.ridge" The function print.cox.ridge is used to obtain and print a summary of the results. An object of class "cox.ridge" is a list containing the following components:

call

function call.

coef

the vector of coefficients.

loglik

the penalized log-likelihood of the model.

time

a vector with failure/censoring times.

death

a vector of status indicator.

X

a matrix of covariates.

iter

number of iterations used to maximise likelihood at a fixed lambda.

inter.it

number of iterations used to find optimal lambda.'

lambda

optimal weight of the penalty.

Hat

the hat matrix at convergance.

hess

the Hessian matrix of second derivatives.

Note

The function at the current form cannot handle missing values. The user has to take prior action with missing values before using this function.

Author(s)

Aris Perperoglou

References

Perperoglou A.(2013)Cox models with dynamic ridge penalties on time varying effects of the covariates. Statistics in Medicine, to appear

See Also

coxph, Dynamic.Ridge

Examples

1
2
3
4
5
6
data(ova)
attach(ova)
X <- cbind(karn,diam,figo)
X <- apply(X,2,function(x){(x-mean(x))/sqrt(var(x))})#standardize covariates
fit <- cox.ridge(Surv(time,death)~X,lambda=1)
fit ##regression coefficients correspond to the standardized covariates