Questions tagged [cox-regression]

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.

476 questions
0
votes
1 answer

How can I calculate the measures of effect modification on the "additives scale" and "multiplicative scale" using a coxph?

I read the paper entitled "Recommendations for presenting analyses of effect modification and interaction" published by Knol MJ and VanderWeele TJ Link to download the paper. I would like to follow their recommendations. I think I get everything to…
Gurkenhals
  • 29
  • 7
0
votes
1 answer

Trying to specify predict.coxph type within map2() function

I’ve been scouring the web for the last few days looking at the documentation for map2. I have taken a training set, nested the data and created coxph models for it, saving those models in the nested table. Now I want to predict from that model, but…
0
votes
0 answers

PROC PHREG Clustering

I have a dataset on eyes with 2 eyes per patient. The data is clustered because the covariates such as age, gender, and ethnicity are the same for both eyes for that one patient. This is my code so far: PROC PHREG data = eyes covs(aggregate)…
0
votes
1 answer

Lifelines boolean index in Python did not match indexed array along dimension 0; dimension is 88 but corresponding boolean dimension is 76

This very simple piece of code, # imports... from lifelines import CoxPHFitter import pandas as pd src_file = "Pred.csv" df = pd.read_csv(src_file, header=0, delimiter=',') df = df.drop(columns=['score']) cph = CoxPHFitter() cph.fit(df,…
slesher
  • 109
  • 2
  • 13
0
votes
0 answers

R Coxph() warning message and unexpected results

So I have data at the individual level like so : ageband <- factor(0:5) event.true <- c(1487,1863,1038,874,424,12) event.false <- c(50997,32216,16723,12224,7990,1928) df <- as.data.frame(cbind(ageband,event.true,event.false)) Here is the weird…
Negarev
  • 79
  • 2
  • 8
0
votes
1 answer

Using "pec" R package for prediction from "coxph" function on lung dataset

I want to get predictions for the lung dataset available from penalized R package using the coxph R function for Cox proportional hazard model. I have the following example code. library(survival)…
Khan
  • 107
  • 1
  • 9
0
votes
1 answer

Survival dataset split by year starting at January 1st

I have the following survival dataset that I would like to split the interval by January 1st of each year. For example, for personid 1220, i would make the split at 1912-01-01, 1913-01-01, 1914-01-01, 1915-01-01. I tried to use survSplit but they…
Meo
  • 140
  • 1
  • 9
0
votes
0 answers

When doing survival analysis in R, how to get the time before death of a patient?

I'm new to survival analysis, and really need your help. Thank you so much! I want to analyze: how soon will a patient die in days? whats the probability for the patient to die? Are these two the possible outcomes of survival analysis in R? I…
Yulai Wei
  • 1
  • 1
0
votes
1 answer

How to select the default cluster in a Cox model in R?

I'm working on a Cox model and I have a variable which is cut in clusters. Here is some working example : lung2=lung lung2$age.cl = cut(lung2$age, c(40,50,60,70,80,90)) cox = coxph(Surv(time, status) ~ age.cl, data = lung2) It returns this table…
Dan Chaltiel
  • 7,811
  • 5
  • 47
  • 92
0
votes
0 answers

Cox Proportional hazard model - Comparing coefficients from sub datasets

I am doing a study of credit risk in europe for the period of 2006 - 2016 by using the Cox Proportional Hazard Model (time costant edition) in R (coxph). I have succesfully implemented the model for the whole period with 8 independent variables. Now…
0
votes
1 answer

Risk-free interval in Andersen-Gill counting process formulation for Cox regression using survival::tmerge()

I would like to use the tmerge() function to transform the dataset for use in the Andersen-Gill extension of the Cox regression framework for repeated events. See Therneau's excellent vignette. I would like to specify that the individual is immune…
user6571411
  • 2,749
  • 4
  • 16
  • 29
0
votes
1 answer

Backward Elimination for Cox Regression

I want to explore the following variables and their 2-way interactions as possible predictors: the number of siblings (nsibs), weaning age (wmonth), maternal age (mthage), race, poverty, birthweight (bweight) and maternal smoking (smoke). I…
0
votes
1 answer

Using categories as new variables?

I am teaching myself R since some days and I am stuck with a cox regression analysis. I managed to divide each of the the continuous variables I have into 2 categorical groups using the cut() function. Now I wonder if I can combine these…
Alex
  • 25
  • 7
0
votes
0 answers

Error in backward and stepwise selection in R

I use Cox regression to model survival data. My dataset has 345 observations and 78 events. The number of predictors in the Cox model is 124. All 124 variables are continuous Now, I want to do variable selection.The forward selection works fine.…
D_C
  • 53
  • 10
0
votes
1 answer

How to create a binary preditor from a multivariate glmnet (coxnet) model?

Let´s use the following example: generate survival data (1000 samples with 30…
user86533
  • 323
  • 1
  • 7
  • 18