Re: [R] help with parsing multiple coxph() results

2006-01-17 Thread Hao Liu
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:[EMAIL PROTECTED] 
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" <[EMAIL PROTECTED]>
To: 
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.1540.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@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
>

__
R-help@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


[R] help with parsing multiple coxph() results

2006-01-17 Thread Hao Liu
Thanks for your reply, but I am not sure if I understand your reply right:
 
are you saying the "geneid" in  your post is a vector of all 22283 genes? I
want to do cox fit to each and everyone of the 22283 genes and need a way to
summarize it -- to do that, I need to know how to parse the result for each
coxph result.
 
Thanks
Hao

[[alternative HTML version deleted]]

__
R-help@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


Re: [R] help with parsing multiple coxph() results

2006-01-17 Thread Fredrik Lundgren
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" <[EMAIL PROTECTED]>
To: 
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.1540.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@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
>

__
R-help@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


[R] help with parsing multiple coxph() results

2006-01-17 Thread Hao Liu
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.1540.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@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