Hello everybody,
I seem to get different results whether coxph is in a function or a call it
interactively
Is there an explanation? Do I do something wrong?
Here is an example :
> dd[,1:2]
age tumsize
1 32.81862 7.0
2 38.49966 9.0
3 52.00821 6.0
4 44.60780 5.0
.......... 107 rows
> fit1_coxph(Surv(dftime,dfcens)~dd[,1],data=dd)
> fit1
Call:
coxph(formula = Surv(dftime, dfcens) ~ dd[, 1], data = dd)
coef exp(coef) se(coef) z p
dd[, 1] -0.0173 0.983 0.0101 -1.72 0.086
Likelihood ratio test=2.93 on 1 df, p=0.0872 n= 107
> fit2_coxph(Surv(dftime,dfcens)~dd[,2],data=dd)
> fit2
Call:
coxph(formula = Surv(dftime, dfcens) ~ dd[, 2], data = dd)
coef exp(coef) se(coef) z p
dd[, 2] 0.356 1.43 0.0761 4.68 2.8e-06
Likelihood ratio test=20.2 on 1 df, p=6.93e-06 n= 107
> junk
function(i)
{
fit <- coxph(Surv(dftime, dfcens) ~ dd[, i], data = dd)
return(i, dd[, i], fit)
}
> junk(1)
$i:
[1] 1
$"":
[1] 32.81862 38.49966 52.00821 44.60780 55.26352 30.99795 70.04244
75.31280
[9] 70.81177 46.63107 40.75838 .....
.....
$fit:
Call:
coxph(formula = Surv(dftime, dfcens) ~ dd[, i], data = dd)
coef exp(coef) se(coef) z p
dd[, i] 0.356 1.43 0.0761 4.68 2.8e-06
Likelihood ratio test=20.2 on 1 df, p=6.93e-06 n= 107
Please, note, that while the variable on which the modeling is done is 1,
the results are from variable 2!
I use:
S-PLUS : Copyright (c) 1988, 1999 MathSoft, Inc.
S : Copyright Lucent Technologies, Inc.
Version 5.1 Release 1 for Sun SPARC, SunOS 5.5 : 1999
I appreciate any ideas. Thank you.
melania
Melania Pintilie
OCI/PMH - Biostatistics
610 University Ave.
Toronto, ON, M5G 2M9
Tel: (416) 946-4501 ext. 4886
Fax: (416) 946-2048
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|