Questions tagged [hazard]

The Hazard function is used in survival analysis. It is the estimated number of events divided by the number of persons or units at risk for the particualr event per unit time.

59 questions
0
votes
0 answers

Cox hazard regression for categorical variables when only with few events to get hazard ratio for each class in R

I try to find the hazard ratio for each class (total of 5 classes in this categorical variable I called "group"), and I also tried dichotomies but the results were still not good. Here only 8 events out of 97 subjects My data got 97 ID(subjects), 97…
GIAGUN
  • 1
  • 1
0
votes
1 answer

How to generate a smoothed hazard plot in R?

I am trying to replicate some analyses that someone performed in Stata. They used a function (or program as they are called in Stata?) called "stexpect3" to generate a "smoothed hazard plot" like this. Wondering if anyone can point me in the…
krtbris
  • 344
  • 1
  • 9
0
votes
0 answers

How to plot a restricted cubic spline with A on the x-axis and the hazard of death on the y-axis?

I want to depict Restricted cubic spline models to show the association of A with all- cause mortality. I have used the following function. How can I change the y-axis to "hazard ratio of death" ? enter image description here Please let me know what…
0
votes
2 answers

Ggsurvplot doesn't work and the basic plot of the survival curve shows the cumulative hazard plot instead

for a project I'm conducting a survival analysis in R on two datasets analysing how much survival time depends on some blood biomarkers; one was used for development and one for validation. The problem is when I try to launch the plots of the…
0
votes
0 answers

How to obtain WeibullPH Regression model coefficients

Let us assume we use the following code to generate random data from a Weibull Proportional Hazard distribution: library(flexsurv) Beta <- 1.9 #shape theta0 <- 0.1 # scale theta1 <- 0.2 x = c(6, 5, 5, 6, 4, 5, 8, 2, 7, 5) n <- length(x) Gamma <-…
Hanan
  • 1
0
votes
0 answers

Form of cubic spline hazard function for Cox Regression

I am trying to understand the form of piecewise hazard function for piece wise Cox regression. I have python codes and output below. My focus is also to find the formula for python output. What is the formula for hazard function for below python…
melik
  • 1,268
  • 3
  • 21
  • 42
0
votes
0 answers

Restricted Cubic Spline in R: How do I change 'log Relative Hazard' in to 'Hazard Ratio' in the Y-axis?

Please I need help on how to change the Y-axis to give information on Hazard ratio rather than Log Relative Hazard (which seem to be a default) in a restricted Cubic spline performed for Cox Regression Model in R. Note, I'm new with using R I expect…
Mike
  • 1
  • 1
0
votes
1 answer

How to create an aesthetically pleasant Hazard Ratio Chart in R

I was looking at a Youtube video I found online. I'm new to survival analysis. The host mentioned that the second graph was created using a mixture of packages Broom & ggplot2. Any ideas? # Current Code: sigMod = coxph(Surv(time, DEATH_EVENT) ~…
Antonio
  • 417
  • 2
  • 8
0
votes
1 answer

Create a sequence before an indicator variable

I'm looking to do hazard analysis but before I do that I want to clean my dataset so I have only the data from right before a "death", if you will. I'm studying countries and since countries don't "die" per say I need to basically find the point…
0
votes
0 answers

Double data hazard in MIPS

According to the book Computer Organization and Design by Patterson and Hennesy (5th ed, page 310): One complication is potential data hazards between the result of the instruction in the WB stage, the result of the instruction in the MEM stage,…
swamp
  • 276
  • 1
  • 8
0
votes
1 answer

What to deal with time-dependent variables in cox proportional hazard model in r

I have a question about the time-dependent variables in cox model. Supposed that I have three phases and the event may happen in any time and how can I fit these three time-dependent variables, tr1, tr2, tr3, in cox model? The sample dataset is…
Fox_Summer
  • 149
  • 6
0
votes
0 answers

Survival function from aalen function in R

I am using the aalen function from the package timereg in R to perform survival analysis on some data. An example from the documentation looks like: data(sTRACE) # Fits Aalen model…
Anton
  • 1
0
votes
1 answer

"coefficient may be infinite" even with non-zero events

I'm performing survival analysis for a couple of very simple datasets: dt.pat1 <- data.frame( Marker=c(F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T), Event=c(F,T,F,F,F,F,F,F,F,T,T,F,F,F,F,T,F,T,T,T,T,T), …
Vasily A
  • 8,256
  • 10
  • 42
  • 76
0
votes
0 answers

SAS PHREG test for trend?

I am running a PHREG model with mortality as the outcome and quartiles of protein X as my predictor (where quartile 1= ref). I was able to get the HR for quartile 2, 3, and 4, and their respective p-values- which are not significant (0.8, 0.4, 0.2)…
S P
  • 1
0
votes
1 answer

Plotting Hazard Function with bshazard package + Hazard ratios in life table

I'm trying to plot the hazard function of a survival analysis I'm doing for my PhD, comparing the hazard rate of two different conditions. I can't find a way to make the code function as intended (here for reference, Fig. 4, page 7), in order to…