[R] problem concernig Survsplit, package survival

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Sat Aug 20 22:31:07 CEST 2016


Your link did not take me to the code you reference... Google does not make entire books available online which may have something to do with my difficulty.  This is one reason the Posting Guide asks you to post a self-contained, reproducible example. Your use of HTML format in your posting to the list was also a making it hard to follow. 

I did find a ZIP file at [1], and the arguments do not conform to the survSplit documentation. Since I have not been a user of this package over time, I don't know whether this is due to changes in the argument list or a simple error on the part of the author... but I suspect the latter because the missing formula specification seems intrinsic to the intent of the function. 

Someone else may chime in with a more conclusive comment, but I would recommend finding a different tutorial on the topic, or corresponding with Mr.Wollschlaeger.

[1] http://www.dwoll.de/r/gddmr/wollschlaeger_r_all.zip
-- 
Sent from my phone. Please excuse my brevity.

On August 19, 2016 4:21:31 AM PDT, "Vinzenz Völkel via R-help" <r-help at r-project.org> wrote:
>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]]
>
>
>
>------------------------------------------------------------------------
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list