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
3
votes
0 answers
Error when running coxph on gene expression data
I am getting an error when running coxph on my data. Have anyone of you seen this before?
coxph(Surv(OS,Survival_dead0_alive1)~.,data=data.frame(Bind))
Error in fitter(X, Y, strats, offset, init, control, weights = weights, :
NA/NaN/Inf in…

user2300940
- 2,355
- 1
- 22
- 35
3
votes
0 answers
Conditional Logisitc regression analysis with mgcv gam models
I am running a GAM model through the mgcv package with family = cox.ph() and have my data grouped by strata (strata = id). The data corresponds to one use location for an individual animal and 20 random locations associated with that individual that…

P. Farrell
- 31
- 3
3
votes
1 answer
R session aborted when trying to run coxph
Every time I run model<– coxph(enter,exit, event)~X1+X2+GDP the session crashes suddenly with no error message. It is only when I add the gap variable that it crashes.
I wonder if it has to do with the GDP variable? I tried different sources and…

FKG
- 285
- 1
- 4
- 17
3
votes
1 answer
Multistate Survival Analysis using R package "Survival"
I am trying to estimate Cox proportional hazards model for transition from state 1 to state 2 using R survival package as follows:
Altman <- coxph(Surv(Tstart, Tstop, to == 2) ~ wWCTA + wRETA + wEBITTA + wMETL +
wSTA, data=Multistate,…

Jairaj Gupta
- 347
- 4
- 16
3
votes
1 answer
Testing multicollinearity in cox proportional hazards using R
I would like to assess multicollinearity in a cox proportional hazards model by calculating Variance Inflation Factor (VIF). The vif-functions in packages like {car} does not accept coxph objects.
Is there a way to calculate VIF for cox models in…

Erik
- 308
- 1
- 3
- 11
3
votes
1 answer
R object of type 'environment' is not subsettable
I'm doing survival analysis with interval censored data and I'm trying to use intcox() function from the incox package to do a Cox regression. I've already done part of the analysis with survfit() and everything worked fine.
When I try to use…

JMarcelino
- 904
- 4
- 13
- 30
3
votes
1 answer
Stratified cox regression in R using package namespace
I'm doing stratified cox regression in R with the survival package:
cox <- coxph(response~strata(x), data=data)
This works fine, but when using the sampling package the strata function from the survival package is hidden and cannot be used…

DeltaKappa
- 171
- 7
2
votes
0 answers
Cox model selection: Test all variable combination
I need to test, which cox model fits the best based on partial AIC. Below you see the code, that I am using to test the combination of 5 parameters. How can I adjust my code, to test all possible variables combinations?
parameters = ['v1', 'v3',…

Mischa
- 83
- 1
- 10
2
votes
0 answers
How to use Predict in rms package for a multiple values?
I used cox model for Predict function rms package for individual values they are returning the correct result where as when I give multiple values it gives me weired…
user2110417
2
votes
1 answer
Wrangle data from long to wide format for cox regression in R
I am trying to wrangle some data for a cox regression...
#generate some data
set.seed(1)
ID <- sort(rep(1:10, times = 5))
conditions <- rep(c("asthma", "copd", "af", "cvd", "ckd"), times = 10)
day <- sample(1:100, 50)
#assign to dataframe
df <-…

Richard Summers
- 143
- 1
- 10
2
votes
1 answer
comparing svycoxph models with likelihood ratio test
To find the optimal multivariate-adjusted Cox model (svycoxph) I'd like to compare different models with a likelihood ratio test to learn which model is better. Comparing to models with anova(model1, model2) or AIC doesn't work with survey weighted…

Sasi
- 53
- 3
2
votes
0 answers
Is there a way in R to include weights in a cox regression with Firth's penalized likelihood?
I am trying to fit a propensity score weighted cox regression model in R. However, one of the treatment groups has zero events, so I also need to use an adjustment method (Firth's penalized likelihood).
I have been using the coxphf package just fine…

Jordan Hackett
- 689
- 3
- 11
2
votes
1 answer
Adjusted Survival Curves in R From Cox Model at Specific Covariate Values
I'd like to plot adjusted survival curves from a Cox model at specific covariate values. The survfit function in the survival package and ggsurvplot in survminer allow one to easily plot adjusted survival curves from a model, but seem to only do so…

West_End_Line
- 179
- 6
2
votes
2 answers
Change axis ranges for a ggplot based on a Predict object (rms package)
I am using the rms package to perform Cox regression with age as restricted cubic splines with 4 knots, see reproducible code below from the rms package documentation.
My problem is: How do I change the y axis interval for the ggplot-output? I tried…

Pontus Hedberg
- 301
- 1
- 2
- 9
2
votes
1 answer
Time-dependent covariates- is there something wrong with this code? (R program)
I am checking a few of my Cox multivariate regression analyses' proportional hazard assumptions using time-dependent co-variates, using the survival package. The question is looking at survival in groups with different ADAMTS13 levels (a type of…

Jobolo
- 79
- 6