[R] help with parsing multiple coxph() results

Hao Liu liuha at umdnj.edu
Tue Jan 17 21:03:57 CET 2006


Thanks, I can do calculatation for each gene, however what I want to do is
to fit the model on each and every gene, store their result and then be able
to access all of them, then filter on them, to do that:

1. I need to know how to access each part of the coxph result, like its
coefficient, exp(coef),P,Z, etc.
2. I need to be able to generate a graphical presentation of the filtered
genes, to show how their expression level is associated with survival, etc.

I just could not find any explanation as to how to check different part of a
coxph result, not to mention to store them in certain data structure, like
vectors Java or Perl, etc.

Best
Hao

-----Original Message-----
From: Fredrik Lundgren [mailto:fredrik.bg.lundgren at bredband.net] 
Sent: Tuesday, January 17, 2006 2:26 PM
To: Hao Liu
Cc: R-help
Subject: Re: [R] help with parsing multiple coxph() results

Hao,

I'm not sure but you have specified your modell as tautology. The formula
below should be enough:

survtest <- coxph(Surv(fup_interval, endpoint) ~ geneid, data =
pcc.primary.stg.3.cox)

HTH
Fredrik
----- Original Message -----
From: "Hao Liu" <liuha at umdnj.edu>
To: <r-help at stat.math.ethz.ch>
Sent: Tuesday, January 17, 2006 7:47 PM
Subject: [R] help with parsing multiple coxph() results


> Dear All:
>
> I have a question on using coxph for multiple genes:
>
> I have written code to loop through all 22283 genes in the Hgu-133A 
> and
> apply coxph on survival data.
>
> However, I don't know how to work with the result for each gene:
>
>
survtest<-coxph(Surv(pcc.primary.stg.3.cox[,'fup_interval'],pcc.primary.stg.
>
3.cox[,'endpoint'])~pcc.primary.stg.3.cox[,'geneid'],pcc.primary.stg.3.cox)
>
> each time I tried to look at what is in survtest it gives me this:
>
>
============================================================================
> ==============
> coxph(formula = Surv(pcc.primary.stg.3.cox[, "fup_interval"],
>    pcc.primary.stg.3.cox[, "endpoint"]) ~ pcc.primary.stg.3.cox[,
>    "208181_at"], data = pcc.primary.stg.3.cox)
>
>
>                                      coef exp(coef) se(coef)     z 
> p
> pcc.primary.stg.3.cox[, "208181_at"] -1.87     0.154    0.688 -2.72 
> 0.0065
>
> Likelihood ratio test=8.56  on 1 df, p=0.00343  n= 48
>
============================================================================
> ===============
>
> What I wanted to do is to use a matrix to store each "survtest" 
> result, but
> it seems to me there is no data
> structure in R to store the result of coxph into a matrix. I got the
> following code to calculate a P value
> based on "survtest"
> =================================
> z<-survtest$coefficients/sqrt(surv$var)
> p<-2*(1-pnorm(abs(z)))
>
> then, what is the P value thus calculated?
> ===========================================
> The question I have are:
>
> 1. How do I access different parts of coxph result?
> 2. Is there a way to store multiple coxph results into a data 
> structure that
> can be efficiently accessed?
> 3. if I find a list of genes I am interested, are there efficient to 
> plot
> all of them based on the survial data?
>
> Thanks
> Hao Liu, Ph. D
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list