If anyone wants to invest some time this could change title to "differences between all those sums" and give a canonical answer. stackoverflow.com/q/9676212/680068
@zx8754 I have done so, not sure if that is what your were looking for exactly. there are many other ways that can be done in R including data.table and tidyverse notations
Right, this can also be done ) I probably would not add rowsum, as question is about column. cumsum is not different from sum. If you have an example of good canonical answer, it would be useful
But doesn't mean it won't happen to you, just lower risk. There are many patients in our database with zero family history of any cancer but still with prostate cancer.
@Jaap usually "we" tlak in term of risk factors and so you have the "baseline" = normal risk, same for everyone, so it's more about assessing how higher the risk is in the presence of a risk factor. But of course, technically, if you don't possess the risk factor you have a lower risk compared to someone who has it
"baseline" = normal risk: Also means we still got a lot to learn about the cancer. In an ideal world baseline should be 0. Then we can say if you don't/do have X, Y and Z, then your risk is zero.
About cancers I think about radioactivity, and as there's a 'general radioactive noise' on earth, I assume a risk 0 doesn't exists (I.e: the ideal world has 0 environment risk factor ?)
@zx8754 the above line is not elegant and still pb of coercing numeric columns into character but it should be pretty good for a codegolf competition ;-)