491 questions
Advice
0 votes
1 replies
29 views
Check assumptions of mixed effects cox model
I am running a mixed effects cox model using coxme in R, and I cannot find any information on how to check model assumptions for this type of model. I have seen the older chats, which have recommended ...
0 votes
0 answers
44 views
Why does `estat phtest` return missing values (.) when testing proportional hazards assumption in Cox PH regression using Stata?
I am fitting a Cox proportional hazards model in Stata and checking the proportional hazards (PH) assumption using estat phtest. Here is how I set up my survival data: stset time, failure(event) ...
0 votes
0 answers
97 views
Restricted cubic splines with R RMS package and multiple imputation from MICE
I am trying to create a restricted cubic splines plot with the R RMS package and imputed data from the R MICE package. I could not find information on how to combine the different imputations from ...
4 votes
1 answer
95 views
Predict function in Clogit (Conditional logit)
I am trying to understand how the predict function works for conditional logit. I tried to calculate it manually but it does not work. Any help would be greatly appreciated. library(survival) set....
0 votes
0 answers
46 views
How do I manually set the reference category for a Cox PH Model in python?
I'm running a Cox PH Model to examine survival times among a population, and my model outputs fine, except I want to change the categories its using as the reference/baseline (i.e. right now it's ...
0 votes
1 answer
136 views
How do I train a penalized CoxPH model with restricted cubic splines in R?
I am trying to train a time-independent Cox model on a dataset of ~750,000 rows, as well as a time-dependent one on several million rows. I have 19 variables, some of which are binary and some ...
2 votes
1 answer
66 views
Y-axis of mgcv::gam cox.ph model: rate or ratio?
I am plotting a nonlinear generalized additive model (gam) using R's mgcv package: library(mgcv) V <- rep(1, nrow(dt) fit <- gam(cbind(V, group_number) ~ s(time_elapsed, exposure_group, bs='fs'...
0 votes
0 answers
16 views
How to explain discrepancy between a Cox PH model output and sjPlot:tab_model() output?
In a model we are developping for a project, we use a Cox Proportional Hazard model. We compared the table from the summary and the tab_model() of the model. What we have observed is the ...
4 votes
2 answers
121 views
How to identify relevant strings in this emmeans() output
I am interested in plotting the HR from a coxph() model for a categorical-continuous interaction. Basically estimating the binary HR at multiple values of the continuous predictor and then plotting ...
0 votes
0 answers
24 views
Interpolating daily persistence probabilities in package carcass
Disclaimer: I am new to R and survival analyses so apologies if I don't use the right terms or coding etiquette-figuring it out. In the carcass package, I've used function persistence.prob to develop ...
0 votes
0 answers
87 views
StepReg with missing imputation
I'm trying to do a stepwise Cox regression imputing missing values. As a first step I tried a simple stepwise procedure using the StepReg package but I ran into the following issue: set.seed(123) ...
0 votes
1 answer
63 views
How to transform 'panel data' structure into a data structure suitable for Cox Regression?
I made up some dummy data that has a very similar structure as our internal data I cannot share. I would like to know how to prepare it for the Cox Regression. Could you help me to pre-process the ...
1 vote
0 answers
44 views
Can the DynNom function in R create a dynamic nomogram from a Cox model with time varying coefficients
Recently, I learnt about DynNom function which allows one to generate a dynamic nomogram. When I attempted to generate a dynamic nomogram from a Cox model allowing for time varying coefficient after ...
1 vote
1 answer
280 views
How to plot hazard ratio from coxph model with tt() term
This question is related to another that I posted here: How to visually assess tt() suitability in coxph? If we have a time-varying HR that arises from a time-dependent coefficient because we have ...
0 votes
1 answer
369 views
How to add a number at risk table beneath survival curves from multivariate Cox model with clustering?
My first question here. I would like to add a number at risk table to the survival curves from multivariate Cox proportional hazards models that use clustering. ggadjustedcurves will produce the ...