# Questions tagged [cox-model]

Cox proportional hazards regression is a semi-parametric method for survival analysis. No distributional form needs to be assumed, only that the effect of one-unit increase in a covariate is a constant multiple.

119 questions
Filter by
Sorted by
Tagged with
38k views

### Prediction in Cox regression

I am doing a multivariate Cox regression, I have my significant independent variables and beta values. The model fits to my data very well. Now, I would like to use my model and predict the survival ...
11k views

### Backward selection for Cox model using R

I want to perform an exploratory Cox regression analysis of medical data using R. I am practicing using the pbc data from the survival function. Would you recommend performing a backward selection ...
14k views

### Time dependent coefficients in R - how to do it?

Update: Sorry for another update but I've found some possible solutions with fractional polynomials and the competing risk-package that I need some help with. The problem I can't find an easy way to ...
18k views

### Interpretation and validation of a Cox proportional hazards regression model using R in plain English

Can someone explain my Cox model to me in plain English? I fitted the following Cox regression model to all of my data using the cph function. My data are saved ...
8k views

### Does Cox Regression have an underlying Poisson distribution?

Our small team was having a discussion and got stuck. Does anyone know whether Cox regression has an underlying Poisson distribution. We had a debate that maybe Cox regression with constant time at ...
18k views

### Cox baseline hazard

Let's say I have a "kidney catheter" data set. I'm trying to model a survival curve using a Cox model. If I consider a Cox model: $$h(t,Z) = h_0 \exp(b'Z),$$ I need the estimate of the baseline hazard....
589 views

### Textbook approach to modeling non-proportional hazards in the Cox model

In Cox models with time varying coefficients, the effect of covariates on the hazard is allowed to change through time. In cases where a coefficient has a linear relationship with time, I am aware of ...
12k views

### How to create a toy survival (time to event) data with right censoring

I wish to create a toy survival (time to event) data which is right censored and follows some distribution with proportional hazards and constant baseline hazard. I created the data as follows, but I ...
1k views

### Why are p-values often higher in a Cox proportional hazard model than in logistic regression?

I've been learning about the Cox proportional hazard model. I have a lot of experience fitting logistic regression models, and so to build intuition I've been comparing models fit using ...
2k views

### Relative importance of variables in Cox regression

I've understood that relative importance of predictors is a tricky question. Suggested methods range from very complex models to very simple variable transformations. I've understood that the ...
588 views

### Why and how does adding an interaction term affects the confidence interval of a main effect?

I was wondering why, in a regression model including an interaction term, the confidence interval of one of the main effects becomes wider. Consider this Cox regression, where the variable IR_BMI27 ...
16k views

### How to interpret the output of predict.coxph?

After fitting a coxmodel it is possible to make predictions and retrieve the relative risk of new data. What I don't understand is how the relative risk is computed for an individual and what is it ...
4k views

### Layman's explanation of censoring in survival analysis

I have read about what censoring is and how it needs to be accounted for in survival analysis but I would like to hear a less mathematical definition of it and a more intuitive definition (pictures ...
6k views

### How to use time dependent covariates with cox regression in R

I don't know how to generate time dependent covariates in R for use cox regression. I know you need to reorganize your dataset into intervals between event times. This I believe I can do with the ...
5k views

### How to validate Cox Proportional Hazards model?

I'm using a Cox proportional Hazards regression (R survival package) to model Credit card activation propension, ie, which people are more likely to make their first buy? To give more context: ...
15k views

### In survival analysis, why do we use semi-parametric models (Cox proportional hazards) instead of fully parametric models?

I've been studying the Cox Proportional Hazards model, and this question is glossed over in most texts. Cox proposed fitting the coefficients of the Hazard function using a partial likelihood ...
28k views

### Cox model vs logistic regression

Let's say we are given the following problem: Predict which clients are most likely to stop buying in our shop in next 3 months. For each client we know the month when one started to buy in our ...
7k views

### How can machine learning models (GBM, NN etc.) be used for survival analysis?

I know that traditional statistical models like Cox Proportional Hazards regression & some Kaplan-Meier models can be used to predict days till next occurrence of an event say failure etc. i.e ...
7k views

### What is the “$R^2$” value given in the summary of a coxph model in R

What is the $R^2$ value given in the summary of a coxph model in R? For example, Rsquare= 0.186 (max possible= 0.991 ) I foolishly included it a manuscript as ...
6k views

### Precisely how does R's coxph() handle repeated measures?

Context I'm attempting to understand how R's coxph() accepts and handles repeated entries for subjects (or patient/customer if you prefer). Some call this Long format, others call it 'repeated ...
2k views

### Extended Cox model and cox.zph

I have previously had experience only with Cox PH model and its assumptions checking. Now for the first time I have my clients data with most of the covariates varying in time, only a few are fixed ...
18k views

### How to estimate baseline hazard function in Cox Model with R

I need to estimate baseline hazard function $\lambda_0(t)$ in a time dependent Cox model $\lambda(t) = \lambda_0(t) \exp(Z(t)'\beta)$ While I took Survival course, I remember that the direct ...
6k views

### What is a “good fit” Brier score and Harrell's C Index

This is a question I originally posted on r-help but it is more suited here. I will post the question and the answer I received from Dr. Winsemius and would be most grateful for any additional answers ...
10k views

### Cox proportional hazard model and interpretation of coefficients when higher case interaction is involved

Here is the summary-output of the Coxph-model I used (I used R and the output is based on the best final model i.e. all significant explanatory variables and their interactions are included): ...
3k views

### Adjust for everything you have in propensity score?

I have a methodological question, and therefore no sample dataset is attached. I'm planning to do a propensity score adjusted Cox regression that aims to examine whether a certain drug will reduce ...
9k views

### Computing c-index for an external validation of a Cox PH model with R

First off, I'll state that I'm aware many questions get asked about the c-index. I've searched this site and others, and I haven't found an answer for my situation. I can successfully use ...
3k views

### What’s wrong with this way of fitting time-dependent coefficients in a Cox regression?

I have a Cox proportional hazards model. Judging by Schoenfeld residual vs. time plots and corresponding tests for zero slope, there is clear violation of the PH assumption for several of the ...
430 views

### How to compute gradient of partial log-likelihood function in Cox proportional hazards model?

The partial log-likelihood function in Cox proportional hazards is given with such formula {}_{p}\ell(\beta) = \sum\limits_{i=1}^{K}X_i'\beta - \sum\limits_{i=1}^{K}\log\Big(\sum\limits_{l\in \...
2k views

### How to generate predicted survivor curves from frailty models (using R coxph)?

I want to compute predicted survivor function for a Cox proportional hazards model with frailty terms [using survival package]. It appears that when frailty terms are in the model, the predicted ...
2k views

### How to assess the proportional hazards assumption for a continous variable

I am having a problem with checking the assumptions for a continuous variable in a proportional hazards model. If a variable were a factor with many levels, then I could use the logrank test or check ...
634 views

### Violation of the proportional hazard assumption, interaction with time. Am I taking the correct steps?

I will try to keep my question as short as possible. For my thesis I am researching if a risk score can predict graft failure in a cohort of $596$ patients over the course of $10$ years. (The ...
2k views

### Proportional hazards assumption and time-dependent covariates

Is there a way to check that the proportional hazards assumption is correct for a Cox model with time-varying covariates ?
3k views

### Interval censored Cox proportional hazards model in R

Given interval censored survival times, how do I perform an interval censored Cox PH model in R? An rseek search turns up the package ...
1k views

### Time-dependent coefficients in cox regression CPH (RMS)

I found in the R vignettes a nice article about perform time transformations in coxph (R function, package survival). This works fine for me in coxph, but I need to use cph (RMS package) because of ...
75 views

### log transform fixed PH in Cox model - how?

I have survival data to which I am fitting a Cox model with a continuous predictor. The cumulative martingale residual method (supremum test) of Lin, Wei and Ying suggested that both proportional ...
2k views

### Best packages for Cox models with time varying covariates

I am working on a project using Cox models with time varying covariates. My questions are: What are some good examples of conducting this analysis? What is the best R package to conduct this analysis?...
400 views

### Cox PH model: managing continuous variables and linearity assumption

In an epidemiological study, I'm using martingale plot to assess the linearity of continuous variables. Here are the Martingale Residuals (from Null Model) using R's ...
802 views

### Cox Model and proportional hazards

I'm trying to fit a Cox model, but there is some problems. I have the following variables in the model. Group: 1, 2, ..., 9 Sex: 1 female and 0 male Weight Age The first thing that I did is split ...
127 views

### Hazard ratio for more than two groups

Consider the line of code below for implementing Cox model in R and finding the hazard ratio: fitcox <- coxph(Surv(Survival,Death) ~ clusters, data = data) ...
53 views

### Cox regression different results with different combinations of variables

I need help understanding how to use cox hazzard model to calculate risk of death in data from a cohort study. I have a set of data on physical activity and I want to do a cox regression on ...
8k views

### How to get predictions in terms of survival time from a Cox PH model?

I want to develop a prediction model (Cox PH) for all-cause mortality in a dataset of participants of whom (almost) all have died at the end of follow-up (e.g. 1-year). Instead of predicting the ...
10k views

### Different prediction plot from survival coxph and rms cph

I've created my own slightly enhanced version of the termplot that I use in this example, you can find it here. I've previously posted on SO but the more I think about it I believe that this probably ...
4k views

### Using multiple imputation for Cox proportional hazards, then validating with rms package?

I've been researching the mice package, and I haven't yet discovered a way to use the multiple imputations to make a Cox model, then validate that model with the rms package's ...
8k views

### Which model should I use for Cox proportional hazards with paired data?

I am hoping someone can help me with which model (frailty, strata or cluster) I should use for my data. I have paired data so I need to take that into account when modelling the Cox PH and am unsure ...
3k views

### How best to analyze length of stay data in a hospital-based RCT?

I am interested in knowing whether or not there is a consensus about the optimal way to analyze hospital length of stay (LOS) data from a RCT. This is typically a very right-skewed distribution, ...
5k views

### Interpreting R coxph() cox.zph()

The results of my coxph() are significant, yet the cox.zph() test is significant too. From my understanding of it, the ...
427 views

### Cox proportional model with multiple failures for same subjects

I have a dataset that I'm trying to model using Cox proportional hazard models. The data include patient IDs and several attributes about the patients (including time till failure). Due to the nature ...
4k views

### Determine if a time-dependent Cox model is appropriate

Before the description, here are my questions (1) Is the set-up of my time-dependent data correct? (2) Are the ways I run my Cox proportional hazard model with a time-dependent variable/ non time-...