For a general Markov chain multi-state model with interval censored
transitions calculate the NPMLE of the transition intensities. The estimates
are returned as an msfit
object. The smallest time
in the data will be set to zero.
smoothmsm(
gd,
tmat,
exact,
formula,
data,
deg_splines = 3,
n_segments = 20,
ord_penalty = 2,
maxit = 100,
tol = 1e-04,
Mtol = 1e-04,
conv_crit = c("haz", "prob", "lik"),
verbose = FALSE,
prob_tol = tol/10,
ode_solver = "lsoda",
ridge_penalty = 1e-06
)
A data.frame
with the following named columns
id
:Subject idenitifier;
state
:State at which the subject is observed at time
;
time
:Time at which the subject is observed;
The true transition time between states is then interval censored between the times.
A transition matrix as created by transMat
Numeric vector indicating to which states transitions are observed at exact times.
Must coincide with the column number in tmat
.
Formula to interpret in data for covariates.
A data.frame
containing a column called 'id'
(identifying the subjects in gd
) and
variables which to interpret in formula
.
Degree to use for the B-spline basis functions. Defaults to 3 (cubic B-splines).
Number of segments to use for the P-splines. The segments will space the domain evenly. According to Eilers & Marx (2021), it it OK to choose this number very large. Default = 20.
Order of the P-spline penalty (penalty on the difference between d-order differences of spline coefficients). See Eilers & Marx Section 2.3. Defaults to 2.
Maximum number of iterations. Default = 100.
Tolerance of the convergence procedure in the E-step. A change in the value of
conv_crit
in an iteration of less than tol
will make the procedure stop.
Tolerance of the convergence procedure of the M-step. The M-step
consists of an Iteratively Reweighted Least Squares (IRLS) procedure, where
the (unobserved) complete-data likelihood is maximized. Default is 1e-4
.
Convergence criterion. Stops procedure when the difference
in the chosen quantity between two consecutive iterations is smaller
than the tolerance level tol
. One of the following:
Stop when change in maximum estimated intensities (hazards) < tol
.
Stop when change in estimated probabilities < tol
.
Stop when change in observed-data likelihood < tol
.
Default is "haz". The options "haz" and "lik" can be compared across different
method
s, but "prob" is dependent on the chosen method
. Most
conservative (requiring most iterations) is "prob", followed by "haz" and finally "lik".
Should iteration messages be printed? Default is FALSE
If an estimated probability is smaller than prob_tol
,
it will be set to zero during estimation. Default value is tol/10
.
The integrator to use for solving the ODE's. See
ode()
. By default, the "lsoda" solver will be used.
The ridge penalty to use for estimating risk-adjustment coefficients. Default = 1e-06.
Eilers, P.H.C. and Marx, B.D., Practical Smoothing: The Joys of P-splines, Cambridge University Press (2021)