| predict.asreml {asreml} | R Documentation |
Predict linear functions of model effects
Description
An instance of the generic method predict for objects of
class asreml. It forms a linear function of the vector of fixed
and random effects in the linear model to obtain an estimated or
predicted value.
Usage
## S3 method for class 'asreml'
predict(
object = NULL,
classify = character(0),
levels = list(),
present = character(0),
ignore = character(0),
use = character(0),
except = character(0),
only = character(0),
associate = formula("~NULL"),
average = list(),
vcov = FALSE,
sed = FALSE,
parallel = FALSE,
aliased = FALSE,
design.points = list(),
evaluate = TRUE,
simple = FALSE,
...
)
Arguments
object |
An |
classify |
A character string giving the variables that define the margins of the multiway table to be predicted. Multiway tables are specified by forming an interaction type term from the classifying variables, that is, separating the variable names with the ":" operator. |
levels |
A list, named by the margins of the classifying table, of vectors specifying the levels at which predictions are required. If omitted, factors are predicted at each level, simple covariates are predicted at their overall mean and covariates used as a basis for splines or orthogonal polynomials are predicted at their design points. Additional prediction points for spline terms should be
included in the design matrix with the |
present |
A character vector specifying which variables to include in the
If a list, there can be a maximum of two components, each a
character vector of variable names, representing non-overlapping
|
ignore |
A character vector specifying which variables to ignore in forming the predictions. |
use |
A character vector specifying which variables to add to the prediction model after the default rules have been invoked. |
except |
A character vector specifying which variables to exclude in the
prediction process. That is, the prediction model includes all
fitted model terms not in the |
only |
A character vector specifying which variables (only) form the prediction model, that is, the default rules are not invoked. |
associate |
A one-sided formula specifying terms in up to two independent
nested hierarchies. The factors in each hierarchy are written as a
compound term separated by the |
average |
A list, named by the margins of the classifying table, specifying which variables to include in the averaging set. Optionally, each component of the list is a vector specifying the weights to use in the averaging process. If omitted, equal weights are used. |
vcov |
If |
sed |
If |
parallel |
If |
aliased |
If |
design.points |
A list with named components where each component is a list or
matrix (for two dimensions), or vector (single dimension) of user-supplied
prediction design points for: If an element of this list is a
list of length two, then the first vector component is taken as the
x coordinates and the second as the y
coordinates. If a component is a matrix, then it is assumed that
the (x, y) coordinates occupy columns 1 and 2,
respectively. The names of |
evaluate |
If |
simple |
If |
... |
Additional arguments to |
Details
The prediction process forms a linear function of the vector of fixed and random effects in the linear model to obtain a predicted value for a quantity of interest. It is primarily used for predicting tables of adjusted means. If the table is based on a subset of the explanatory variables then the other variables need to be accounted for. It is usual to form a predicted value either at specified values of the remaining variables, or averaging over them in some way.
Prediction equations are formed just prior to the final iteration
in asreml. The predict.asreml method passes the list
of user specifications for the prediction design matrix to the
REML routines through the predict argument of
asreml. Predicted values and standard errors are returned in
the predictions component of the asreml object. In
forming the predictions, predict.asreml calls
update.asreml to re-run the model from its previous
solution.
Value
The full asreml object is not returned, only the
predictions element containing the following components:
pvals: A data frame of predicted values with classasreml.predict.sed: Optional matrix of classdspMatrixof standard errors of difference (SED).vcov: Optional variance-covariance matrix of classdspMatrixof the predicted values.avsed: Average of the standard error of differences (SED).