[R] survival::survfit,plot.survfit
Bernhard Reinhardt
bernhard.reinhardt at dlr.de
Tue Mar 3 12:29:36 CET 2009
You are right. In my case it doesn´t make much difference since the mean
of my covariates is about 0.
I made some more plots and again I´m confused. I thought when forcing
all covariates via the newdata argument to be zero I would get the
baseline function since the "linear predictor" is then zero, too.
As I pointed out in another post I´m trying out models with different
number of covariates on the same data. For example I use a model with
only one covariate. The mean of this covariate is 0.01. So the curves of
surv <- survfit(coxsst4_full)
and
attach(nino4)
newS4 <- data.frame(S5=0.)
detach()
new_surv <- survfit(coxsst4, newdata=newS4)
differ very slightly.
Of course also the mean curves for models with more then one covariate
differe slightly from the "Zero"-curve.
BUT shouldn´t the "Zero"-curves for all models be the same?
#Two models
coxsst4 <- coxph(Surv(schaeden)~ S5, data=nino4)
coxsst4_full <- coxph(Surv(schaeden)~ 0+S1+S2+S3+S4+S5+S6+S7+S8+S9+S10,
data=nino4)
#Set all covariates 0
attach(nino4)
newS4 <- data.frame(S0=0., S1=0., S2=0., S3=0., S4=0., S5=0., S6=0.,
S7=0., S8=0., S9=0., S10=0.)
detach()
new_surv1 <- survfit(coxsst4, newdata=newS4)
new_surv2 <- survfit(coxsst4_full, newdata=newS4)
Yields two different curves. What did I get wrong?
Regards
Bernhard
Terry Therneau wrote:
>> plot(survfit(fit)) should plot the survival-function for x=0 or
>> equivalently beta'=0. This curve is independent of any covariates.
>
> This is not correct. It plots the curve for a hypothetical subject with x=
> mean of each covariate.
> This is NOT the "average survival" of the data set. Imagine a cohort made up
> of 60 year old men and their 10 year old grandsons: the expected survival of
> this cohort does not look that for a 35 year old male.
>
> Terry T
>
More information about the R-help
mailing list