Description Usage Arguments Details Value Note See Also Examples
mphcrm
implements estimation of a mixed proportional hazard competing risk model.
The baseline hazard is of the form exp(X β) where X is a
matrix of covariates, and β is a vector of parameters to estimate.
In addition there is an intercept term μ, i.e. the hazard is exp(X β + μ).
There are several transitions to be made, and a set of X, β, and μ for
each possible transition.
Each individual may have several observations, with either a transition at the end of the observation, or not a transition. It is a competing risk, there can be more than one possible transition for an observation, but only one is taken at the end of the period.
For each individual i there is a log likelihood as a function of μ, called M_i(μ).
The mixture part is that the μ's are stochastic. I.e. we have probabilities p_j, and a vector of μ_j of masspoints (one for each transition), for each such j.
So the full likelihood for an individual is L_i = ∑_j p_j M_i(μ_j).
The mphcrm()
function maximizes the likelihood ∑_i L_i over
p_j, μ_j, and β.
In addition to the covariates specified by a formula, a variable which records the duration of each observation must be specified.
In some datasets it is known that not all risks are present at all times. Like, losing your job when you do not have one. In this case it should be specified which risks are present.
The estimation starts out with one masspoint, maximizes the likelihood, tries to add another point, and continues in this fashion.
1 2 3 4 5 6 7 8 9 
formula 
A formula specifying the covariates.
In a formula like The The The The These three special symbols are replaced with If the covariates differ among the transitions, one can specify covariates conditional on
the transition taken. If e.g. the covariates 
data 
A data frame which contains the covariates. It must be sorted on individuals. 
risksets 
A list of character vectors. Each vector is a list of transitions, i.e. which risks are present for
the observation. The elements of the vectors must be levels of the covariate which is the
left hand side of the 
timing 
character. The timing in the duration model. Can be one of

subset 
For specifying a subset of the dataset, similar to 
na.action 
For handling of missing cases, similar to 
control 
List of control parameters for the estimation. See 
The estimation starts by estimating the nullmodel, i.e. all parameters set to 0, only one intercept for each transition is estimated.
Then it estimates the full model, still with one intercept in each transition.
After the initial model has been estimated, it tries to add a masspoint to the mixing distribution, then estimates the model with this new distribution.
The algorithm continues to add masspoints in this way until either it can not improve the likelihood, or
the number of iterations as specified in control$iters
are reached.
The result of every iteration is returned in a list.
If you interrupt mphcrm
it will catch the interrupt and return with the
estimates it has found so far. This behaviour can be switched off with control$trap.interrupt=FALSE
.
A list, one entry for each iteration. Ordered in reverse order. Ordinarily you will be interested in the first entry.
The algorithm is not fully deterministic. New points are searched for randomly, there is no canonical order in which they can be found. It can happen that a point is found early which makes the rest of the estimation hard, so it terminates early. In particular when using interval timing. One should then make a couple of runs to ensure they yield reasonably equal results.
A description of the dataset is available in datagen
and durdata
,
and in the vignette vignette("whatmph")
1 2 3 4 5 6 7 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.