therneau / survival

Survival package for R
394 stars 106 forks source link

Very long variable names crash model comparison via `anova` #284

Closed FBartos closed 1 week ago

FBartos commented 1 month ago

Using a very long variable names in the Surv() portion of the formula crash the test for "equal" outcomes in the anova function (the reason is the outcome is split across multiple lines when parsed from the formula.

library(survival)
ovarianB <- ovarian
ovarianB$futime________________________long <- ovarianB$futime
fit  <- coxph(Surv(time = futime________________________long, event = fustat, type = "right") ~ resid.ds *rx + ecog.ps, data = ovarianB) 
fit2 <- coxph(Surv(time = futime________________________long, event = fustat, type = "right") ~ resid.ds +rx + ecog.ps, data = ovarianB)
anova(fit2,fit)
therneau commented 1 week ago

Now repaired. Replace deparse with deparse1

FBartos commented 1 week ago

thanks!