I did coxph for my data and get result like this:
> z
Call:
coxph(formula = Surv(Years, Event) ~ y, data = x)
coef exp(coef) se(coef) z p
y 0.0714 1.07 0.288 0.248 0.8
Likelihood ratio test=0.06 on 1 df, p=0.804 n= 65, number of events= 49
I just want to save
y 0.0714 1.07 0.288 0.248 0.8
into a file. Because I do permutation and generate 1000 z.
I want to save them into a text file like this:
fin -0.3794 0.684 0.1914 -1.983 0.0470 age -0.0574 0.944 0.0220 -2.611 0.0090 race 0.3139 1.369 0.3080 1.019 0.3100 wexp -0.1498 0.861 0.2122 -0.706 0.4800 mar -0.4337 0.648 0.3819 -1.136 0.2600 paro -0.0849 0.919 0.1958 -0.434 0.6600
Anyone can help?
Thanks!
The coefficients are easily accessed by
and the confidence interval information by
To find out what the components of a
summary.coxphobjectMy advice would be to create a list of your permutations
Then call
Which creates a list of models
You can create the summaries by
Extract the coefficients
Add a permutation id column (if you want)
Then combine into a data.frame
Which you than then save as a text file