mspath-class {mspath}R Documentation

Results of a multi-state path calculation

Description

These classes hold the results of likelihood estimation from a call to mspath, either with (mspathFull) or without (mspath) modeling observational measurement error.

Objects from the Class

Result of calls to mspath.

Slots

transCoef:
Estimated transition coefficients, class "mspathCoefficients".
errCoef:
Only mspathFull has this slot, which gives the estimated observation error coefficients. Slot class mspathCoefficients.
calc:
The "mspathCalculator" used to produce this object.
overlap:
Indices in original data frame that were eliminated because of overlapping observations (multiple observations in the same discrete time period. Object of class "numeric".
call:
The call to mspath that created this object. Slot has class "call".
callArgs:
A "list" with the resolved values specified by the user in the call. Each argument captured by ... will be present, but omitted arguments will be absent, even if they have defaults.

To understand the difference between this slot and the previous one, suppose one invokes mspath(qmatrix=b4, ...), and then later redefines b4. Then call will have qmatrix=b4 but callArgs$qmatrix will have the value of b4 at the time of the call.

opt:
The object returned by the call to optim that is used for the likelihood maximization. Slot class "list".

Methods

coef
Estimated coefficients for the transitions, a mspathCoefficients object.
matrixCoef
A list of transition matrices of coefficients. The optional coeff argument is a vector of strings, each being the name of a coefficient of interest; otherwise all are reported.
sd
signature(x="mspath", na.rm="ANY"): Estimated standard deviation of coefficients, or 0 if they are fixed. na.rm is required for compatibility with the general interface for this function, but probably won't work properly.
minus2loglik
signature(x = "mspath"): -2 time the estimated log-likelihood.
nBadNodes
signature(x = "mspath"): Number of invalid nodes generated.
nCases
signature(x = "mspath"): Number of cases, i.e., unique id's, in the input data. The number of individual observations will generally be greater than this.
nGoodNodes
signature(x = "mspath"): Number of unique good nodes on these paths. Note that nodes may be shared between paths, and some "good" nodes turn out not to be on any good paths. Expected likelihood computation time is roughly proportional to this number.
nGoodPathNodes
signature(x = "mspath"): Total number of nodes in all the good paths. goodPathNodes/goodPaths is the average path length. goodNodes/goodPathNodes estimates the speedup from sharing nodes between paths vs a naive implementation that treats each path independently.
nGoodPaths
signature(x = "mspath"): Number of complete good paths on which to compute a likelihood.
optresults
signature(x = "mspath"): The results of the inner call to optim.
optresults<-
signature(x = "mspath"): For internal use only.
print
signature(x="mspath"): print results. If there is an error model, the default behavior is only to show the transition or error coefficients if they were not completely fixed in advance; use the optional showAll=TRUE argument to show the fixed coefficients as well. Other arguments, including general printing parameters and coeff are passed to the coefficient printing routines.
printFooter
signature(x = "mspath"): For internal use only.

Note

The counts are counts over all cases, so the number good paths, for example, is the sum of all the good paths for each case. Currently the counts are not reliable for distributed calculations.

This class currently exists mostly to print out the estimated coefficients. It records other information to preserve the context of the computation, but doesn't currently do much with it. As need arises, the class will be enhanced.

In particular, the class only provides the raw coefficients and their mapping to cells in the matrices. It does not multiply by covariates, calculate implied transition or error probabilities, or otherwise work out the implications of the model.

The related msm package does work out many of the implications of the estimated coefficients (in fact, it does not present the raw coefficients at all in its standard print method). Almost none of the operations there (markov, continuous time models) translate directly into the context of this model (non-markov, discrete time). Also, msm uses S3 classes, while this package uses S4. The only user implication is that the S4 help system is available.

In principle this class could hold sets of coefficients that did not come from maximization; in particular, the coefficients do not have to be estimated ones. Neither the class nor its methods are designed for that use, however.

Author(s)

Ross Boylan ross@biostat.ucsf.edu

See Also

mspath creates these objects. The key values are in mspathCoefficients, which will usually be the mspathEstimatedCoefficients subclass. See optim for details of its results object, which is preserved here. mspathCalculator describes the calculator.


[Package mspath version 0.9-9 Index]