mspathEstimatedCoefficients-class {mspath} | R Documentation |
This class describes estimated coefficients for the multi-state path model. It knows which coefficients are fixed before estimation and which are constrained to be equal. It knows about the errors of the estimates as well. Ordinary users will only care about the arguments to the print function.
Create these objects by calling mspathCoefficients(permit, params, offset, baseConstrVec, covVars,
constrVec, pathVars, pathConstrVec, fixed=integer(0), n=Inf,
var=numeric(0))
. var
is the estimated variance for all free
parameters in this and other coefficients. For other
parameters, see slot definitions for details, except that arguments to
this function can use more general types like numeric
.
fixed
:"integer"
).n
:"numeric"
).foundSE
:"logical" TRUE
if the estimate appears
to have converged.var
:"numeric"
estimate of the variances of the
effective parameters, with 0's for the fixed parameters. Only valid if
foundSE == TRUE
; otherwise it will be numeric(0)
.
Careful: the variances passed in to the constructor are for
all free parameters in all coefficients; this slot has variances for
both free and fixed parameters for this coefficient set only.
The remaining items are inheritted from mspathCoefficients
:
permit
:"matrix"
of "logical"
values
indicating which entries are permitted. The diagonal is always FALSE
.params
:"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. 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"
.
Class "mspathCoefficients"
, directly.
signature(object="mspathCoefficients")
:
usually FALSE
, but TRUE
if all parameters are fixed.signature(object="mspathEstimatedCoefficients")
: Vector of
all coefficients, fixed and free. These are the effective
coefficients, meaning that if constraints make two coefficients
equal, only a single term will appear for them.signature(x="mspathCoefficients"), na.rm="ANY"
: Vector of
estimated standard deviations of the results of coef()
.
The na.rm
probably won't work correctly.signature(x="mspathEstimatedCoefficients", coeff, ...)
: 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
(negative index if fixed),
the estimated (or fixed) value of the coefficient, the estimated
standard error of the estimate (or NA
for fixed values),
and various measures of statistical significance.
Parameters that apply to several covariates because of constraints will appear in several places.
The optional argument coeff
is a character
vector of
coefficient names. If provided, only those coefficients will be
printed out, in the order given.
... allows one to use further arguments to control the details
of the printout; see printCoefmat
for details.
Purists will note that neither coeff
nor ...
is part
of the method signature. They are acceptable arguments to the
function, however.
Returns invisible(x)
.
signature(object="mspathEstimatedCoefficients")
: print the
object, returning invisible(NULL)
.
foundSE
will be TRUE
if the hessian is positive
definite. In that case, var
has the diagonal of the inverse of
the hessian.
Ross Boylan ross@biostat.ucsf.edu
mspath
gives full information about paramter order and
constraints. mspathCoefficients
is my parent
class.
printCoefmat
describes additional optional arguments to
the print function.
# 5 x 5, history but no covariates permissible <- matrix(c( 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0), ncol=5, byrow=TRUE) pathConstraint <- c(1, 1, 2, 3, 1, 1, 4, 5, 2, 6, 7, 8, 2, 8, 7, 8, 9, 10, 11, 12) baseConstraint <- c(1, 1, 2, 3, 1, 1, 4, 5, 2, 6) pathNames <- c("TIS", "TSO") fixed <- c(3, 10, 11) var <- seq(from=30, by=5, length.out=15)^2 c <- mspathEstimatedCoefficients(permissible, params= 101:118, baseConstrVec=baseConstraint, pathVars=pathNames, pathConstrVec = pathConstraint, fixed=fixed, n=50, var=var) # default show method c # optional print arguments print(c, coeff=c("intercept", "TIS"), digits=2)