Questions tagged [cox]
67 questions
1
vote
0 answers
How to use predictSurvProb() in package "pec" to predict survival probabilities for dataset with time-dependent covariates?
I have a dataset as below:
Patient_ID Time_Start Time_End X1 X2 X3 Status
001 0 1 0
001 1 2 0
001 2 3 0
001 3 4 …

soniCYouth
- 33
- 1
- 8
1
vote
0 answers
Large Dataframe slow with Lifelines Survival Analysis
I'm trying to run a survival analysis on a large dataset (about 80 rows x 12,000 cols) in python.
Currently I'm using:
from lifelines import CoxPHFitter
cf = CoxPHFitter()
cf.fit(df, duration_col='Time', event_col='Status')
But it is extremely…

zhivaga
- 11
- 3
1
vote
1 answer
Permuted observations in Cox PH model in R
I have a data frame in the format required for coxph function in the survival package. The status of a subject can be either 0 (alive) or 1 (dead). I want to run a permutation on the status of subjects and re-run the analysis. In this case, one…

Slouei
- 716
- 7
- 19
1
vote
1 answer
Coxph direction of Hazard Ratio
Let's assume I have the following dataset:
time censor treatment
6 0 A
12 1 A
4 0 B
5 0 B
3 0 C
12 1 C
6 0 B
12 1 C
4 0 A
5 0 C
3 0 B
12 1 A
so what I did is relevel to my reference A and ran:
coxph(Surv(time,censor)~treatment)
I looked at the…

Nuke
- 83
- 1
- 9
1
vote
1 answer
use cox model to estimate survival
I first establish a cox model in R:
test1<- test[1:20,]
model.1 <- coxph(Surv(test1$days,test1$status==1) ~ test1$MTT+test1$ADC,data=test1)
and when i tried to predict next patient's survival like this:
covs1 <-…

ineffable
- 11
- 1
1
vote
1 answer
Coxph predictions don't match the coefficients
Good afternoon,
I could post reproducible code and certainly will if everyone agrees that something is wrong, but right now I think my question is quite simple and someone will point me the right path.
I am working in a data set like…

Rafael Meirelles
- 1,323
- 2
- 8
- 10
1
vote
0 answers
PHP error with mailserver " Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0" in context to email
I am setting up a localhost PHP server to play around with mailservers. I have my php.int all set up with my provider's info and have a seemingly valid php file that I am trying to run: (info changed, for obvious reasons.)

J Cover
- 11
- 2
- 4
0
votes
0 answers
How can I add regression beta coefficients to data frame
I am trying to use Rstudio to apply the univariate cox proportional regression to multiple covariates at once so that the results will be displayed as data frame with approriate headings along side the covariates but I am getting an error…

Bemgba Apeagee
- 1
- 1
0
votes
0 answers
Dealing with variables violating proportional hazard assumption, is it okay to use both step function and time-transform function simultaneously?
I tried to fit survival model with 4 variables violating proportional hazard assumption. I read following vignette (https://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf) and seared online thoroughly, but could not find similar…

JY J
- 21
- 3
0
votes
0 answers
cox time_dependent and ID
i have two measurement times for a creatinine score, at recruitment and 2 months later. i have 330 participants: 80 die before 2 months. 230 were able to complete the second measurement.
in total, 120 of my 330 participants died.
When I carry out my…

mumber1
- 15
- 4
0
votes
0 answers
Way to handle multiple variables that violate porportional hazard assumption. Step function and time transformation
I tried to fit survival model with several variables violating proportional hazard assumption.
I read following vignette thoroughly, but cannot get satisfactory answers for my…

JY J
- 21
- 3
0
votes
0 answers
How to get P for trend in cox regression model using R?
I got a problem with how to get P for trend in cox regression even after searching by google.
I have a DDD_1 variables which is a factor variable, containing 0,1,2.
res.cox = coxph(Surv(t$death_365days_duration, t$death_365days==1)~
…

HH Chang
- 1
- 1
0
votes
0 answers
Visualize time-varying continuous exposure and interaction with a time-varying categorical variable
I have a dataset with a time-varying continuous exposure and a time-varying three-level categorical variable. I want to plot the hazard ratios obtained from the cubic spline term of exposure and its interaction with the categorical variable for each…

Faizan Mazhar
- 1
- 1
0
votes
0 answers
Loop/iterate over many columns in R for Cox proportional hazards regression
I have a great number of events to analyse, all in separate columns as shown in my example below. I would like to create a model for each column labeled IDXX, through a FOR loop, in R.
However, the code always returns the error Time and status are…

pyyyour
- 1
- 2
0
votes
0 answers
How to build a Cox PH model manually (from coefficient found in coxph function)?
I built a cox PH model with the following code:
library(rms)
cox1 <- cph(Surv(survival_time, event) ~ var1 + var2 + var3 + var4, data = myDataBase)
summary(cox1)
Now I want to predict a survival probability at 12/24/36 months for a new…

B_slash_
- 309
- 2
- 17