Skip to main content

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.

Filter by
Sorted by
Tagged with
56 votes
5 answers
56k 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 ...
Marja's user avatar
  • 563
38 votes
1 answer
14k 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 ...
Julie's user avatar
  • 563
37 votes
2 answers
21k 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 ...
user1956609's user avatar
28 votes
1 answer
27k 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 ...
user4673's user avatar
  • 1,661
24 votes
4 answers
5k views

How do survival models "account for censoring"? (Do they?)

Background I'm teaching an intro stats class in our social / health sciences department and I'm finding myself tripped up on something I'd always taken for granted: namely, the claim that survival ...
logjammin's user avatar
  • 739
22 votes
3 answers
17k 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 ...
Rob 's user avatar
  • 623
21 votes
1 answer
26k 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....
Dihan's user avatar
  • 337
20 votes
2 answers
10k 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 ...
danielsbrewer's user avatar
20 votes
3 answers
19k 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 ...
Max Gordon's user avatar
  • 5,996
19 votes
1 answer
3k 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 ...
Jonah Sinick's user avatar
19 votes
3 answers
10k 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 ...
GeorgeOfTheRF's user avatar
18 votes
2 answers
42k 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 ...
elong's user avatar
  • 351
18 votes
2 answers
7k 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 ...
RustyStatistician's user avatar
17 votes
1 answer
15k views

What is the difference between the different types of residuals in survival analysis (Cox regression)?

I am fairly new to survival analysis. I was advised to look up and learn Schoenfeld residuals as part of a model diagnosis to see if the proportional hazard assumption has been satisfied. Whilst ...
gowerc's user avatar
  • 810
17 votes
3 answers
31k 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 ...
Tomek Tarczynski's user avatar
16 votes
3 answers
13k views

How to report hazard ratios from a Cox proportional hazards model in English?

My understanding is that a hazard ratio from a Cox proportional hazards model compares the effect on the hazard rate of a given factor to a reference group. How would you report that to an audience ...
dfrankow's user avatar
  • 3,456
16 votes
2 answers
22k 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 ...
Alexander's user avatar
  • 2,140
16 votes
1 answer
4k 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 ...
ledzep's user avatar
  • 339
15 votes
3 answers
23k 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 ...
stats_newb's user avatar
15 votes
2 answers
8k views

Kaplan-Meier curves seem to say otherwise than the Cox regression

In R, I am doing survival data analysis of cancer patients. I have been reading very helpful stuff about survival analysis in CrossValidated and other places and think I understood how to interpret ...
francoiskroll's user avatar
15 votes
3 answers
2k views

What are the options in proportional hazard regression model when Schoenfeld residuals are not good?

I am doing a Cox proportional hazards regression in R using coxph, which includes many variables. The Martingale residuals look great, and the Schoenfeld residuals ...
jeffalstott's user avatar
14 votes
4 answers
969 views

Cubic splines in Cox model

I have a question about the cubic splines used in the Cox model to test the linearity for the continuous variables. I read that usually the knots chosen are the quantiles. Can you find different ...
user99751's user avatar
  • 209
14 votes
2 answers
59k views

Is there any functional difference between an odds ratio and hazard ratio?

In logistic regression, an odds ratio of 2 means that the event is 2 time more probable given a one-unit increase in the predictor. In Cox regression, a hazard ratio of 2 means the event will occur ...
ATJ's user avatar
  • 1,900
14 votes
1 answer
2k views

proportional hazards model with fixed interval censoring = cloglog GLM with fixed effect of time?

Consider a survival analysis with time-constant coefficients, interval-censored, where the observation intervals are consistent across all individuals (e.g. each individual is observed at the end of ...
Ben Bolker's user avatar
  • 47.3k
14 votes
2 answers
3k views

Does fitting Cox-model with strata and strata-covariate interaction differ from fitting two Cox models?

In Regression Modeling Strategies by Harrell (second edition) there is a section (S. 20.1.7) discussing Cox models including an interaction between a covariate whose main effect on survival we want to ...
Vincent's user avatar
  • 892
13 votes
1 answer
27k views

Understanding coxph output in R

I am attempting to fit a Cox proportional hazard model to my data. I think I have the formula correct but am having trouble understanding the output. I have tried looked through the documentation ...
user avatar
12 votes
2 answers
20k views

How to calculate predicted hazard rates from a Cox PH model?

I have the following Cox PH model: (Time, Event) ~ X + Y + Z I would like to get the predicted hazard rates (i am talking about hazard rates NOT hazard ratios) given specific values of ...
nostock's user avatar
  • 1,517
12 votes
2 answers
7k 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 ...
wcampbell's user avatar
  • 2,217
12 votes
1 answer
11k views

Schoenfeld residuals

In a Cox proportional hazards model with many variables, if the Schoenfeld residuals are not flat for one of the variables, does this invalidate the entire model or can just the poorly-performing ...
jeffalstott's user avatar
11 votes
2 answers
11k 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 ...
Finance's user avatar
  • 111
11 votes
1 answer
768 views

SAS and R produced different results for the same cox ph model on the same data

I have fitted a Cox ph model using both R 4.3.1 and SAS 9.4 with the same data. In SAS, I used Proc phreg, while coxph function ...
Calio Xu's user avatar
  • 123
11 votes
2 answers
14k 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 ...
user avatar
11 votes
1 answer
4k 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 ...
Marcin's user avatar
  • 1,069
11 votes
1 answer
20k views

Schoenfeld residuals - Plain English explanation, please!

I have created a Cox model for lung adenocarcinoma patients. Several variables make up the model and I have assessed whether or not the proportional hazards assumption holds. Using the cox.zph ...
user333336's user avatar
11 votes
4 answers
4k 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, ...
pmgjones's user avatar
  • 5,851
11 votes
2 answers
4k views

Propensity score weighting in Cox PH analysis and covariate selection

Regarding propensity score weighting (IPTW) when doing Cox proportional hazard modeling of time-to-event survival data: I have prospective registry data where we're interested in looking at treatment ...
Kjetil Loland's user avatar
11 votes
2 answers
12k views

What is the relationship between the Harrel's C and the AUC?

I model survival outcomes using a Cox proportional hazards model and want to evaluate model fit. Harrel's concordance index C is defined as the proportion of observations that the model can order ...
tomka's user avatar
  • 6,724
11 votes
1 answer
2k views

Sample size and cross-validation methods for Cox regression predictive models

I have a question I would like to pose to the community. I have recently been asked to provide statistical analysis for a tumor marker prognostic study. I have primarily used these two references to ...
Alexander's user avatar
  • 2,140
11 votes
1 answer
15k 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 ...
Max Gordon's user avatar
  • 5,996
10 votes
3 answers
2k views

How to explain Hazard Ratio in layperson's terms

In the context of a Cox regression, I recently heard someone say that "the hazard ratio of 0.70 between the two treatment groups indicates that, during the whole followup time, of 100 persons in ...
Survival's user avatar
  • 149
10 votes
4 answers
5k 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 ...
Adam Robinsson's user avatar
10 votes
2 answers
25k views

coxph ran out of iterations and did not converge

Yes, I have checked that previous answers to "Ran out of iterations..." questions do not solve my problem. I have fault data on Firefox, 899 faults and 1395 (estimated) censored faults. The ...
Derek Jones's user avatar
10 votes
2 answers
7k views

Calibration of Cox regression survival analysis

To perform calibration of a Cox regression model (i.e. assessing for the agreement between the predicted and the observed outcome), what is the best method to present the accuracy of the model in ...
user32454's user avatar
  • 151
10 votes
2 answers
7k 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 ...
JJM's user avatar
  • 927
10 votes
1 answer
9k views

Calculate incidence rates using poisson model: relation to hazard ratio from Cox PH model

I want to calculate incidence rates to present along hazard ratio's in order to present both relative and absolute measures of risk. I saw in other studies that such incidence rates can be calculated ...
Rob 's user avatar
  • 623
10 votes
2 answers
6k views

Recommendations for Non-Proportional Hazards

This is an issue that has plagued me for a long time and I have found no good answers in textbooks, Google, or Stack Exchange. I have data set of >100,000 patients for which four treatments are ...
Ryan W.'s user avatar
  • 123
10 votes
1 answer
5k views

How to generate survival data with time dependent covariates using R

I want to generate survival time from a Cox proportional hazards model that contains time dependent covariate. The model is $h(t|X_i) =h_0(t) \exp(\gamma X_i + \alpha m_{i}(t))$ where $X_i$ is ...
Sheikh's user avatar
  • 398
10 votes
1 answer
3k views

Comparison of CPH, accelerated failure time model or neural networks for survival analysis

I am new to survival analysis and I've recently learned that there are different ways to do it given a certain goal. I am interested in actual implementation and appropriateness of these methods. I ...
Final Litiu's user avatar
10 votes
1 answer
3k views

Error “system is computationally singular” when running cox.zph for a Cox Model

I have built an extended Cox Model in R, with time-dependent covariates, as described in this R vignette. I have built the model by running the following: ...
Mateus's user avatar
  • 101
9 votes
2 answers
31k views

stratification in cox model

I am trying to understand difference in output between the following lines of code: ...
user1700890's user avatar

1
2 3 4 5
36