
Basic Survival Methods in R - antipaul
https://github.com/pavopax/gists/blob/master/survival-in-R.md
======
larrydag
Here is a great application of using Survival Analysis in p2p lending.

[http://blog.lendingrobot.com/research/predicting-the-
number-...](http://blog.lendingrobot.com/research/predicting-the-number-of-
payments-in-peer-lending/)

I built a model in R using this method.

------
devereaux
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!

~~~
antipaul
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.

~~~
devereaux
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.

~~~
arkades
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.

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

~~~
arkades
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.

~~~
devereaux
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.

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

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

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

------
twic
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.

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

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

