mspathCoefficients-class {mspath}R Documentation

Class "mspathCoefficients"

Description

This class contains coefficients for the multi-state path model. It knows about constraints. End users need not be aware of this class, except for the arguments to the print function.

Objects from the Class

Objects can be created by calls of the form mspathCoefficients(permit, params, offset, baseConstrVec, covVars, constrVec, pathVars, pathConstrVec). The arguments are the same as for the slots, though the type restrictions are less severe; any numeric is fine. Note that "intercept" is not a legal name to pass in for covVars or pathVars, and that names should be unique across the last two arguments. I.e., don't give a covariate the same name as a path variable.

Slots

permit:
"matrix" of "logical" values indicating which entries are permitted. The diagonal is always FALSE.
params:
All the model parameters, in the canonical order for mspath. There is no distinction between free and fixed parameters in this class; use mspathEstimatedCoefficients if that's a concern. ("numeric")
baseConstrVec:
"integer", starting at 1, for constraints on the intercepts.
covVars:
Names of the covariates, if any ("character").
constrVec:
"integer", starting at 1, with constraints on the covariates. Empty vector if no covariates.
pathVars:
Names of path-dependent variables, if any ("character").
pathConstrVec:
"integer", starting at 1, with constraints on the path variables. Empty if no path variables.
iEff:
"integer" indices of effective parameters in params. This permits identification of the subset of params of interest.
map:
map["vname"] gives a matrix of integer's. Each entry that is non-zero indicates that, for variable "vname" in that matrix position, the coefficient comes from the corresponding parameter. Use "intercept" to retrieve the intercepts, and the names of covariates or path-dependent variables to retrieve those values. This slot is a "list".

Methods

coef
signature(object="mspathCoefficients"): Vector of all coefficients
matrixCoef
A list of transition matrices of coefficients. The optional coeff argument is a vector of names of coefficients of interest; otherwise all are reported.
sd
signature(x="mspathCoefficients", na.rm="ANY"): Vector of 0's of same length as coefficients. This class is not for estimates. na.rm is ignored.
matrixCoef
signature(x="mspathCoefficients", ...): A list of matrices with the coefficient values for each matrix element and 0 for those not allowed. The optional argument coeff gives the names of terms to return; use "intercept" for the intercept.
isAllFixed
signature(object="mspathCoefficients"): TRUE because all values are fixed in advance.
print
signature(x="mspathCoefficients", ...): print out the coefficient values. The printout consists of blocks of coefficients related to a particular covariate. Each line indicates the matrix element(s) the coefficient applies to, the index in the parameter list from which the element comes, and the value of the coefficient. For the matrix element, i -> j indicates row i, column {j}, which is either the transition from i to j or true state i observed as state j.

Parameters that apply to several covariates because of constraints will appear in several places.

The optional named argument coeff is a character vector of coefficient names. If provided, only those coefficients will be printed out, in the order given. Use "intercept" to get the intercept.

... allows one to use further arguments to control the details of the printout; see printCoefmat for details.

Returns invisible(x).

show
signature(object="mspathCoefficients"): print the object, returning invisible(NULL).

Note

For full details of the ordering of the different values and the interpretation of the constraints, see mspath.

In places above where the names of covariates or coefficients are called for, the exact meaning is names in the design matrix. So, for example, if avar is a factor, the actual names you will enter are avar2, avar3, etc (exact details depend on your choice of contrasts and the levels of the variables).

It is likely in the future this will include more methods, for example to multiply coefficients by covariates.

The terminology above is a bit loose and confusing. Sometimes covariate or coefficient refers to terms that include the intercept and the path variables. Sometimes coefficient refers to a particular estimated parameter. And sometimes, as in the “names of covariates” it refers to a covariate plus a factor addition.

Author(s)

Ross Boylan ross@biostat.ucsf.edu

See Also

mspathEstimatedCoefficients for estimated coefficients, mspath for general background, and printCoefmat for optional arguments to the print function.

Examples

permissible <- matrix(0, nrow=3, ncol=3)
permissible <- row(permissible)+1 == col(permissible)
covNames <- c("a", "b")
pathNames <- c("TIS", "TSO")
covConstraint <- seq(4)
covConstraint[4] <- 2
pathConstraint <- c(1, 1, 2, 3)
c <- mspathCoefficients(permissible,
                   params=seq(from=.1, by=.1, len=18),
                   offset=10,
                   baseConstrVec=seq(2),
                   covVars=covNames,
                   constrVec=covConstraint,
                   pathVars <- pathNames,
                   pathConstrVec <- pathConstraint
                   )
print(c)


[Package mspath version 0.9-9 Index]