This function is a constructor for the
pdStrat class,
representing a set of positive-definite matrices corresponding to
different strata, defined by
strata. Different
pdMat
classes can be used for different strata, but they must all represent
matrices of equal dimensions and equal row/column names. The number
of coefficients associated with this class is equal to the sum of the
number of coefficients of each
pdMat object it includes. When
value
is
numeric(0), an uninitialized
pdMat
object, a one-sided formula, or a vector of character strings,
object
is returned as an uninitialized
pdStrat object
(with just some of its attributes and its class defined) and needs to
have its coefficients assigned later, generally using the
coef
or
matrix replacement functions.
USAGE:
pdStrat(value, form, nam, data, strata)
REQUIRED ARGUMENTS:
value
an optional initialization value, which can be any of the
following: a
pdMat object, a positive-definite
matrix, a one-sided linear formula (with variables separated by
+), a vector of character strings, a numeric
vector, or a list of
pdMat objects, positive-definite
matrices, or numeric vectors. If given as a list, all of its elements
must represent positive-definite matrices of equal dimensions and
equal row/column names, when converted to
pdMat objects (in
particular, all
pdMat objects must have the same formula).
When not given as a list,
value is repeated for all strata.
Defaults to
numeric(0), corresponding to an uninitialized
object.
form
an optional one-sided linear formula specifying the
row/column names for all
pdMat objects represented by
object. Because factors may be present in
form, the
formula needs to be evaluated on a data.frame to resolve the names it
defines. This argument is ignored when
value is a one-sided
formula. Defaults to
NULL.
nam
an optional vector of character strings specifying the
row/column names for the matrices represented by
object. It
must have length equal to the dimension of the underlying
positive-definite matrices and unreplicated elements. This argument is
ignored when
value is a vector of character strings. Defaults to
NULL.
data
an optional data frame in which to evaluate the variables
named in
value,
form, and
strata. It is used to
obtain the levels for
factors, which affect the
dimensions and the row/column names of the underlying matrix. If
NULL, no attempt is made to obtain information on
factors appearing in the formulas. Defaults to the
parent frame from which the function was called.
strata
a one-sided formula specifying the stratification variable
for the different
pdMat objects represented by
object. Its right hand side must evaluate to a factor or an
integer in
data.
VALUE:
a
pdStrat object representing a set of positive-definite
matrices corresponding to different strata.
SEE ALSO:
EXAMPLES:
pd1 <- pdStrat(list(pdSymm(diag(2)), pdDiag(c(1,0))), form = ~age,
data = Orthodont, strata = ~Sex)
pd1