cox-regression

R - cox hazard model not including levels of a factor

浪子不回头ぞ 提交于 2021-02-19 23:59:13
问题 I am fitting a cox model to some data that is structured as such: str(test) 'data.frame': 147 obs. of 8 variables: $ AGE : int 71 69 90 78 61 74 78 78 81 45 ... $ Gender : Factor w/ 2 levels "F","M": 2 1 2 1 2 1 2 1 2 1 ... $ RACE : Factor w/ 5 levels "","BLACK","HISPANIC",..: 5 2 5 5 5 5 5 5 5 1 ... $ SIDE : Factor w/ 2 levels "L","R": 1 1 2 1 2 1 1 1 2 1 ... $ LESION.INDICATION: Factor w/ 12 levels "CLAUDICATION",..: 1 11 4 11 9 1 1 11 11 11 ... $ RUTH.CLASS : int 3 5 4 5 4 3 3 5 5 5 ... $

cox proportional hazard regression in SPSS using reference group

北城以北 提交于 2021-02-11 15:15:35
问题 I am running cox proportional hazard regression in SPSS to see the association of 'predictor' with risk of a disease in a 10 years follow-up. I have another variable 'age_quartiles' with values 1,2,3,4 and want to use '1' as reference to get HRs for 2,3, and 4 relative to '1'. When I put this variable in Strata I still get one 'HR' as follows ('S_URAT_07' is the predictor with continuous values); Question: How do I get HRs for the predictor for the event based on 'age_quartiles' 2,3 and 4 and

Getting P-Values of Zero in Cox Regression: R

﹥>﹥吖頭↗ 提交于 2021-02-11 13:35:45
问题 I am a student conducting a gene expression survival analysis in R. I have the expression data for 249 patients, and I am using 6,000 genes as well as their event-free survival times and vital state as response variables. When I tried to run the Cox regression on my dataset, I got extremely strange results (p-values of 0.00 and strange hazard ratios). I have checked over my code multiple times, but I am not able to catch my mistake (when I tried earlier with just one gene, it worked fine, but

Create formula call from character string

我只是一个虾纸丫 提交于 2021-02-10 20:15:38
问题 I use a best subset selection package to determine the best independent variables from which to build my model (I do have a specific reason for doing this instead of using the best subset object directly). I want to programmatically extract the feature names and use the resulting string to build my model formula. The result would be something like this: x <- "x1 + x2 + x3" y <- "Surv(time, event)" Because I'm building a coxph model, the formula is as follows: coxph(Surv(time, event) ~ x1 + x2

Cox proportional hazard model

时光怂恿深爱的人放手 提交于 2021-02-04 21:20:29
问题 I am trying to run Cox proportional hazard model on a data of 4 groups. Here's the data: I am using this code: time_Allo_NHL<- c(28,32,49,84,357,933,1078,1183,1560,2114,2144) censor_Allo_NHL<- c(rep(1,5), rep(0,6)) time_Auto_NHL<- c(42,53,57,63,81,140,176,210,252,476,524,1037) censor_Auto_NHL<- c(rep(1,7), rep(0,1), rep(1,1), rep(0,1), rep(1,1), rep(0,1)) time_Allo_HOD<- c(2,4,72,77,79) censor_Allo_HOD<- c(rep(1,5)) time_Auto_HOD<- c(30,36,41,52,62,108,132,180,307,406,446,484,748,1290,1345)

Customising line type in adjusted survival curves ggadjustedcurves (survminer, ggplot2)

╄→гoц情女王★ 提交于 2020-12-12 09:45:08
问题 I'm trying to plot an adjusted survival curve, but struggling with changing the line types by group. I'm able to customise other aspects of the plot using typical ggplot2 language, but I've hit a wall with changing line type. Example: library(survival) library(survminer) fit2 <- coxph( Surv(stop, event) ~ size + strata(rx), data = bladder ) ggadjustedcurves(fit2, variable = "rx", data = bladder, method = "average", palette = c("#E69F00", "#56B4E9"), size = 1.3, legend = "right", legend.title

Customising line type in adjusted survival curves ggadjustedcurves (survminer, ggplot2)

北慕城南 提交于 2020-12-12 09:44:36
问题 I'm trying to plot an adjusted survival curve, but struggling with changing the line types by group. I'm able to customise other aspects of the plot using typical ggplot2 language, but I've hit a wall with changing line type. Example: library(survival) library(survminer) fit2 <- coxph( Surv(stop, event) ~ size + strata(rx), data = bladder ) ggadjustedcurves(fit2, variable = "rx", data = bladder, method = "average", palette = c("#E69F00", "#56B4E9"), size = 1.3, legend = "right", legend.title

Plot a quadratic relation for a predictor of a cox regression with R

穿精又带淫゛_ 提交于 2019-12-24 18:34:47
问题 I need to plot the relative risk for a quadratic effect in a cox regression. My model looks like this: cox_mod <- coxph(Surv(time, status) ~ ph.karno + pat.karno + meal.cal + meal.cal_q, data = lung) Where meal.cal_q is defined as: lung$meal.cal_q <- lung$meal.cal^2 The plot should consider the coefficients of meal.cal and meal.cal_q and show the relative risk on the y-axis and the meal.cal values on the x-axis. The relative risk should be defined as the risk at a given meal.cal value

MLR - Survival analysis with time-dependent data

独自空忆成欢 提交于 2019-12-24 14:35:05
问题 I am using mlr and would like to be able to use the extended version of the Cox PH model for right-censored, time dependent covariates. This is what I have tried, following the vignette on time-dependent covariates https://cran.microsoft.com/web/packages/survival/vignettes/timedep.pdf (section 3.4): library(survival) library(mlr) data(pbc) temp <- subset(pbc, id <= 312, select=c(id:sex, stage)) # baseline pbc2 <- tmerge(temp, temp, id=id, death = event(time, status)) #set range pbc2 <- tmerge

Interval censored data: Cox proportional hazard and surival difference in R

纵饮孤独 提交于 2019-12-24 07:30:32
问题 there is quite a lot of information (internet and textbooks) on how to do survival analysis in R with the survival package. But I don't find any information on how to do this when you have left censored data. Problem background: I have a self constructed data set with published survival data. Usually the event time and the date of the last follow-up (right censoring) is given. There is however one study that only states that the event happened before day 360. So I left censored this data.