These functions are mostly used inside other functions. (Functions
coef.mvr
, fitted.mvr
and residuals.mvr
are
usually called through their generic functions coef
,
fitted
and residuals
, respectively.)
coef.mvr
is used to extract the regression coefficients of a
model, i.e. the $B$ in $y = XB$ (for the $Q$ in $y = TQ$
where $T$ is the scores, see Yloadings
). An array of
dimension c(nxvar, nyvar, length(ncomp))
or c(nxvar, nyvar,
length(comps))
is returned. If comps
is missing (or is NULL
),
coef()[,,ncomp[i]]
are the coefficients for models with
ncomp[i]
components, for $i = 1, \ldots, length(ncomp)$.
Also, if intercept = TRUE
, the first dimension is $nxvar +
1$, with the intercept coefficients as the first row.
If comps
is given, however, coef()[,,comps[i]]
are
the coefficients for a model with only the component comps[i]
,
i.e. the contribution of the component comps[i]
on the
regression coefficients.
fitted.mvr
and residuals.mvr
return the fitted values
and residuals, respectively. If the model was fitted with
na.action = na.exclude
(or after setting the default
na.action
to "na.exclude"
with options
),
the fitted values (or residuals) corresponding to excluded
observations are returned as NA
; otherwise, they are omitted.
model.frame.mvr
returns the model frame; i.e. a data frame with
all variables neccessary to generate the model matrix. See
model.frame
for details.
model.matrix.mvr
returns the (possibly coded) matrix used as
$X$ in the fitting. See model.matrix
for
details.
prednames
, respnames
and compnames
extract the
names of the $X$ variables, responses and components,
respectively. With intercept = TRUE
in prednames
,
the name of the intercept variable (i.e. "(Intercept)"
) is
returned as well. compnames
can also extract component names
from score and loading matrices. If explvar = TRUE
in compnames
, the
explained variance for each component (if available) is appended to the component
names. For optimal formatting of the explained variances when not all
components are to be used, one should specify the desired components
with the argument comps
.
explvar
extracts the amount of $X$ variance (in per cent)
explained by for each component in the model. It can also handle
score and loading matrices returned by scores
and loadings
.