qmatrix.msm | R Documentation |
msm
objectDraw transition intensity matrices for a probabilistic sensitivity analysis
from a fitted msm
object.
## S3 method for class 'msm' qmatrix(x, newdata = NULL, uncertainty = c("normal", "none"), n = 1000, ...)
x |
A |
newdata |
A data frame to look for variables with which to predict. A
separate transition intensity matrix is predicted based on each row in
|
uncertainty |
Method used to draw transition intensity matrices. If |
n |
Number of random observations of the parameters to draw. |
... |
Further arguments passed to or from other methods. Currently unused. |
An array of transition intensity matrices with the third dimension
equal to the number of rows in newdata
.
qmatrix.matrix()
library("msm") set.seed(101) qinit <- rbind( c(0, 0.28163, 0.01239), c(0, 0, 0.10204), c(0, 0, 0) ) fit <- msm(state_id ~ time, subject = patient_id, data = onc3p[patient_id %in% sample(patient_id, 100)], covariates = list("1-2" =~ age + strategy_name), qmatrix = qinit) qmatrix(fit, newdata = data.frame(age = 55, strategy_name = "New 1"), uncertainty = "none") qmatrix(fit, newdata = data.frame(age = 55, strategy_name = "New 1"), uncertainty = "normal", n = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.