Objects of class, response
, contain response values, and possibly
the corresponding times, binomial totals, nesting categories, censor
indicators, and/or units of precision/Jacobian. Objects of class,
tccov
, contain time-constant or inter-individual, baseline
covariates. Objects of class, tvcov
, contain time-varying or
intra-individual covariates. Objects of class, repeated
,
contain a response
object and possibly tccov
and
tvcov
objects.
In formula and functions, the key words, times
can be used to
refer to the response times from the data object as a covariate,
individuals
to the index for individuals as a factor covariate,
and nesting
the index for nesting as a factor covariate. The
latter two only work for W&R notation.
The following methods are available for accessing the contents of such
data objects.
as.data.frame
: places all of the variables in the data object
in one dataframe, extending time-constant covariates to the length of
the others unless the object has class, tccov
. Binomial and
censored response variables have two columns, respectively `yes' and
`no' and response and censoring indicator, with the name given to the
response.
as.matrix
: places all of the variables in the data object
in one matrix, extending time-constant covariates to the length of
the others unless the object has class, tccov
. If any
covariates are factor variables (instead of the corresponding sets of
indicator variables), the matrix will be character instead of numeric.
covariates
: extracts covariate matrices from a data object (for
formulae and functions, possibly for selected individuals. See
covariates.formulafn
).
covind
: gives the indexing of the response by individual (that
is, the nesting indicator for observations within individuals). It can
be used to expand time-constant covariates to the size of the repeated
measurements response.
delta
: extracts the units of measurement vector and Jacobian of
any transformation of the response, possibly for selected individuals.
Note that, if the unit of measurement/Jacobian is available in the
response
object, this is automatically included in the
calculation of the likelihood function in all library model functions.
units
: prints the variable names and their description
and returns the latter.
formula
: gives the formula used to create the time-constant
covariate matrix of a data object (for formulae and functions, see
formula.formulafn
).
names
: extracts the names of the response and/or covariates.
nesting
: gives the coding variable(s) for individuals (same as
covind
) and also for nesting within individuals if available,
possibly for selected individuals.
nobs
: gives the number of observations per individual.
plot
: plots the variables in the data object in various ways.
For repeated
objects, name
can be a response or a
time-varying covariate.
print
: prints summary information about the variables in a data object.
response
: extracts the response vector, possibly for selected
individuals. If there are censored observations, this is a two-column
matrix, with the censor indicator in the second column. For binomial
data, it is a two-column matrix with "positive" (y) and "negative"
(totals-y) frequencies.
resptype
: extracts the type of each response.
times
: extracts the times vector, possibly for selected
individuals.
transform
: transforms variables. For example,
transform(z, y=fcn1(y), times=fcn2(times))
where fcn1
and fcn2
are transformation functions. When the response is
transformed, the Jacobian is automatically calculated. New response
variables and covariates can be created in this way, if the left hand
side is a new name (ynew=fcn3(y)
), as well as replacing an old
variable with the transformed one. If the transformation reverses the
order of the responses, use its negative to keep the ordering and have
a positive Jacobian; for example, ry=-1/y
. For repeated
objects, only the response and the times can be transformed.
units
: prints the variable names and their units of measurement
and returns the latter.
weights
: extracts the weight vector, possibly for selected
individuals.