sub_dist_times: Latent CTMC subdistribution functions

Description Usage Arguments Value Author(s) Examples

View source: R/functionals.R

Description

Obtain subdistribution functions or transition probabilities for specified starting and destination states.

Usage

1
2
  sub_dist_times(start = 0, end, states, alpha, rate,
    length.out = 1000)

Arguments

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.

Value

dist

estimated subdistribution at different times

times

times at which subdistribution function is esitmated

.

Author(s)

Jane Lange

Examples

 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)

cthmm documentation built on May 2, 2019, 5:46 p.m.