Learn R Programming

msm (version 0.4.1)

crudeinits.msm: Calculate crude initial values for transition intensities

Description

Calculates crude initial values for transition intensities by assuming that the data represent the exact transition times of the Markov process.

Usage

crudeinits.msm(state, time, subject, qmatrix, data=NULL, fromto=FALSE,
               fromstate=NULL, tostate=NULL, timelag=NULL,
               censor=NULL, censor.states=NULL, check=FALSE)

Arguments

state
Observed states, assumed to be ordered by time within each subject.
time
Times at which the elements of state were observed.
subject
Subject identification numbers corresponding to state. If not given, all observations are assumed to be on the same subject.
data
An optional data frame in which the variables represented by subject and state can be found.
qmatrix
Matrix of indicators for the allowed transitions. Specified as described in the help page for msm. An initial value will be estimated for each value of qmatrix that is 1.
fromto
If TRUE, then the data are given as three vectors, from-state, to-state, time-difference, representing the set of observed transitions between states, and the time taken by each one. Otherwise, the data are given by
fromstate
Starting states for the observed transitions (required if fromto == TRUE ).
tostate
Finishing states for the observed transitions (required if fromto == TRUE ).
timelag
Time difference between observing fromstate and tostate (required if fromto == TRUE ).
censor
A state, or vector of states, which indicates censoring. See msm.
censor.states
Specifies the underlying states which censored observations can represent. See msm.
check
Should the supplied state, time and subject data be checked for inconsistency with the supplied qmatrix, for example, backward transitions in the data with a forward progression model. This check is rather slow, and not performed

Value

  • A named vector of estimates for the initial values of each transition intensity. For simple models with no covariates, this can be used as the inits argument to msm.

Details

Suppose we want a crude estimate of the transition intensity $q_{rs}$ from state $r$ to state $s$. If we observe $n_{rs}$ transitions from state $r$ to state $s$, and a total of $n_r$ transitions from state $r$, then $q_{rs} / q_{rr}$ can be estimated by $n_{rs} / n_r$. Then, given a total of $T_r$ years spent in state $r$, the mean sojourn time $1 / q_{rr}$ can be estimated as $T_r / n_r$. Thus, $n_{rs} / T_r$ is a crude estimate of $q_{rs}$.

If the data do represent the exact transition times of the Markov process, then these are the exact maximum likelihood estimates.

Censored states are ignored when calculating these estimates.

See Also

statetable.msm

Examples

Run this code
## Aortic aneurysm growth data
data(aneur)

## Three-state one-way progression model 
oneway.q <- rbind( c(0, 1, 0, 0), c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 0, 0, 0))

## Crude initial values for 1-2, 2-3 and 3-4 transition intensities 
crudeinits.msm(fromstate=from, tostate=to, timelag=dt, fromto=TRUE,
               data=aneur, qmatrix=oneway.q)

Run the code above in your browser using DataLab