All Questions
493 questions
2
votes
0
answers
2k
views
Parametric modelling of customer lifetime value using survival (Cox) analysis
I have half a year long data of purchases in e-commerce site (100K purchases by 60K customers). In simplest A/B testing framework random customers got a discount on the next purchase after order ...
18
votes
2
answers
42k
views
How to estimate baseline hazard function in Cox Model with R
I need to estimate baseline hazard function $\lambda_0(t)$ in a time dependent Cox model
$\lambda(t) = \lambda_0(t) \exp(Z(t)'\beta)$
While I took Survival course, I remember that the direct ...
10
votes
2
answers
25k
views
coxph ran out of iterations and did not converge
Yes, I have checked that previous answers to "Ran out of iterations..." questions do not solve my problem.
I have fault data on Firefox, 899 faults and 1395 (estimated) censored faults. The ...
3
votes
2
answers
2k
views
How do you get p-values for predictors in a Cox regression analysis in R?
I am running a Cox regression analysis in R where both my predictors are binary (Animal_Number: single vs. paired; and Treatment:...
1
vote
0
answers
907
views
Cross validation and computing c index
I have seen the discussion in the page Computing c-index for an external validation of a Cox PH model with R. I am doing almost the same thing, using 3-fold sampling (with two thirds in the training ...
7
votes
1
answer
3k
views
Get a desired percentage of censored observations in a simulation of Cox PH Model
This question comes from:
How to simulate a Cox proportional hazards model with change point and code it in R (See answer)
I want to generate a censoring variable $C=Exponential(\theta)$ that create ...
6
votes
1
answer
3k
views
How to simulate a Cox proportional hazards model with change point and code it in R
I have a model that has the following characteristics:
The covariate $X$ follows a $Be(1/3)$.
If $X=0$, survival time $Y$ follows an $E=Exponential (1)$.
If $X=1$, survival time $Y$ is generated as $...
2
votes
2
answers
896
views
R package (relaxed lasso for Cox's proportional hazards model)
Is there any R package to implement relaxed lasso for Cox's proportional hazards model? Thank you.
4
votes
1
answer
2k
views
Problem with BootCV for coxph in pec after feature selection with glmnet (lasso)
I am attempting to evaluate the prediction error of a coxph model that was built after feature selection with glmnet.
In the preprocessing stage I used na.omit (dataset) to remove NAs.
I ...
3
votes
2
answers
7k
views
R's coxph won't converge when I include factor (categorical) variables
I have a dataset of 371 observations. When I run coxph with numeric variables it works fine. However, when I try to add factor (categorical) variables it returns “...
9
votes
2
answers
2k
views
Large scale Cox regression with R (Big Data)
I am trying to run a Cox regression on a sample 2,000,000 row dataset as follows using only R. This is a direct translation of a PHREG in SAS. The sample is representative of the structure of the ...
2
votes
0
answers
130
views
Extended Cox-model with ancillary variable
I have survival data (coming from a labor market) looking like this
...
8
votes
1
answer
18k
views
Test Cox proportional hazard assumption (Bad Schoenfeld residuals)
Using R I generated a Cox model looking like this
...
3
votes
1
answer
3k
views
Extended Cox model with continuous time dependent covariate - how to structure data?
I need to run an extended Cox model with a time-varying covariate in R: let’s call it the "number of doses" (X). I am interested in the hazard ratio associated ...
3
votes
0
answers
1k
views
How to interpret the frailty terms in a coxph.penal model?
I have the following coxph model:
Surv(Y) ~ genotype + treatment + age + frailty(batch) + genotype:frailty(batch)
...
2
votes
1
answer
1k
views
Simulation Analysis of a Cox Survival Model with Change Point.
I wish to simulate survival data for the following probabilistic model which will be analyzed using a Cox model:
An exposure $X$ is modeled as binary having $X \sim_{iid} \mbox{Bernoulli}(p)$ where $...
4
votes
0
answers
1k
views
Cox proportional hazards with time-dependent covariates: predict in R
I would like to use the predict function (or something similar) in R to generate expected values from a Cox proportional hazards model with time-dependent covariates. The model takes the form
...
9
votes
3
answers
17k
views
Computing c-index for an external validation of a Cox PH model with R
First off, I'll state that I'm aware many questions get asked about the c-index. I've searched this site and others, and I haven't found an answer for my situation. I can successfully use ...
2
votes
2
answers
477
views
Can you use proportions as a covariate in a Cox proportional hazards model?
In R's survival::coxph function, can I mix a covariate representing proportions (in the range 0.0-0.5) with an integer covariate (in the range 1-15), or should I ...
11
votes
2
answers
4k
views
Propensity score weighting in Cox PH analysis and covariate selection
Regarding propensity score weighting (IPTW) when doing Cox proportional hazard modeling of time-to-event survival data:
I have prospective registry data where we're interested in looking at treatment ...
4
votes
1
answer
3k
views
Cross-validation of a Cox model
I have a medical background, with absolutely no knowledge about programming. I am working on survival analysis. I have fitted a multivariate Cox model which I need to cross-validate. My questions are:
...
1
vote
0
answers
1k
views
Bootstrap randomized Lasso selection for a Cox model
I'm interested in variable selection for a cox proportional hazards model.
I've read this article which slightly favours randomized bootstrap lasso selection over bootstrap lasso selection since it ...
21
votes
1
answer
26k
views
Cox baseline hazard
Let's say I have a "kidney catheter" data set. I'm trying to model a survival curve using a Cox model. If I consider a Cox model: $$h(t,Z) = h_0 \exp(b'Z),$$ I need the estimate of the baseline hazard....
10
votes
2
answers
7k
views
Using multiple imputation for Cox proportional hazards, then validating with rms package?
I've been researching the mice package, and I haven't yet discovered a way to use the multiple imputations to make a Cox model, then validate that model with the rms package's ...
6
votes
1
answer
2k
views
EM algorithm R code on Cox PH model with frailty
Let say I have a 'kidney catheter' data set. Data are about the recurrence times to infection, at the point of insertion of the catheter, for kidney patients using portable dialysis equipment. ...
12
votes
2
answers
7k
views
Interval censored Cox proportional hazards model in R
Given interval censored survival times, how do I perform an interval censored Cox PH model in R? An rseek search turns up the package ...
16
votes
1
answer
4k
views
How to generate predicted survivor curves from frailty models (using R coxph)?
I want to compute predicted survivor function for a Cox proportional hazards
model with frailty terms [using survival package]. It appears that when
frailty terms are in the model, the predicted ...
4
votes
1
answer
2k
views
Creating formula object for coxph()
I am trying to create the formula object for coxph() manually, as I want to reproduce it in RSRuby. Note that the response variable needs to be a ...
15
votes
3
answers
2k
views
What are the options in proportional hazard regression model when Schoenfeld residuals are not good?
I am doing a Cox proportional hazards regression in R using coxph, which includes many variables. The Martingale residuals look great, and the Schoenfeld residuals ...
5
votes
1
answer
567
views
Proportional hazard ratio formula in R
I'm new proportional hazard ratio models and new-ish to R, so I suspect this is a basic question:
The scenario is modeling the speed of an effect through hazard ratios. People are joining an ...
8
votes
1
answer
4k
views
How important is using the exact method for ties in a Cox model, and how long should this take?
I'm analyzing the results of some simulation work using a Cox proportional hazard model, and I have what I perceive are a great many ties in the data, representing when a particular individual in the ...
9
votes
1
answer
11k
views
Cox proportional hazard model and interpretation of coefficients when higher case interaction is involved
Here is the summary-output of the Coxph-model I used (I used R and the output is based on the best final model i.e. all significant explanatory variables and their interactions are included):
...
20
votes
2
answers
10k
views
What is the "$R^2$" value given in the summary of a coxph model in R
What is the $R^2$ value given in the summary of a coxph model in R?
For example,
Rsquare= 0.186 (max possible= 0.991 )
I foolishly included it a manuscript as ...
8
votes
1
answer
15k
views
Difference between survdiff log-rank and coxph log-rank
I'm using the survival package in R to analyze clinical data. I am analyzing two different groups of patients, when I calculate survdiff in order to compare the curves, I got p= 0.135, but when I ...
12
votes
2
answers
20k
views
How to calculate predicted hazard rates from a Cox PH model?
I have the following Cox PH model:
(Time, Event) ~ X + Y + Z
I would like to get the predicted hazard rates (i am talking about hazard rates NOT hazard ratios) given specific values of ...
16
votes
2
answers
22k
views
Interpretation and validation of a Cox proportional hazards regression model using R in plain English
Can someone explain my Cox model to me in plain English?
I fitted the following Cox regression model to all of my data using the cph function. My data are saved ...
5
votes
1
answer
6k
views
Discrimination and calibration of Cox model
I have been working on fitting Cox model for prediction by using the rms package. I want to measure model calibration and discrimination.
Discrimination was measured by using ...
11
votes
1
answer
15k
views
Different prediction plot from survival coxph and rms cph
I've created my own slightly enhanced version of the termplot that I use in this example, you can find it here. I've previously posted on SO but the more I think about it I believe that this probably ...
20
votes
3
answers
19k
views
Time dependent coefficients in R - how to do it?
Update: Sorry for another update but I've found some possible solutions with fractional polynomials and the competing risk-package that I need some help with.
The problem
I can't find an easy way to ...
7
votes
2
answers
11k
views
How to understand the plotting of the cox.zph function in R?
I use a Cox proportional hazard model (coxph()) which gives me HR of about 2.9 for presence of factor B (factors can be A, B, C, A as baseline in the model), with ...
5
votes
2
answers
1k
views
How to handle irregular interval censoring in a Cox model in R or Stata
I'm trying to model a weekly process of adoption (adoption events could only occur on Fridays) using the coxph function, but a large quantity of observations are ...
6
votes
2
answers
4k
views
How to get convergence using coxph (R) given that model converges using proc phreg (SAS)
I have a data set
...
8
votes
2
answers
7k
views
Cox model with LASSO
Rob Tibshirani propose to use lasso with Cox
regression for variable selection in his 1997 paper
"The lasso method for variable selection in the Cox
model" published in Statistics In Medicine 16:385.
...