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.
Questions tagged [hazard]
59 questions
0
votes
1 answer
Find local maximum for lifelines hazard function
I'm trying to find a method to detect local maximum points for hazard function (plotted using lifelines library).
Lifelines library gives you the ability to plot visually the hazard function ( plot.hazard() ) but - as said - it's only the visual…

Stefano Puccini
- 89
- 10
0
votes
2 answers
Predicting baseline cumulative hazard using predict.coxph in r
My aim is to predict (predict cumulative hazard for a new observation from the fitted model below) the cumulative hazard value from the time scale 0 to the start time from the fitted model.
I have fitted the cox model using 2 times (start time which…

Aria
- 37
- 4
0
votes
1 answer
Subset data in R on the condition of decreasing values
couldn´t find a question alike, so here we go:
I have a large dataset in R and I want to prepare it for hazard analysis. I thus want to create a dichotomous survival variable. However my hazard event has a relative interpretation and is not just a…

philipp.kn_98
- 139
- 9
0
votes
1 answer
cox proportional hazard regression in SPSS using reference group
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…

Tabbi
- 69
- 1
- 9
0
votes
1 answer
Determine Median Residual Lifetime of Lognormal Distribution
Stefan Gelissen provides and excellent overview on how to determine median residual lifetime of a lognormal distribution in his blog here
However, when running his code, I stumbled upon this line
(mdrlhat <- uniroot(mdrl, c(0, 1e+9), t=t, Xmu=Xmu,…

quantmarketing
- 37
- 6
0
votes
1 answer
Unequal intervals on y-axis
I want to plot hazard ratios (hr) and confidence intervals from published summary data where I have the respective publication on the x-axis and the hazard ratios on the y-axis.
Currently, my y-axis reads: (-3, -2, -1, 0, 1, 2, 3), which gives an…

Pharmaco economics
- 21
- 7
0
votes
0 answers
How can you extract hazard rate(s) from an cox proportions model in R
I've fit a multivariate cox proportions model with significant covariates. After fitting test data, the predict function clearly returns hazard ratios (ranging from positive values to negative values). This clearly makes sense to me as the more…

msubbaiah
- 350
- 2
- 14
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
0
votes
0 answers
Does expected value of F(x)/x(1-F(x)) have a name, F(x) is CDF? Is it related to hazard function?
I was solving a problem and encountered the following:
\sum (f(x)/x) (F(x)/(1-F(x))
Here f(x) is pmf and F(x) is CDF. Is expected value of F(x)/x(1-F(x)) a known function? I found out that f(x)/(1-F(x)) is called hazard function. Also, x is defined…

Joe
- 79
- 3
0
votes
1 answer
Error in forestplot.default: You have provided 2 rows in your mean argument while the labels have 34 rows
I am trying to make a forestplot in R.
Sample provided by this site: https://designdatadecisions.wordpress.com/2016/07/02/forest-plot-with-horizontal-bands/
Starting with reading the data in R.
Formatting so the column labels and columns…

Kweetvannix
- 61
- 1
- 10
0
votes
1 answer
How can I convert cumulative hazard probabilities to conditional/marginal probabilities?
I am building a forecast model using AalenAdditiveFitter from Lifelines in Python to predict whether an event will occur or not and when.
T (time) = months
C (event) = 1 is yes and 0 is no
In addition I have 8 attributes that I am using.
aaf =…

zad0xlik
- 183
- 1
- 4
- 14
0
votes
2 answers
coxme proportional hazard assumption
I am running mixed effect Cox models using the coxme function {coxme} in R, and I would like to check the assumption of proportional hazard.
I know that the PH assumption can be verified with the cox.zph function {survival} on cox.ph model.
However,…

user3637399
- 41
- 1
- 1
- 4
-1
votes
1 answer
Unexpected Input in every exponent of my code
I received these error when i try these code
> fk <- function(u.vect, lambda, alpha, beta, x, k) {
+ res <- sapply(u.vect, function(u) {
+ # Cause-specific hazard
+ hk <-
+ lambda[k] * alpha[k] * (uˆ(alpha[k] - 1)) *…
-2
votes
1 answer
Create inverse Kaplan Meier curve with response percents and time
I am trying to create an inverse KM plot of the time it takes for patients to respond to drug therapy.
Time response
3 57
4 35
4 85
4 90
5 55
6 65
6 89
6 72
9 97
9 89
9 98
10 99
10 92
13 99
14 50
15 97
18 60
21 70
25…

Reeham
- 1
- 3