mspathCoefficients-class {mspath} | R Documentation |
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 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.
permit
:"matrix"
of "logical"
values
indicating which entries are permitted. The diagonal is always FALSE
.params
:mspathEstimatedCoefficients
if that's a
concern. ("numeric"
) baseConstrVec
:"integer"
, starting at 1, for
constraints on the intercepts. covVars
:"character"
).constrVec
:"integer"
, starting at 1, with
constraints on the covariates. Empty vector if no covariates. pathVars
:"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"
. signature(object="mspathCoefficients")
: Vector of
all coefficientscoeff
argument is a vector of names of
coefficients of interest; otherwise all are reported.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.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.signature(object="mspathCoefficients")
:
TRUE
because all values are fixed in advance.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)
.
signature(object="mspathCoefficients")
: print the
object, returning invisible(NULL)
.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.
Ross Boylan ross@biostat.ucsf.edu
mspathEstimatedCoefficients
for estimated
coefficients, mspath
for general background, and
printCoefmat
for optional arguments to the print function.
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)