The term Cox regression model (omitting proportional hazards) is sometimes used to describe the extension of the Cox model to include time-dependent factors. However, this usage is potentially ambiguous since the Cox proportional hazards model can itself be described as a regression model.
Questions tagged [cox-regression]
476 questions
2
votes
1 answer
Transform data to start-stop / long format
I want to do survival analysis with a cox regression. Therefore, I need to transform my data according to observation times to a start-stop format instead of just one time observation.
Example dataset:
userid indicates user identifier
day indicates…

Scijens
- 541
- 2
- 11
2
votes
1 answer
Predicted Survival Curves using Corrected Group Prognosis Method
How can I plot predicted survival curves of a continuous covariate (let's say 20th and 80th percentile of the value) using the corrected group prognosis method as implemented in R by Therneau
For example,
library(survival)
library(survminer)
fit…

mindhabits
- 421
- 1
- 3
- 10
2
votes
1 answer
Customising line type in adjusted survival curves ggadjustedcurves (survminer, ggplot2)
I'm trying to plot an adjusted survival curve, but struggling with changing the line types by group. I'm able to customise other aspects of the plot using typical ggplot2 language, but I've hit a wall with changing line type.…

T.P.
- 87
- 1
- 6
2
votes
1 answer
Predict survival score and CLTV for contractual discrete policies/terms
I am trying to predict the survival score and LTV for contractual and discrete policies(in insurance) in python. I browsed number of sites but I could find many examples only for non-contractual(in retail).
I have used the below code:
from…

ggg_datascience
- 85
- 1
- 8
2
votes
1 answer
Cox PH model in `lifelines` - violated assumptions for dummy variables
I am using lifelines library to estimate Cox PH model. For the regression I have many categorical features, which I one-hot-encode and remove one column per feature to avoid multicollinearity issue (dummy variable trap). I am not attaching the code…

abu
- 737
- 5
- 8
- 19
2
votes
1 answer
Extract name of failure variable from cox model terms
I need to extract the name of the failure variable from a description of a Cox model in R. Note I don't have the object itself, I have terms(coxfit) that has been returned from a third party function. To give a reproducible example - suppose this is…

user2498193
- 1,072
- 2
- 13
- 32
2
votes
1 answer
Linear predictor from predict.coxph from coefficients only
I need to calculate the linear predictor of a Cox PH model manually.
I can get continuous and binary variables to match the output of predict.coxph (specifying 'lp') but I can't seem to figure out how to calculate it for categorical variables with…

Michelle
- 21
- 2
2
votes
2 answers
How to deal with non invertible matrix in survival analysis
I am new to survival analysis. I tried to using CoxPHFitter, But I came across this error. numpy.linalg.linalg.LinAlgError: Matrix is singular.
After went through this error, I came to know one of my column has non invertible matrix.
So what…

Mohamed Thasin ah
- 10,754
- 11
- 52
- 111
2
votes
0 answers
How to calculate expected risk from fitted Cox PH model in R?
I'd like to calculate the expected risk (cumulative incidences), which are derived from a fitted Cox PH model using R packages.
I have the fitted Cox PH model like as follows:
##[Variables]##
# **Dataset: 10,000 cases(patients) with 6 variabels
#…

James Lee
- 21
- 1
2
votes
1 answer
Random slopes Cox Proportional Hazards
I have been trying to use coxme to extract random slopes for each of the covariates in my model.
library (coxme)
Start <- runif(5000, 1985, 2015)
Stop <- Start + runif(5000, 2, 10)
S <- data.frame (
X1 <- runif(5000, 5.0, 7.5),
X2 <-…

AEM
- 919
- 1
- 9
- 22
2
votes
0 answers
Predict event probability (event of prepayment) given survreg model
I want to predict the cumulative risk of a prepayment for data from Q1 2016, where the loan grade was an A. I have data up to MOB (month on book) 27, but want to predict up to month 36.
sr.a_q2_16 <-…

James
- 23
- 3
2
votes
0 answers
Interval censoring, but not right censoring, deems X matrix singular for time-dependent variable in coxph
Background
I am using the Cox proportional hazards model to investigate the effects of several time-varying covariates on tree mortality, recorded annually. Time-varying covariates are annual climate variables, meaning they are the same for each…

Sara Germain
- 21
- 1
2
votes
1 answer
Cox Proportional Hazard in JuMP.jl
I am trying JuMP.jl in Julia for the first time and can't seem to get around an error. Here is my set up.
using DataFrames, DataFramesMeta, JuMP, Ipopt
#time to event
times =…

Alex
- 2,603
- 4
- 40
- 73
2
votes
2 answers
R coxph() Error: object 'Ccoxmart' not found
I am getting the following error every time I run a Cox model using the survival package in R. This error arose within the last few days. To illustrate the error, I am using a standard example command which is given at…

user3487564
- 149
- 1
- 6
2
votes
0 answers
coxph in R: Error in if (any(infs)) warning(paste("Loglik converged before variable "
I know this has been a similar question in another thread. However, I added the suggested solution into my code and it still didn't work:
output<-coxph(Surv(start, timepoint, progress) ~ DMT + DMT:timepoint +
+ dens + cluster(pair), weights=weight,…

Bernd
- 91
- 7