goranbrostrom / eha

eha
6 stars 1 forks source link

The Log-Rank Test #8

Closed w1806291 closed 3 years ago

w1806291 commented 3 years ago

Can anyone help me with this code? I have loaded the survival and eha packages.

with(oldmort, plot(Surv(enter, exit, event), strata = sex))

I get an error:

"strata" is not a graphical parameter "strata" is not a graphical parameter "strata" is not a graphical parameter "strata" is not a graphical parameter "strata" is not a graphical parameter "strata" is not a graphical parameter

Thanks,

goranbrostrom commented 3 years ago

With the latest version of eha, you can use the new function 'logrank':

fit <- logrank(Surv(enter, exit, event), group = sex, data = oldmort) plot(fit) plot(fit, fn = "sur")

Note that the function eha:::plot.Surv was removed from eha in version 2.6.0, and the reason was the introduction of the function survival:::plot.Surv in the survival package. Unfortunately this means that you need to learn new arguments... when using plot.Surv.

w1806291 commented 3 years ago

Thanks