Re: [R] issues with calling predict.coxph.penal (survival) inside a function

2013-11-18 Thread julian.bothe
Hello, and thanks for the answer. 1) I found a work-around - in the end it is easier than thought before. The only thing you have to do is to have the same variable name with the new values. So if predict(coxph.penal.fit, newdata[subset,]) does not work inside a function, the following works: p

Re: [R] issues with calling predict.coxph.penal (survival) inside a function

2013-11-14 Thread Terry Therneau
Thanks for the reproducable example. I can confirm that it fails on my machine using survival 2-37.5, the next soon-to-be-released version, The issue is with NextMethod, and my assumption that the called routine inherited everything from the parent, including the environment chain. A simple t

Re: [R] issues with calling predict.coxph.penal (survival) inside a function - subset-vector not found. Because of NextMethod?

2013-11-13 Thread Simon Zehnder
Works for me: predicting_function(fit2,test1) 1 2 3 4 5 6 7 -1.0481141 0.1495946 0.4492597 0.4492597 0.9982492 -0.4991246 -0.4991246 Best Simon On 13 Nov 2013, at 15:46, julian.bo...@elitepartner.de wrote: > Hello everyone, >

[R] issues with calling predict.coxph.penal (survival) inside a function - subset-vector not found. Because of NextMethod?

2013-11-13 Thread julian.bothe
Hello everyone, I got an issue with calling predict.coxph.penal inside a function. Regarding the context: My original problem is that I wrote a function that uses predict.coxph and survfit(model) to predict a lot of survival-curves using only the basis-curves for the strata (as delivered