Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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
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
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
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
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
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
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
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
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

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
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
9 votes
3 answers
17k 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 ...
JJM's user avatar
  • 927
9 votes
4 answers
4k views

How do I interpret a Cox hazard model survival curve?

How do you interpret a survival curve from cox proportional hazard model? In this toy example, suppose we have a cox proportional hazard model on age variable in <...
Haitao Du's user avatar
  • 37.3k
9 votes
2 answers
11k views

Survival analysis in R with left-truncated data

I am doing a survival analysis in R with the survival package. I think I am working with left-truncated data, but I'm not entirely sure how to handle it. I have a ...
user3766836's user avatar
9 votes
1 answer
11k 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): ...
Unna's user avatar
  • 91
9 votes
1 answer
16k views

How to get the p-value for the full model from R's coxph?

In a coxph model with 2 variables (let's say age and sex), how can I get the p-values for LR, Wald and score tests which I see in the summary(coxphobject) as below? ...
user5054's user avatar
  • 1,579
9 votes
2 answers
2k views

Which model to use for survival analysis when there are different times of entry into the sample?

I have a data set containing the trades executed by many traders as follows: ...
finstats's user avatar
  • 293
9 votes
2 answers
2k views

Large scale Cox regression with R (Big Data)

I am trying to run a Cox regression on a sample 2,000,000 row dataset as follows using only R. This is a direct translation of a PHREG in SAS. The sample is representative of the structure of the ...
xbsd's user avatar
  • 805
9 votes
1 answer
2k views

Structure of data and function call for recurrent event data with time-dependent variables

I'm attempting to estimate the effect of 2 drugs (drug1, drug2) on the likelihood of a patient falling (...
user avatar
8 votes
1 answer
18k views

Test Cox proportional hazard assumption (Bad Schoenfeld residuals)

Using R I generated a Cox model looking like this ...
Marcel's user avatar
  • 349
8 votes
2 answers
7k views

Cox model with LASSO

Rob Tibshirani propose to use lasso with Cox regression for variable selection in his 1997 paper "The lasso method for variable selection in the Cox model" published in Statistics In Medicine 16:385. ...
user avatar
8 votes
3 answers
6k views

Weibull Survival Model with Time Varying Covariates in R

I am trying to run a survival model using the Weibull approach, but the wrinkle is that I have time-varying covariates. I am using the survival package in R. My call is: ...
george's user avatar
  • 81
8 votes
4 answers
3k views

coxme proportional hazard assumption

I am running mixed effect Cox models (I have 1 random effect factor) using the coxme function {coxme} in R, and I would like to ...
EmMo's user avatar
  • 91
8 votes
2 answers
2k views

Cumulative Hazard Function where "status" is dependent on "time"

This question is in relation to a dataset I've previously discussed here. I'm trying to determine whether a treatment affects not only the number of visits a patient has to the doctor, but also how ...
OFish's user avatar
  • 458
8 votes
1 answer
15k views

Difference between survdiff log-rank and coxph log-rank

I'm using the survival package in R to analyze clinical data. I am analyzing two different groups of patients, when I calculate survdiff in order to compare the curves, I got p= 0.135, but when I ...
ToniG's user avatar
  • 125
8 votes
1 answer
4k views

How important is using the exact method for ties in a Cox model, and how long should this take?

I'm analyzing the results of some simulation work using a Cox proportional hazard model, and I have what I perceive are a great many ties in the data, representing when a particular individual in the ...
Fomite's user avatar
  • 23.7k
8 votes
0 answers
3k views

How to simplify coxme survival models?

I have some questions about specifying a coxme (mixed-effects Cox proportional hazards) model in R and then simplifying it after reading the ...
David Gibbs's user avatar
7 votes
2 answers
3k views

What does 'km' transform in cox.zph function mean?

I'm trying to understand how cox.zph function in R programming language works and I find myself not knowing what km transform ...
Nuta.'s user avatar
  • 71
7 votes
1 answer
6k views

Difference in chi-squared calculated by anova from cph and coxph

Is there a difference between chi-squared (from coxph -> anova) and Wald chi-squared (from ...
Gurkenhals's user avatar
7 votes
2 answers
5k views

Checking the proportional hazard assumption

I have a question on the cox proportional hazard model, in particular the proportionality assumption. I use cox.zph() function in R to check whether the proportionality assumption is satisfied. The ...
soeci92's user avatar
  • 83
7 votes
1 answer
422 views

Diagnosing an unexpected pattern in a survival curve plot

I am conducting a survival analysis (using Cox proportional hazards regression) in R. My overall sample has a ~10% mortality rate, but the Kaplan-Meier survival curves that are derived from my ...
Bren's user avatar
  • 97
7 votes
1 answer
4k views

Interpretation of coefficients of glmnet - LASSO/Cox model?

I have done a LASSO / Cox model run for a large dataset of 10K observations which has 1200 Variables. ...
Sam's user avatar
  • 85
7 votes
1 answer
3k views

How to visualize a significant interaction between two linear predictors using the rms package?

Two linear predictors interact significantly (see below). How can I visualize this interaction in a plot? ...
Gurkenhals's user avatar
7 votes
2 answers
7k views

Comparing a linear model with a spline model

I try to figure out how to describe my continuous variable. Unfortunately, I did not understand all of the statistics. I would really appreciate I you guys would help me out here. To better illustrate ...
Gurkenhals's user avatar
7 votes
1 answer
5k 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 ...
Adam Robinsson's user avatar
7 votes
2 answers
11k views

How to understand the plotting of the cox.zph function in R?

I use a Cox proportional hazard model (coxph()) which gives me HR of about 2.9 for presence of factor B (factors can be A, B, C, A as baseline in the model), with ...
user6143's user avatar
7 votes
1 answer
9k views

Impute missing values using aregImpute

I have a data frame with 61 columns. Some data is missing. I read in Steyerberg's book about aregImpute in Hmisc. I used it with ...
Gurkenhals's user avatar
7 votes
1 answer
3k views

Get a desired percentage of censored observations in a simulation of Cox PH Model

This question comes from: How to simulate a Cox proportional hazards model with change point and code it in R (See answer) I want to generate a censoring variable $C=Exponential(\theta)$ that create ...
anxoestevez's user avatar

1
2 3 4 5
10