# Cox Regression - time dependent

#### martinki

##### New Member
Dear all,

I have a question regarding the cox regression.

I have conducted a dataset with Top50 Boxoffice Data for the U.S market. It contains data on how long a movie has been in the Top50, and I am interested in the survival rates of movies in the Top50. As my data begins in 2000 and ends in 2015, some things have changed in the movie exhibition, especially the digitalization of cinemas, and I want to test if this had any impact on the survival rates. Therefore I want to do a Cox Regression, but I am not sure how to perform it, as not every movie started at the same moment.
I have also a continous monthly variable on the measure of digitalization of theaters, which I want to fit in the regression as I am interested if digitalization had any impact on the survival rate. I did a screenshot of my dataset which can be seen here: http://imgur.com/lfMgfBi

So my question is how can I perform a Cox analysis which is dependent on different starting times and measures of digitalization in cinemas?

best Martin

#### maartenbuis

##### TS Contributor
Here is a silly example of two films, one starting a month after the first. In order to include time varying covariates you add a row for each time unit where one of the variables changes:

Code:
film date     died  digitalization
1    2000m1 0     .4
1    2000m2 0     .6
1    2000m3 0     .5
1    2000m4 1     .7
2    2000m2 0     .6
2    2000m3 0     .5
2    2000m4 0     .7
2    2000m5 0     .8
2    2000m6 1     .9
You will need to tell your favourite piece of software which rows belong together, but the details there depend on what software you want to use.

#### martinki

##### New Member
For simplicity, because most films just run a few weeks and within the weeks digitalization did not change significantly, I chose to aggregate my data so I just have single observations for every movie.

So more or less I just create a time variable as you did in the example, and run the normal Cox regression with time and digitalization as categorial covariates? Am I right with this assumption? I am using SPSS!