#Make the transition probability matrix P <- matrix(c(0.92, 0.05, 0.03, 0, 0.76, 0.24, 0, 0, 1), ncol=3, byrow=T) ############ ############ #S is matrix of transition probs among nonabsorbing states 1 and 2 (H, C) S <- matrix(c(0.92,0.05, 0,0.76), ncol=2, byrow=T) I <- diag(2) #This is our Q matrix! Q <- solve(I-S) ############ #Row sums! apply(Q, 1, sum) ############ #T is matrix of transition probs from nonabsorbing states to absorbing states T <- matrix(c(0.03, 0.24), ncol=1, byrow=T) ############ #QT QT <- Q %*% T