# Testing survival against frequency of some event

I have the following data for 200 cases/subjects:

• time to death over a 15 year period, $t$. A datum with a value of 180 months means that the subject did not die over the 15 year period.
• the frequency of three particular types of event associated with each subject $a_{i}$, $b_{i}$ and $c_{i}$,

Apart from the obvious survival statistics and KM curves, how can I test the association between $t$ and each of $a_{i}$, $b_{i}$ and $c_{i}$. I am hypothesizing that a profile of $t$ will be distinct for each of $a_{i}$, $b_{i}$ and $c_{i}$.

One way I was thinking of testing this hypothesis was to simply do Pearson's correlation between $t$ and each of $a_{i}$, $b_{i}$ and $c_{i}$. I could then visualize this with a scatter plot of $t$ vs each of $a_{i}$, $b_{i}$ and $c_{i}$. Any suggestions on a more sophisticated analysis including variations of KM analysis? Code examples with R appreciated.

-

Do the events of type $a$,$b$,$c$ occur before the start of the follow-up period, or during it? In the latter case I think you would need their exact timing. – Aniko Jun 3 '12 at 16:07
@Aniko all events have been counted before the follow-up period. – user1202664 Jun 3 '12 at 16:22

## 2 Answers

Here is a good way to start in R.

````library(survival)
# Assume your survival data is in the vector time
surv_time <- Surv(time, time < 180)
````

With that you can do the popular Cox Proportional Hazard model

````# a, b, and c are the vectors with frequency data.
summary(coxph(surv_time ~ a+b+c))
````

You will get a complete test of the effect of your 3 variables on the survival. The Cox PH model is

$$\lambda(t|X) = \lambda(t)\exp(X\beta)$$

where $\lambda(t|X)$ is the hazard function, interpreting as the chance of dying at time $t$, and $X$ is a set of measures on the individual. What the model says is that this hazard function can be anything (not necessary exponentially decreasing), but that increase/decrease of the variables in $X$ will increase/decrase the hazard in a proportional way. Variables significant in the test above will tend to multiply or divide the hazard a lot.

For a very didactic introduction to this (and many other) topic, I recommend Frank Harrell's Regression Modeling Strategies.

-

Thanks but I suppose I'm looking for something that is alternative to or extends Cox PH – user1202664 Jun 3 '12 at 16:30
Why so? Anything wrong with Cox PH, or you are looking for complementary alternatives? – gui11aume Jun 3 '12 at 16:38
Looking for complementary alternatives. – user1202664 Jun 3 '12 at 19:26

Why not treat this as a competing risks model? The three types of event could be looked at as different outcomes. There is literature on this going back to the 1970s. A lot of recent work has been done by Jason Fine of UNC and Robert Gray. You can look for the Fine-Gray model. The cumulative incidence function is the generalization of Kaplan-Meier to competing risks.

Here is a link for a presentation that give background and other information. http://www.stata.com/meeting/australia09/aunz09_gutierrez.pdf

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 27, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9282538890838623, "perplexity_flag": "middle"}