addrm.terms.asrtests {asreml3Plus}R Documentation

Adds or removes the specified set terms from either the fixed or random model and records the change in a data.frame.

Description

The specified terms are simply added or removed from either the fixed or random model. No hypothesis testing is performed and no check is made for boundary or singular terms. A row is added to the test.summary data.frame stating whether fixed or random terms have been added or removed. Convergence in fitting the model is checked and a note included in the action if there was not. All components of the asrtests object are updated, although wald.tab is only updated if it is present in the supplied asrtests object.

Usage

addrm.terms.asrtests(terms = NULL, asrtests.obj, add = FALSE, 
                     random = FALSE, label = NULL, allow.unconverged = TRUE, 
                     denDF = "default", trace = FALSE, 
                     update = TRUE, set.terms = NULL, ignore.suffices = TRUE, 
                     constraints = "P", initial.values = NA, ...)

Arguments

terms

A single character string in the form of a formula which, after expansion, specifies the sum of a set of terms to be added or dropped.

asrtests.obj

An asrtests object for a fitted model that is a list containing an asreml object, a wald.tab data.frame with 4 columns, and a data.frame with 5 columns that records any previous changes and tests in the fitted model.

add

Whether to add or remove terms from the model.

random

Whether terms are to added or removed from the fixed or random model.

label

A character string to use as the label in test.summary and which indicates what is being tested. If label is NULL, either Fixed terms or Random terms is used, depending on whether random is TRUE or FALSE.

allow.unconverged

A logical indicating whether to accept a new model even when it does not converge. If FALSE and the fit does not converge, the supplied asreml object is returned.

denDF

Specifies the enthod to use in computing approximate denominator degrees of freedom when wald.asreml is called. Can be none to suppress the computations, numeric for numerical methods, algebraic for algebraic methods or default, the default, to autommatically choose numeric or algebraic computations depending on problem size. The denominator degrees of freedom are calculated according to Kenward and Roger (1997) for fixed terms in the dense part of the model.

trace

If TRUE then partial iteration details are displayed when ASReml-R functions are invoked; if FALSE then no output is displayed.

update

If TRUE then update.asreml is called in removing and adding terms to the model. In doing this the arguments R.param and G.param are set to those in the asreml object stored in the supplied asrtests.obj so that the values from the previous model are used as starting values. If FALSE then calls are made to asreml in which the only changes from the previous call are (i) that the random model is updated and (ii) modifications specified via ... are made.

set.terms

A character vector specifying the terms that are to have constraints and/or initial values set prior to fitting.

ignore.suffices

A logical vector specifying whether the suffices of the asreml-assigned names of the variance terms (i.e. the information to the right of an "!", other than "R!") is to be ignored in matching elements of terms. If TRUE for an element of terms, the suffices are stripped from the asreml-assigned names. If FALSE for an element of terms, the element must exactly match an asreml-assigned name for a variance term. This vector must be of length one or the same length as terms. If it is of length one then the same action is applied to the asreml-assigned suffices for all the terms in terms.

constraints

A character vector specifying the constraints to be applied to the terms specified in terms. This vector must be of length one or the same length as terms. If it is of length one then the same constraint is applied to all the terms in terms. If any of the constraints are equal to NA then they are left unchanged for those terms.

initial.values

A character vector specifying the initial values for the terms specified in terms. This vector must be of length one or the same length as terms. If it is of length one then the same initial value is applied to all the terms in terms. If any of the initial.values are equal to NA then they are left unchanged for those terms.

...

Further arguments passed to asreml and to wald.asreml.

Value

An asrtests object, which is a list containing:

  1. asreml.obj: an asreml object containing the fit of the model after all boundary and singular terms have been removed;

  2. wald.tab: a 4-column data.frame containing a pseudo-anova table for the fixed terms produced by wald.asreml;

  3. test.summary: a data.frame with columns term, DF, denDF, p and action. A row is added to it for each term that is dropped, added or tested or a note that several terms have been added or removed. A row contains the name of the term, the DF, the p-value and the action taken. Possible codes are: Dropped, Retained, Swapped, Unswapped, Significant, Nonsignificant, Absent, Added, Removed and Boundary. If the changed model did not converge, Unconverged will be added to the code. Note that the logical asreml.obj$converge also reflects whether there is convergence.

See Also

asrtests, rmboundary.asrtests, testranfix.asrtests, testrcov.asrtests,
newfit.asreml, sig.devn.reparam.asrtests, choose.model.asrtests

Examples

## Not run: 
  terms <- "(Date/(Sources * (Type + Species)))"
  current.asrt <- addrm.terms.asrtests(terms, current.asrt, add = TRUE)

  current.asrt <- addrm.terms.asrtests("A + B", current.asrt, denDF = "algebraic")

## End(Not run)

[Package asreml3Plus version 2.0-14 Index]