Skip to content
Prev 363455 / 398502 Next

problem concernig Survsplit, package survival

I'm not posing as having conclusive knowledge about the history of survSplit. (I did look at survival package's NEWS file and could not find an answer to when the syntax might have changed. I'm guessing its been that way for at least 9 years, since that seems to be how far back the NEWS file covers.)

The survival.Rdata file in that already has both a dfSurv and a dfSurvCP which explains the possibility of seeing the head of that second object despite an error during an effort at creation.

It is possible to construct a new dfSurvCP by fixing the error that Jeff points out (a non-formula argument):

dfSurvCP <- survSplit( Surv(obsT,status) ~ . , data=dfSurv, cut=seq(30, 90, by=30), end="obsT",
                      event="status", start="start", id="ID", zero=0)

You then get no error and the results agree with the provided dataset:
sex          X IV Xcut ID start obsT status
1   f -1.3130607  A   lo  1     0   30      0
2   f -1.3130607  A   lo  1    30   60      0
3   f -1.3130607  A   lo  1    60   63      1
4   m -0.1384786  A   lo  2     0   25      1
5   m -0.3846335  A   lo  3     0   30      0
6   m -0.3846335  A   lo  3    30   60      0
7   m -0.3846335  A   lo  3    60   73      1

The cited text does not appear to be focussed on survival analysis but rather "data management" (my non-German speaker's guesswork translation of the title "Grundlagen der Datenanalyse mit R" since I read "Grundlagen" as "ground layer" , i.e "Foundations")

Hope this helps;
David.
David Winsemius
Alameda, CA, USA