|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
retrieve p-value from a cox.objI have a cox.obj named obj,
obj <- coxph( Surv(time, status) ~ group, surv.data) now I want to retrieve the p-value from obj, so that I can run this hundreds of times and plot out the distribution of the p-value. could anyone tell me how to get p-value from obj? thanks, |
|
|
Re: retrieve p-value from a cox.objstr() is your friend. It tells you about the structure of any R object, from
which you can usually glean what you need to know to get what you want. It is often useful to use it on summary(object) rather than on the object, as the summary method for an (S3) classed object often contains what you're looking for. Less generally, names() and as.list() can sometimes get you what you want also. Alternatively, check the summary.coxph() code (survival:::summary.coxph, as it's hidden in the namespace). It is clear there how to get what you want, either direct from the fitted object or from the summary.coxph object. Bert Gunter Genentech Nonclinical Statistics -----Original Message----- From: r-help-bounces@... [mailto:r-help-bounces@...] On Behalf Of clearsky Sent: Wednesday, August 29, 2007 8:41 AM To: r-help@... Subject: [R] retrieve p-value from a cox.obj I have a cox.obj named obj, obj <- coxph( Surv(time, status) ~ group, surv.data) now I want to retrieve the p-value from obj, so that I can run this hundreds of times and plot out the distribution of the p-value. could anyone tell me how to get p-value from obj? thanks, -- View this message in context: http://www.nabble.com/retrieve-p-value-from-a-cox.obj-tf4348520.html#a123896 52 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@... 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. ______________________________________________ R-help@... 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. |
|
|
Re: retrieve p-value from a cox.objI tried obj$p, obj$pvalue, but they both returned null~~
|
|
|
Re: retrieve p-value from a cox.objSee the source code of function:
survival:::print.coxph -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 29/08/2007, clearsky <haiyingwithu@...> wrote: > > > I tried obj$p, obj$pvalue, but they both returned null~~ > > > clearsky wrote: > > > > I have a cox.obj named obj, > > obj <- coxph( Surv(time, status) ~ group, surv.data) > > now I want to retrieve the p-value from obj, so that I can run this > > hundreds of times and plot out the distribution of the p-value. could > > anyone tell me how to get p-value from obj? > > > > thanks, > > > > > > -- > View this message in context: > http://www.nabble.com/retrieve-p-value-from-a-cox.obj-tf4348520.html#a12390960 > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@... 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. > ______________________________________________ R-help@... 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. |
|
|
Re: retrieve p-value from a cox.objThanks, Bert . It is a lot help!
|
|
|
|
|
|
Re: retrieve p-value from a cox.objOn Wed, 2007-08-29 at 08:40 -0700, clearsky wrote:
> I have a cox.obj named obj, > obj <- coxph( Surv(time, status) ~ group, surv.data) > now I want to retrieve the p-value from obj, so that I can run this hundreds > of times and plot out the distribution of the p-value. could anyone tell me > how to get p-value from obj? > > thanks, Hi Clearsky try: summary(obj)$waldtest[3] -- Bernardo Rangel Tura, M.D,Ph.D National Institute of Cardiology Brazil ______________________________________________ R-help@... 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. |
| Free embeddable forum powered by Nabble | Forum Help |