Tint <- 0
Q <- matrix(
c(
-0.3, 0.2, 0.1,
0 ,-0.4, 0.4,
0 , 0, 0
), 3, 3, byrow = TRUE
)
dim(Q) <- c(3,3,1)
pi <- c(1,0,0)
abs <- c(0,0,1)
my_density <- dmstate_fun(Tint, Q, pi, abs)
my_distribution <- pmstate_fun(Tint, Q, pi, abs)
my_hazard <- hmstate_fun(Tint, Q, pi, abs)
my_cumulative_hazard <- chmstate_fun(Tint, Q, pi, abs)
my_survival <- smstate_fun(Tint, Q, pi, abs)
t <- seq(0,20, by=0.1)
par(mfrow=c(3,2))
plot(t, my_density(t), type="l")
plot(t, my_distribution(t), type="l")
plot(t, my_hazard(t), type="l", ylim=c(0,1))
plot(t, my_cumulative_hazard(t), type="l")
plot(t, my_survival(t), type="l")
Tint <- 0
Q <- matrix(
c(
-0.3, 0.2, 0.1,
0 ,-0.4, 0.4,
0 , 0, 0
), 3, 3, byrow = TRUE
)
dim(Q) <- c(3,3,1)
pi <- c(1,0,0)
abs <- c(0,0,1)
my_obj <- multistate_functions(Tint, Q, pi, abs)
t <- seq(0,20, by=0.1)
plot(t, my_obj$d(t), type="l")
Run the code above in your browser using DataLab