Skip to main content
Filter by
Sorted by
Tagged with
4 votes
1 answer
94 views

I am trying to understand how the predict function works for conditional logit. I tried to calculate it manually but it does not work. Any help would be greatly appreciated. library(survival) set....
Pam G's user avatar
  • 57
0 votes
0 answers
48 views

Can stepwise selection method be used in COX Mixed model with R? lmerTest and cAIC4 packages both don't work. In addition, is LASSO a better process to select predictors for regression models, ...
Ting Zhang's user avatar
0 votes
1 answer
63 views

I encountered various errors while running the spatstat package. Here is a summary of my data: a shapefile of landslide point events, a watershed shapefile as the observation window, and several ...
alipin ng sahod's user avatar
1 vote
0 answers
31 views

I am using the "rms" package to graph predicted values of a coxph model. However, my graphs do not show my entire range of values. Upon inspection, the package vignette under the "...
blake.struthers's user avatar
0 votes
1 answer
138 views

I am trying to calculate the hazard rate of two treatments, which have more risk early in time compared to later. I've provided an example dataset and analysis below to highlight my situation. I've ...
ctlamb's user avatar
  • 133
2 votes
0 answers
149 views

I am currently trying to train a deep learning model with CoxPh loss, (kind of like deepSurv but different model. The thing is when I evaluate the model using C-statistics, the s-score from sksurv is ...
Azka's user avatar
  • 21
1 vote
2 answers
3k views

i am trying to run cox regression model in R studio but facing same error every time. cox.model <-coxph(Surv(dat$los, dat$died) ~ gender, data=dat) Error in coxph(Surv(dat$los, dat$died) ~ gender, ...
Statistician's user avatar
0 votes
1 answer
153 views

I need to extract into a new column the number of observations per level from a Cox regression object. If I run: res <- coxph(Surv(age, status) ~ score, data = df) res %>% tbl_regression(exp = T)...
karamba's user avatar
0 votes
1 answer
109 views

I have data on earthquake epicenters. While I am trying to fit a LGCP to it, I get the error message as below when I print the result of my model: Inhomogeneous Cox point process model Fitted to point ...
Salma's user avatar
  • 13
0 votes
0 answers
237 views

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 case. (https://cran.r-...
JY J's user avatar
  • 21
2 votes
1 answer
125 views

I am attempting to reproduce in R Cox survival model results originally obtained in Stata. Here is the Stata code: stset t, id(leadid) failure(c_coup) stcox legislature lgdp_1 growth_1 ...
w5698's user avatar
  • 315
1 vote
0 answers
30 views

Consider the model: h(t, X) = h0(t) exp [clin2 + prison + dose + clin2gt] where the variables are defined as follows: clin2 is time dependent (categorical coded 1/0); survt follow-up time in days; ...
Anthony Cutajar's user avatar
2 votes
1 answer
1k views

Im running a series of coxph models in R and compiling the output into latex tables using the modelsummary package and command. The coxph provides SE and robust se as outputs and the p-value is based ...
dmort's user avatar
  • 301
1 vote
1 answer
337 views

I am trying to create a summary table for my Cox model. However, when I use modelsummary function, it gives me a table that shows coef. But I want to display exp(coef) on my summary table. How can I ...
hobsbawm's user avatar
1 vote
1 answer
667 views

I have a dataset where 3 groups have recieved exposure to different media. One group is exposed to 1 of the 3 media. Therefore, my coxph model is stratified: # My treatment variable is loaded as a ...
asellus's user avatar
  • 69
0 votes
0 answers
215 views

I´m working on a time-to-event model 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 ...
Mattias's user avatar
1 vote
0 answers
670 views

I am trying to use survival_probability_calibration to visualize the performance of Cox model but the calibration curve would always stay flat as shown in the following plot: Calibration curve with ...
Ali Fahmi's user avatar
0 votes
2 answers
1k views

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(...
momaz's user avatar
  • 1
4 votes
0 answers
563 views

I am trying to draw a forest plot for the results of cox model with repeated measures considering subjects ids; here is a part of my big data; data <- read.table(header=TRUE, text=" Id ...
Katie's user avatar
  • 139
3 votes
0 answers
1k views

I am trying to learn what the various outputs of predict.coxph() mean. I am currently attempting to fit a cox model on a training set then use the resulting coefficients from the training set to make ...
Mao Pineda's user avatar
0 votes
1 answer
800 views

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, ... ...
steffie22's user avatar
0 votes
0 answers
107 views

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 =...
Cryena's user avatar
  • 33
3 votes
2 answers
1k views

I am using the ovarian dataset from the survival package using the following standard code: ovarian$rx <- factor(ovarian$rx, levels = c("1", "2"), labels = c("A", &...
Nora_R's user avatar
  • 61
0 votes
0 answers
755 views

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 "...
SpencerS's user avatar
1 vote
1 answer
2k views

I have questions about multivariable cox regression analysis including non-binary categorical variables. My data consists of several variables, and some of them are binary (like sex, and age over 70, ...
user11602587's user avatar