Hacker News new | past | comments | ask | show | jobs | submit login
Basic Survival Methods in R (github.com/pavopax)
103 points by antipaul on Oct 13, 2017 | hide | past | favorite | 15 comments



Here is a great application of using Survival Analysis in p2p lending.

http://blog.lendingrobot.com/research/predicting-the-number-...

I built a model in R using this method.


Survival methods are very versatile, offer great insights and can be extended.

These are just basic statistics, and quite old methods too (Cox proportional hazards) but still extremely handy to know and use in 2017. I have been learning them since this fall. I haven't been disappointed.

However, for survival analysis, I personally use SAS at the moment.

Its proc phreg offers many weighting options out of the box. I have been warned R packages currently require more elbow grease. It seems easier to learn this way, with "training wheels".

I created a custom made bridge to integrate the ODS output with Rstudio (sasmarkdown didn't cut it for me) but I will be happy to go back to vanilla R once I have everything clear in my head!


> but still extremely handy to know and use in 2017

Dude, you're seriously understating this as if it's antiquated but useful.

It's used in immensely in bio field and disease and any thing that require time to event (reliability).

It's an "old" method in so far as when it was created but still relatively new and in late 90s or so people are still pushing survival analysis (example: Counting theory was used recently to prove certain things about survival analysis.) There are still new method of CIs and tests. And survival trees.

Also IIRC Cox model papers is one of the highly most cited paper either in a med field or overall I forgot.


Depends what you are familiar with. Once you learn tidyverse in R, you won’t want to go back to SAS.

But initially, if you have say 20 years of SAS, then yea, SAS will be easier for you and it may or may not be worth switching to R.


I have not that much experience with SAS. I first played with it for 6 months several years ago, then again for 3 months a few years ago in very specific jobs (what fun it is to be cleaning data with a pure SAS proc instead of using perl - ouch!)

I have spent much more time with R, but this class is taught with SAS and it objectively shows some advantages that SAS still has today - in the case I was talking about, if you don't want just a log rank test but something more exotic without writing any code, SAS just has it.

Considering how SAS refuses to die, it is interesting to learn with it, before finding a way to do the same in R, as I am likely to encounter some SAS code again!

But in a few weeks, I plan to recode all the examples I see in pure R.


Ugh, I hate SAS. So much of your time spent on SAS is spent on exactly that: the idiosyncracies of SAS (why is input labeled "cards", professor? Oh, because folks have been working on SAS in one way or another since data was still using punch cards...).

R does take more work, but at least it's with generalizable skills. I detest spending my time learning something that can only be used in its narrow niche.


Alternatively, narrow niches offer many other possibilities for selling skills :-)


Fair, but I think "statistician with a strong general programming bsckground" is actually less common than "statistician with a strong SAS background." Its narrow, but common in that niche.


Indeed!

BTW I just submitted a link to show HN how I include SAS code inside Rstudio. It is a bit ugly but it does the job. If you still need to do some SAS it could be helpful to you.


I read the title as meaning "Survival Guide to R" which would imply a much broader scope that what was presented on survival analysis. :)


"I left stringsAsFactors=True and survived to tell the tale!"


‘True’ not ‘TRUE’? Outed, Pythonista!


I honestly thought this was going to be a basic howto about how to survive using R, perhaps aimed at Pandas users or other such sensitive souls.


Have to say that for once I prefer the base R style graphs. There's something so old school scientific about them.


You can customize R graphs anyway to make them look exactly the way you want (especially with ggplot).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: