Questions tagged [cox]

67 questions
1
vote
1 answer

Error when model diagnostics on stratified variable with coxph (survival package) in R

I have a dataset where 3 groups have recieved exposure to different media. One group is exposed to 1 of the 3 media. Therefore, my coxph model is stratified: # My treatment variable is loaded as a factor. fullModel <- coxph(Surv(time, status) ~…
asellus
  • 59
  • 5
1
vote
0 answers

How to plot survival probability calibration with Lifelines?

I am trying to use survival_probability_calibration to visualize the performance of Cox model but the calibration curve would always stay flat as shown in the following plot: Calibration curve with cox model What can be the reason of this issue?…
1
vote
0 answers

How to predict risk scores with Cox models using lifelines package?

I have made multiple cox models with Lifelines package and I am trying to predict the risk score of each individual following information in CoxPhFitter page. predict_hazard is a suggested command in that page, but when I use it to predict risk…
1
vote
1 answer

Creating a full vs. reduced model with one explanatory variable

I am attempting to create a Cox proportional hazards model with only one explanatory variable. To perform a likelihood ratio test, I know I need a full and reduced model. I also know that a full model would be a separate mean for each group, and a…
dolly
  • 13
  • 3
1
vote
0 answers

What is the output of predict.coxph() using type = "survival"?

I am trying to learn what the various outputs of predict.coxph() mean. I am currently attempting to fit a cox model on a training set then use the resulting coefficients from the training set to make predictions in a test set (new set of data). I…
Mao Pineda
  • 11
  • 1
1
vote
0 answers

cox regression plot using R

I have a Cox proportional hazards model set up using the following code in R that predicts mortality. Covariates A, B and C are added simply to avoid confounding (i.e. age, sex, race) but we are really interested in the predictor X. Where X is a…
Khalid
  • 23
  • 2
1
vote
0 answers

cox model forest plot

I would like to generate a cox model forest plot for several models in one fit1 <- coxph(Surv(years, status2) ~ drug , data = pbc2.id) fit2 <- coxph(Surv(years, status2) ~ drug + sex, data = pbc2.id) fit3 <- coxph(Surv(years, status2) ~ drug +…
S Front
  • 333
  • 1
  • 8
1
vote
1 answer

How do I turn off safebrowsing.io that comes with the Cox Panoramic Wifi?

I recently upgraded my wifi with Cox Cable and after installing their Panoramic Wifi device (that is both a modem and a router), I kept getting an Unsafe destination message with a button to click that said "Proceed Anyway". I would get this message…
ProfPerry
  • 11
  • 2
1
vote
1 answer

Multivariable cox regression analysis in R with non-binary categorical variables

I have questions about multivariable cox regression analysis including non-binary categorical variables. My data consists of several variables, and some of them are binary (like sex, and age over 70, etc..) whereas the rest of them are not (for…
1
vote
1 answer

Error in coxModelFrame.coxph(object) : invalid object set x=TRUE in the call to coxph

The following example is for anyone who is building a Cox Proportional Hazards models and trying to produce prediction error curves, but get an error stating: Error in coxModelFrame.coxph(object) : invalid object set x=TRUE in the call to…
Brandon
  • 51
  • 1
  • 7
1
vote
1 answer

random effects Cox model

I am trying to plot the dose-response relation between pm2.5 exposure and hypertension incidence. I fitted a random effects cox model, in which a random effect was added for the study centers. Then I used the plotHR function to plot the…
epi
  • 25
  • 3
1
vote
0 answers

convert dataset to longitudinal data structure in R

I have a datset that looks something like this: > head(BurnData) Treatment Gender Race Surface head buttock trunk up.leg low.leg resp.tract type ex.time excision antib.time antibiotic 1 0 0 0 15 0 0 1 1 …
user1607
  • 531
  • 7
  • 28
1
vote
0 answers

including time dependent covariates in Cox's Regression in R

I have a datset that looks like: Treatment Surface ex.time excision antib.time antibiotic inf.time infection 1 0 15 12 0 12 0 12 0 2 0 20 9 0 9 0 …
user1607
  • 531
  • 7
  • 28
1
vote
1 answer

How to calculate hazard ratio with coxph output

I have successfully got summary output from 'coxph'. However, now I am curious how to get the hazard ratio from these numbers? Is there a calculation I can do with what I have, or is there a certain code in R that will produce what I want?Output…
Carson
  • 13
  • 3
1
vote
0 answers

How to test PH assumption with Schoenfeld residuals with simulated paths in presence of competing events

I've obtained Schoenfeld residuals for testing PH for Fine & Gray's Cox regression model in presence of competing events with cmprsk. Here's the code: fg<-crr( fu_m, event, diabetes, failcode=1, cencode=0, na.action=na.omit, gtol=1e-06,…
ArTu
  • 431
  • 4
  • 20