<p>Hi,</p>

<p>I have done survival analysis on a gene, using the coxph call and saved it in a variable <code>a</code>.  I know i can do summary(a) and get a return with the coef, exp(coef), se(coef) and power- p-value.  I want to take JUST the p-value out of a to put into a a matrix.   </p>

<p>So essentially is there a way of accessing  just the p-value form a coxph object , e.g. coefVal &lt;- a$coef gives me the coef value.. ?</p>

<p>Thanks,
R</p>

<p>Assign coef summary to a variable</p>

<pre><code>coeffs &lt;- coef(summary(a))
</code></pre>

<p>coeffs should be something like this:</p>

<pre><code>Estimate  Std.    Error    z    value    Pr(&gt;|z|)
(Intercept)    -3.86370076    0.71438758    -5.40840977    6.358681e-08
A    20.62019096    264.13705493    0.07806626    9.377753e-01
B    4.00226650    0.71574200    5.59177257    2.247631e-08
C    4.50171396    0.71849626    6.26546610    3.717119e-10
...
</code></pre>

<p>Subset 4th column as P is 4th column in this example:</p>

<pre><code>as.matrix(coeffs[,4])
    [,1]
(Intercept)    6.358681e-08
A    9.377753e-01
B    2.247631e-08
C    3.717119e-10
...
</code></pre>
