asreml estimates variance components under a general linear mixed model by residual maximum likelihood (REML).
fixed A formula object specifying the fixed terms in the model, with the response on the left of a ∼ operator, and the terms, separated by + operators, on the right. If data is given, all names used in all formulae should appear in the data frame. A model with the intercept as the only fixed effect can be specified as ∼1; there must be at least one fixed effect specified. If the response (y) evaluates to a matrix then a factor trait with levels dimnames(y)[] is added to the model frame, and must be explicitly included in the model formulae.
random A formula object specifying the random effects in the model. This argument has the same general characteristics as fixed, but there can be no left side to the ∼ operator. Variance structures imposed on random terms are specified using special model functions.
sparse A formula object, specifying the fixed effects for which the full variance-covariance matrix is not required. This argument has the same general characteristics as fixed, but there can be no left side to the ∼ expression. Wald statistics are not available for sparse fixed terms in order to reduce the computing load.
residual A formula object specifying the residual model; any term specified on the left of the ∼ expression is ignored. The default is ∼units, where the reserved word units is defined as seq(1,nrow(data)) and is automatically included in the model frame. Variance models for the residual component of the model can be specified using special model functions.
For single-section univariate models, the residual variance model determines the computational mode: If the residual variance model specifies a correlation structure (includes id()), then the model is fitted on the gamma scale, otherwise the model is fitted on the sigma scale. The default is id(units) if not explicitly specified.
a character string naming a comma delimited file with a header line and three columns for the variance component name, initial value and constraint code, respectively. This file can be created using the start.values argument; the internal list object is then generated from the contents of this file.
On termination, G.param is updated with the final random component estimates.
On termination, R.param is updated with the final residual component estimates.
data A data frame in which to interpret the variables named in fixed, random, sparse and residual. If the data argument is missing, the default is sys.parent(). The data frame is converted internally to a data.table object and returned as such by model.frame.
The default action is to include (and estimate) missing values in the response, and raise an error if there are missing values in the explanatory variables.
subset A logical vector identifying which subset of the rows of data should be used in the fit. All observations are included by default.
weights A character string or name identifying the column of data to use as weights in the fit.
predict A list object specifying the classifying factors and related options when forming predictions from the model. This list would normally be the value returned by a call to the method predict for asreml objects.
vcm A matrix defining relationships among variance parameters. The matrix has a row for each original variance parameter and a column for each new parameter. The default is the identity matrix, that is, no action. See vcm.lm for further information and an example.
vcc Equality constraints between variance parameters; a two-column numeric matrix with a dimnames attribute. The first column defines the grouping structure of equated components, that is, components within an equality group are given the same numeric index, and the second column contains the scaling coefficients.
The dimnames()[] attribute must match the component names in the asreml parameter vector; see start.values.
The parameters are scaled relative to the first parameter in its group, so the scaling of the first parameter in each group is one.
family A list of functions and expressions for defining the link and variance functions. Optionally a list of such structures for a multivariate analysis involving non-normal variates. Currently this is restricted to a bivariate model where the first variate (excluding the multinomial distribution) is non-normal.
The default for asr_gaussian() is dispersion=NA, which implies that asreml will estimate the dispersion parameter, otherwise the scale is fixed at the nominated value.
asmv A character string or name specifying the column in the data that identifies the traits in a multivariate analysis. If not NULL, asmv implies that the data for a multivariate analysis is set up as though it were for a univariate analysis with the response in a single variate.
mbf A named list specifying sets of covariates to be included with one or more mbf() model functions. Each component of the list must in turn contain components named key and cov, where cov is a character string naming the data frame holding the covariates, and key is a character vector of length 2 naming the columns in data and cov, respectively, used to match corresponding records in the two data frames. The default is an empty list.
group A named list where each component is a numeric vector specifying contiguous fields in data that are to be considered as a single term. The component names can then appear in asreml model formulae using the grp() special function. The default is an empty list.
equate.levels A character vector of factor names whose levels are to be equated. If factor A has levels a,b,c,d and factor B has levels a,b,c,e, the effect of equate.levels(A, B) is that both A and B have 5 levels, with as.numeric(A) = 1,2,3,4 and as.numeric(B) = 1,2,3,5. This may be necessary if using the and model function to overlay columns of the model’s design matrix in forming a compound term. The default is a zero length character vector.
start.values If TRUE, asreml exits prior to the fitting process and returns a list of length 3: the G.param and R.param lists, and a data frame containing variance parameter names, initial values and boundary constraints. Initial values or constraints can then be set in the list or data frame objects.
If a character string, then a file of that name is created and the data frame object containing initial parameter values is written out in comma separated form. This file can be edited externally and subsequently specified in the G.param or R.param arguments.
knot.points A named list where each component is a vector of user supplied knot points for a particular spline term; the component name is the object of the spl() model function.
pwr.points A named list with each component containing a vector of distances to be used in a one-dimensional power model. The component names must correspond to the object arguments of the power function model terms.
wald A named list with four components: denDF, ssType, Ftest and kenadj.
denDF a character string from the set ["none", "numeric", "algebraic", "default"] specifying the calculation of approximate denominator degrees of freedom. The default “none” is to suppress the computations.
Algebraic computations are not feasible in large analyses, use “default” to automatically choose numeric or algebraic computations depending on problem size. The denominator degrees of freedom are calculated according to Kenward and Roger, 1997 for terms in the fixed model formula.
ssType can be “incremental” for incremental sum of squares (the default) or “conditional” for F-tests that respect both structural and intrinsic marginality.
∼test_term | background_terms specifying a conditional Wald test of the contribution of test_term conditional on those fixed terms listed in background_terms, and the those in the random and sparse model formulae.
specifying any adjustment to the variance matrix for fixed effects.
The wald argument would typically be set by a call to the wald method, which returns more formal output.
where f is the name of an existing factor and x is a character or numeric vector of levels to select. The name of the list component is the new factor that may appear in the model formulae as the argument to the sbs() model function.
creates a new factor A by selecting the second and third levels of Site, and would be included in the model as sbs(A). While the actions of prune can be duplicated outside asreml, sbs() is necessary if the asreml method predict() is to be used.
creates a new factor A with levels “1” and “2” by merging levels “1” and “3” of Site, and would be included in the model as gpf(A). While the actions of combine can be duplicated outside asreml, gpf() is necessary if the asreml method predict() is to be used.
where f is the name of an existing factor and n is a character or numeric scalar that determines which records are selected. The default, n=0, forms a factor with a level for each record where f is non-zero (strictly, f != 0). Otherwise, a factor with a level for each record in data where f has the value n is formed.
creates a new factor A with levels from row.names(data) where group = 1, and would be included in the model as uni(A). While the actions of uid can be duplicated outside asreml, uni() is necessary if the asreml method predict() is to be used.
links the relationship matrix MM to the original marker scores in snp.mat. The mef list would typically be set from a call to the asreml meff() method.
last A named list restricting the order equations are solved in the sparse partition for the nominated model terms. Each component of the list is named by a model term and contains a scalar n specifying that the first n levels of the term be solved after all others in the sparse set. It is intended for use when there are multiple fixed terms in the sparse equations so that asreml will be consistent in which effects are identified as singular. A maximum of three factor/level pairs can be specified.
model.frame If TRUE (the default) the model frame (a data.table object with additional attributes derived from the model specification) is included in the returned object.
The model frame is required by the asreml summary, plot, resid and fitted methods.
In large analyses, the model frame is likely to be a large object. If model.frame is a character string, the model frame is saved in a file as an RDS object by a call to saveRDS(), and named by the supplied string with the extension .RDS. If the model frame is not included in the returned asreml object, this RDS file is searched for by the methods noted above.
… Additional arguments to asreml from asreml.options(): maxit, workspace, pworkspace, fixgammas, trace, aom.
Models for asreml are specified symbolically in the formula objects fixed, random, sparseand residual. A typical model has the form response ∼ terms, fixed only, or ∼ terms for random, sparse and residual, where response is the (usually numeric) response vector and terms is a linear predictor for response. An exception is raised if the response is a factor and family is not multinomial.
The formulae objects are parsed in the context of the data frame, all internal data structures are constructed in R or compiled code, and the model is fitted by calls to the underlying Fortran REML routines (Gilmour et al., 1995). Variance models for random model terms are specified using special functions in the random and residual formulae. If not specified, the variance models default to (scaled) identity structures. A table of special model functions is included below; see the reference guide or appropriate vignette for further details and examples of their use. Some of these model functions require the formula arguments to be partially evaluated before the final model frame is computed; it is recommended that all names used in the formulae be resolvable in a data frame named by the data argument.
family = asr_multinomial() is declared.
The terms in the fixed formula are re-ordered by default so that main effects precede interactions in increasing order. The option keep.order (see asreml.options) can be used to modify this behaviour.
A formula has an implied intercept term. To remove the intercept use y ∼ -1 + …. This is only effective in the fixed formula; in all other formula arguments any reference to the intercept is ignored. Note that currently there must be at least one fixed effect in the model.
In addition to the formal arguments, various options can be set with asreml.options; these are stored in an environment for the duration of the R session.
asreml uses either a “gamma” (ratio) or “sigma” (component) scale parameterization for estimation depending on the residual model specification. The current default for single section analyses is the gamma parameterization if the error model specifies a correlation structure. In this case, all scale parameters are estimated as a ratio with respect to the residual variance, with correlation parameters unchanged. If the residual model specifies a variance structure then variance parameters are estimated on the sigma scale. For models with more than one residual section, asreml always estimates variance parameters on the sigma scale.
An object of class asreml containing the results of the fitted model. Instances of generic methods such as plot(), predict() and summary() return various derived results of the fit; resid(), coef() and fitted() extract some of its components. See asreml.object for the components of the returned list.
Special model functions are used in asreml formulae objects to create new or modify existing model terms, or more often to specify the variance model associated with one or more terms. These functions can be broadly categorised as constructor-type functions, or (default) identity, time-series, general-structure, 1d metric, 2d metric, known relationship, general variance structures that span more than one term (str), or user-defined structures.
The special model functions that are available in asreml model formulae are introduced below; see the user guide, relevent vignette or the man pages for selected functions for more details or illustration.
obj a factor in data.
p number of parameters estimated by the base function.
v number of parameters estimated by the homogeneous function form.
h number of parameters estimated by the heterogeneous function form.
con(obj) Apply sum-to-zero constraints to factor obj.
C(obj, contr) Define contrasts among the levels of obj from the coefficients in contr.
lin(obj) Fits factor obj as a variate.
pow(obj, p, offset) Create the term (offset+obj)p.
pol(x, t) Orthogonal polynomials to degree t; –t omits the intercept polynomial.
leg(x, t) Legendre polynomials to degree t; –t omits the intercept polynomial.
spl(x, k) The random component of a cubic spline; optionally k knot points.
dev(x) Fit variate x as a factor; typically used for spline deviations.
ma(obj) Forms a moving average (1) design matrix from factor obj.
at(obj, vec) Form conditioning covariables for the levels in obj given in vec.
dsum(~term | obj, ~model) Direct sum of term for the levels of obj with variance structure model. Used in residual to define multiple sections.
and(obj, k) Add k times the design matrix for obj to the previous columns.
grp(name) Include the term defined by name in the group argument in the model.
mbf(name) Include the covariates defined by name in the mbf argument as a factor.
sbs(name) Include the term defined in the prune argument in the model.
gpf(name) Include the term defined in the combine argument in the model.
uni(name) Include the term defined in the uid argument in the model.
∗ See the user guide for an extended discussion of the Matern class.
vm(obj, source, singG) Create a term based on obj with known variance structure in source.
ide(obj) Identity term based on obj with levels as for vm(obj).
to the set of terms in ~terms.
to compute the variance matrix and its derivatives.
Gilmour AR, Thompson R and Cullis BR (1995). “AI, An Efﬁcient Algorithm for REML Estimation in Linear Mixed Models.” Biometrics, 51, pp. 1440-1450.
Kenward MG and Roger JH (1997). “The Precision of Fixed Effects Estimates from Restricted Maximum Likelihood.” Biometrics, 53, pp. 983-997.