mclements / rstpm2

An R package for generalised survival models
28 stars 11 forks source link

call to offset() in formula is ignored by rstpm2 #12

Closed NickSauve closed 1 month ago

NickSauve commented 5 years ago

Dear Mark,

I am trying to use Royston-Parmar models with the stpm2 function, and it appears the offset() function from package stats is ignored.

What i mean is the two following call to stpm2 return the same model :

fit1<- stpm2(Surv(time , status) ~ offset(age),data=mydata) fit2<- stpm2(Surv(time , status) ~ 1,data=mydata)

while fit1 should have constrained the linear predictor of age to 1, age is instead simply discarded from the model.

Is there a way to make it work ?

mclements commented 1 month ago

@NickSauve : I have belatedly come back to this issue. I believe that this was fixed a while ago. My apologies for the slow response. Sincerely, Mark.