i am new here but i have the feeling, i will be around for some time. Off to my question now

I am currently doing a survival analysis between two groups of patients that either received an event (surgery) or not. I want to find out, how this affects different survival endpoints. Now i did all regular analyses with KM, COx regression etc.

Now i want to do an inverse probability treatment weighting and recalculate the association on survival. I calculated the ITPW and wanted did some KMs, but i can not find the proper way to calculate for significance.

First, i used stata:

stset timedeath [pw=iptw], fail(css)

sts graph, by(cn)

sts test (cn)

In this, stata switched to cox regression naturally, which is fine. However, proportional hazard assumption is significant (estat phtest) and visibly, the KM curves cross multiple times. I did some digging and found out, that Renyis test is good for crossing KMs. So i switched to R. But i could not find a way to include the IPTW in the survMisc package command for Renyis test.

data("nciptw", package="survMisc")

g1 <- ten(Surv(time, event) ~ group, data=ncitpw)

comp(g1)

I did try the IPWsurvival package in R as well, but i am not sure it is feasable when dealing with crossed KM curves.

adjusted-LR(time,event,group,iptw)

can someone maybe help me? Is there a way to incorporate the IPTW in the survMisc package? is IPWsurvival a correct way to do this? or is there another way in stata or R to get the necessary results?

I would be very glad, if someone could help me. And i hope this is in the right subsection. I am more than happy to provide additional information.

I wish you a great rest of the week for now

Cheers,