qmatrix.msm {hesim} | R Documentation |
Transition intensity matrix from msm
object
Description
Draw transition intensity matrices for a probabilistic sensitivity analysis
from a fitted msm
object.
Usage
## S3 method for class 'msm'
qmatrix(x, newdata = NULL, uncertainty = c("normal", "none"), n = 1000, ...)
Arguments
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. |
Value
An array of transition intensity matrices with the third dimension
equal to the number of rows in newdata
.
See Also
qmatrix.matrix()
Examples
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)