Description Usage Arguments Value Author(s) Examples
Obtain hazard function based on specified starting states and destination state.
1 2 | hazard_times(start = 0, end, state_of_interest,
at_risk_states, alpha, rate, length.out = 1000)
|
start |
start time for the hazard estimates |
end |
end time for the hazard estimates |
state_of_interest |
destination state |
at_risk_states |
potential states of origin |
alpha |
starting distribution (vector) |
rate |
latent CTMC rate matrix to estimate the hazard |
length.out |
number of points between start and end times to estimate the hazard |
hazard |
estimated hazard at different times |
times |
times at which hazard is estimated |
.
Jane Lange
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
library(cthmm)
data(panel_demodata)
rates.list=get.rate.matrix.list(current.params=fit.4state$param[1:8],
rate.setup=rates.setup, do.list=T)
rate.firstpassage.AB_0=rates.list[[200]]
rate.firstpassage.AB_0[3:4,]=0
hazardA.B_0=hazard_times(start=.01,end=10,state_of_interest=c(3),
at_risk_states=c(1,2),alpha=c(1,0,0,0),rate.firstpassage.AB_0)
plot(hazardA.B_0$times,hazardA.B_0$haz,type="l",ylab="hazard",xlab="time since entrance in state A",
main="Hazard function for first passage time from state A to B, for covariate X=0")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.