Re: [R] using pre-calculated coefficients and LP in coxph()?

From: Angel Russo <angerusso1980_at_gmail.com>
Date: Sun, 13 Mar 2011 14:38:19 -0400

Thanks very much Dimitrius and David.

I want to compute CPE using pre-calculated beta-model and linear.predictor using the following code. I hope it the code is OK. Let me know. I am also doing some sanity checks.

testc$x <- scores
testc$y <- Surv(testdata$time,testdata$status)
testfit <- coxph(y ~ x, testc, iter.max=0, init=1)
cpe=phcpe(testfit)

Thanks very much again.


On Sun, Mar 13, 2011 at 2:28 PM, David Winsemius <dwinsemius_at_comcast.net>wrote:

>
> On Mar 13, 2011, at 1:32 PM, Dimitris Rizopoulos wrote:
>
> probably you want to use the 'init' argument and 'iter.max'
>> control-argument of coxph(). For example, for the Lung dataset, we fix the
>> coefficients of age and ph.karno at 0.05 and -0.05, respectively:
>>
>> library(survival)
>>
>> coxph(Surv(time, status) ~ age + ph.karno, data = lung,
>> init = c(0.05, -0.05), iter.max = 0)
>>
>
>
>>
>> I hope it helps.
>>
>> Best,
>> Dimitris
>>
>>
>> On 3/13/2011 6:08 PM, Angel Russo wrote:
>>
>>> I need to force a coxph() function in R to use a pre-calculated set of
>>> beta
>>> coefficients of a gene signature consisting of xx genes and the gene
>>> expression is also provided of those xx genes.
>>>
>>
> I would have guessed (and that is all one can do without an example and
> better description of what the setting and goal might be) that the use of
> the offset capablity in coxph might be needed.
>
> --
> David.
>
>
>>> If I try to use "coxph()" function in R using just the gene expression
>>> data
>>> alone, the beta coefficients and coxph$linear.predictors will change and
>>> I
>>> need to use the pre-calcuated linear predictor not re-computed using
>>> coxph()
>>> function. The reason is I need to compute a quantity that uses as it's
>>> input
>>> the coxph() output but I need this output to be pre-calculated
>>> beta-coefficients and linear.predictor.
>>>
>>> Any one can show me how to do this in R?
>>>
>>> Thanks a lot.
>>>
>>
> David Winsemius, MD
> West Hartford, CT
>
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 13 Mar 2011 - 18:42:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 13 Mar 2011 - 19:00:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive