[R] problem concernig Survsplit, package survival

Vinzenz Völkel vin.voelkel.2 at googlemail.com
Fri Aug 19 13:21:31 CEST 2016


Dear R-help-community,

 

I hope, that’s the appropiate channel to post a quastion?

 

For some days I have been struggling with a problem concerning the
„survSplit“-function of the package „survival“. Searching the internet I
have found a pretty good -German- description of Daniel Wollschläger
describing how to use survSplit:

 

(https://books.google.de/books?id=9G4oBgAAQBAJ
<https://books.google.de/books?id=9G4oBgAAQBAJ&pg=PA345&lpg=PA345&dq=daniel+
wollschl%C3%A4ger+survsplit&source=bl&ots=ajPgInB83d&sig=noQIAXMWe6oQJ-LwsTC
kroWdwHQ&hl=de&sa=X&ved=0ahUKEwiqwoX8q83OAhVlM5oKHSMGDrEQ6AEIHjAA#v=onepage&
q=daniel%20wollschl%C3%A4ger%20survsplit&f=false>
&pg=PA345&lpg=PA345&dq=daniel+wollschl%C3%A4ger+survsplit&source=bl&ots=ajPg
InB83d&sig=noQIAXMWe6oQJ-LwsTCkroWdwHQ&hl=de&sa=X&ved=0ahUKEwiqwoX8q83OAhVlM
5oKHSMGDrEQ6AEIHjAA#v=onepage&q=daniel%20wollschl%C3%A4ger%20survsplit&f=fal
se

 

Mr. Wollschläger also provides the dataset, all of the code he used and an
excerpt of his output:

 

 

> library(survival) # für survSplit()

> dfSurvCP <- survSplit(dfSurv, cut=seq(30, 90, by=30), end="obsT",

+ event="status", start="start", id="ID", zero=0)

# sortiere nach Beobachtungsobjekt und linken Intervallgrenzen

> idxOrd <- order(dfSurvCP$ID, dfSurvCP$start)

> head(dfSurvCP[idxOrd, ], n=7)

obsT    status sex      X                     IV        start     ID

1          30        0          f           -1.3130607     A         0
1

181      60        0          f           -1.3130607     A         30
1

361      63        1          f           -1.3130607     A         60
1

10        11        1          f           -1.2282824     A         0
10

100      27        1          m         -0.1018403     B         0
100

101      30        0          m         -0.4079027     B         0
101

281      42        1          m         -0.4079027     B         30
101

 

 

Unfortunaltely when I tried to copy Mr. Wollschlägers operations using his
very dataset, RStudio just returned the following error-message:

 

> dfSurvCP2 <-
survSplit(dfSurv,cut=seq(30,90,by=30),end="obsT",event="status",start="start
",id="ID",zero=0)

Error in formula.default(eval(parse(text = x, keep.source = FALSE)[[1L]])) :


  invalid formula

 

I tried to figure out what’s wrong, but so far didn’t find any solutions… I
would be very glad if anyone could help me out here.

 

vhfv

 


	[[alternative HTML version deleted]]



More information about the R-help mailing list