r/rstats • • 13h ago

Trouble running R on positron

6 Upvotes

Been trying to run R on positron. I'm on Windows and have downloaded both but for some reason I'm getting the error message "Cannot execute code because there is no registered runtime for the 'r' language". Not sure what I'm missing. Just spent a couple hours trying to figure it out and can't find any clear answers anywhere so if anyone has any ideas I would be super grateful


r/rstats • • 23h ago

Plotting curves after coxph frailty model and strata()

3 Upvotes

Hello I am asking if anyone is aware of how to draw adjusted cum hazard and survival curves after running a frailty model using coxph. I am using the Surv(start, stop ,event status) framework with gap times. Importantly, I have had to stratify a binary variable as it violated the proportional hazards assumption - using strata(var). The goal is to do curves for the overall sample (showing the two strata), and then separately for each individual variables. I have an interaction and it would be good to plot the hazards of 1 variable versus the actual values of the other variables. Any guidance, particularly code implementation, of this would be very helpful.

I am a clinician and not a statistician, but also not trying to use AI at all as Im against it and dont want to have to use it and then declare it.

I am aware of other setups for example cluster() option for robust standard errors as well as frailtypack, coxme, etc. The curves could be drawn in easily with the cluster() option. However, the research question very much needs a frailty model. Also Ive written out the whole thing based on the frailty findings and Kaplan Meier curves...the findings dont necessarily remain with other modelling options which is a problem.