[R] Cox ridge regression
ljubomir at sfsu.edu
ljubomir at sfsu.edu
Mon Aug 3 18:25:42 CEST 2009
Thank you Terry, that answered all questions.
As a suggestion, help page for ridge() might indicate that the ridge
term simultaneously introduces predictors and penalizes them.
Ljubomir
From: Terry Therneau <therneau at mayo.edu>
To: Ljubomir Buturovic <ljubomir at sfsu.edu>
Cc: r-help at r-project.org
Subject: Re: Cox ridge regression
Date: Mon, 3 Aug 2009 09:20:42 -0500 (CDT)
> Question 1. Consider the following example from help(ridge):
> fit1 <- coxph(Surv(futime, fustat) ~ rx + ridge(age, ecog.ps,
> theta=1), ovarian)
> As I understand, this builds a model in which `rx' is the predictor,
> whereas ridge penalty term contains variables `age' and
> `ph.ecog'. Could someone explain what it me...
The ridge term introduces age as a predictor AND penalizes it. The model
above has 3 predictors, 2 of them penalized.
Later in the post you have a model with both age and ridge(age). This puts
age in the model twice, once as a free parameter and once as a penalized one.
Not surprisingly, the second ends up with a coefficient of 0 (within machine
precision of zero). The warning message you got about NaN is likely
related to
this, that there are redundant terms in the model.
Terry Therneau
More information about the R-help
mailing list