This is adapted from mstate::trans.illness
.
Create a complete binary tree transition matrix.
Examples
trans_binarytree(c("A", "B"), depth = 2)
#> to
#> from 1 2 3 4 5
#> 1 NA 1 2 NA NA
#> 2 NA NA NA 3 4
This is adapted from mstate::trans.illness
.
Create a complete binary tree transition matrix.
trans_binarytree(c("A", "B"), depth = 2)
#> to
#> from 1 2 3 4 5
#> 1 NA 1 2 NA NA
#> 2 NA NA NA 3 4