Description Usage Arguments Value Author(s) Examples
Obtain subdistribution functions or transition probabilities for specified starting and destination states.
1 2 | sub_dist_times(start = 0, end, states, alpha, rate,
length.out = 1000)
|
start |
start time for the hazard estimates |
end |
end time for the hazard estimates |
states |
destination state(s) |
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 subdistribution function. |
dist |
estimated subdistribution at different times |
times |
times at which subdistribution function is esitmated |
.
Jane Lange
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## 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
cdfA.B_0=sub_dist_times(start=.01,end=10,states=3,
alpha=c(1,0,0,0),rate.firstpassage.AB_0)
plot(cdfA.B_0$times,cdfA.B_0$dist,type="l",ylab="CDF",xlab="time since entrance in state A",
main="Cumulative distribution 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.