Questions tagged [cox]

67 questions
0
votes
0 answers

Forest plot for coxme models?

I have a mixed-effects coxme model and wanted to plot a forest graph(similar to ggforest for coxph). I'm slightly new to this so not sure how to plot this. My df: str(cats_52weeks) 'data.frame': 487 obs. of 50 variables: $ Cat_ID …
V.Menon
  • 81
  • 1
  • 1
  • 3
0
votes
1 answer

Univariate cox regression analysis with multiple covariates

covariates <- c("age", "sex", "ph.karno", "ph.ecog", "wt.loss") univ_formulas <- sapply(covariates, function(x) as.formula(paste('Surv(time, status)~', x))) univ_models <- lapply( univ_formulas,…
Laura
  • 1
0
votes
0 answers

Error fitting a proportional hazards regression model to case-cohort data with cch function

I am trying to fit a proportional hazards regression model to case-cohort data (where cases are oversampled and not representative of the population). I am using the Survival package and cch() function. fit <- cch(Surv(followuptime, event) ~ A1 + A2…
0
votes
1 answer

Test Cox Proportional Assumption (cox.zph) for multiple columns using apply?

I have a dataset with many columns. I want to do a Cox regression for each one of the columns, so I used "apply". miRNA names are the predictor variables, the columns I want to do Cox regression in separated models. This is the code: mirna_names…
laia_gt
  • 1
  • 3
0
votes
0 answers

Cox PH model, how to control for multipel events

I´m working on a time-to-event modell in R using the coxph function in the survival package. I´m analysing animal movements until they pass the study area which consists of 2 zones. Each individual can have multiple events before the final passing…
Mattias
  • 1
  • 1
0
votes
1 answer

Create a column includes all confidence intervals

I have a code like that : library("survival") library("survminer") data("lung") res.cox <- coxph(Surv(time, status) ~ sex, data = lung) x<-confint(res.cox) I am looking to get all the confidence intervals, not only the upper and lower bands. So…
Ali Roghani
  • 495
  • 2
  • 7
0
votes
2 answers

Loop in Cox regression

I am trying to run a cox regression for 1000 variables (exposure) as below varlist <- names(dataset)[275:1275] sumtables <- lapply(varlist, function(i) { iformula <- as.formula(sprintf("Surv(time_cox, events) ~ %s + age +age2 ", i)) …
momaz
  • 1
0
votes
0 answers

penalized cox regression in Python- how to get coefficient and confidence interval after Choosing penalty strength α?

I am trying to do penalized cox regression in python and to get the coeffecients, I am struggling to get the confidence intervals and would appreciate your help.Running this code , I can get the coefficient for each variable. However, I am…
Hatem Ali
  • 1
  • 2
0
votes
1 answer

Export coefficients from a loop for multiple cox regression

I need your help! I have a data set with 100,000 cases and 81 variables and I run a loop for multiple regression for each variable adjusted for age and sex in r: covariates <- c(var1, var2, ... var81) purrr:: map(covariates,…
steffie22
  • 1
  • 1
0
votes
1 answer

Does SPSS perform cox regression analysis for time-dependent repeated observations?

I could not see a source of cox regression for time-dependent REPEAT observations on the Internet. Does spss do this analysis? Any source suggestions?
Cgdmm
  • 63
  • 1
  • 7
0
votes
0 answers

Comparing graph of stratified cox model to others in R

I'm looking at the bfeed dataset in R: library(survival) library(KMsurv) data(bfeed) dput(head(bfeed)) structure(list(duration = c(16L, 1L, 4L, 3L, 36L, 36L), delta = c(1L, 1L, 0L, 1L, 1L, 1L), race = c(1L, 1L, 1L, 1L, 1L, 1L), poverty = c(0L, 0L,…
Cryena
  • 33
  • 4
0
votes
0 answers

Cox Hazard Model: why multiple factor levels are reference?

When conducting a multivariate Coxph model with categorical predictors, and after releveling all predictor variables (function= relevel()), two of my predictor variables have multiple levels that are "references", eliminating several analyses.…
SpencerS
  • 1
  • 1
0
votes
0 answers

R optim parameter behavior

I am trying to fit a kernelized version of the Cox partial likelihood in R. I have a function compute_kernelized_nLL(param_vect, kernel_matrix,response,lambda=0) and when I call optim as…
0
votes
2 answers

Error extracting non-zero glmnet coefficients with "which"

I fitted a cox model with glmnet like: fitL <- glmnet( X, Y, family = "cox", alpha = 1, lambda = cvL$lambda.min, #cvL obteined with cv.glmnet standardize = FALSE, thresh = thresh ) I obtained: str(coef(fitL) != 0) Formal class…
Ph.D.Student
  • 704
  • 6
  • 27
0
votes
1 answer

Cox PH Hazard Function in Python

I have the following data: gasdfhourly[['Unit','Hourcount','Target']].head() Out[377]: Unit Hourcount Target Date hour 2014-01-01 0 748.816493 1 0.0 1 …
IndigoChild
  • 842
  • 3
  • 11
  • 29