testrcov.asrtests {asreml3Plus}R Documentation

Fits a new rcov formula using asreml and tests whether the change is significant.

Description

Fits a new rcov formula using asreml and tests whether the change is significant. If simpler = FALSE the model to be fitted must be more complex than the one whose fit has been stored in asrtests.obj. That is, the new model must have more parameters. However, if simpler = TRUE the model to be fitted must be simpler than the one whose fit has been stored in asrtests.obj in that it must have fewer parameters. Any boundary terms are removed using rmboundary.asrtests, which may mean that the models are not nested. The test is a REML likelihood ratio test that is performed using reml.lrt.asreml, which is only valid if the models are nested. It compares the newly fitted model with the fit of the model in asrtest.obj. A row is added to the test.summary data.frame using the supplied label.

Usage

testrcov.asrtests(terms=NULL, asrtests.obj, label = "R model", 
                  simpler = FALSE, alpha = 0.05, allow.unconverged = TRUE, 
                  positive.zero = FALSE, bound.test.parameters = "none", 
                  denDF="default", update = TRUE, trace = FALSE,
                  set.terms = NULL, ignore.suffices = TRUE, 
                  constraints = "P", initial.values = NA, ...)

Arguments

terms

a model for the rcov argument in asreml, stored as a character.

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.

label

a character string to use as the label in test.summary and which indicates what is being tested.

simpler

a logical indicating whether the new model to be fitted is simpler than the already fitted model whose fit is stored in asrtests.obj.

alpha

the significance level for the test.

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 asreml object in asrtests.obj will be unchanged.

positive.zero

Indicates whether the hypothesized values for the variance components being tested are on the boundary of the parameter space. For example, this is true for positively-constrained variance components that, under the reduced model, are zero. This argument does not need to be set if bound.test.parameters is set.

bound.test.parameters

Indicates whether for the variance components being tested, at least some of the hypothesized values are on the boundary of the parameter space. The default is "none". Other possibilities are "onlybound" and "one-and-one". The latter signifies that there are two parameters being tested, one of which is bound and the other is not. For example, the latter is true for testing a covariance and a positively-constrained variance component that, under the reduced model, are zero.

denDF

Specifies the method 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.

update

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

trace

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

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 after the term has been omitted from the model;

  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.

If the term is not in the model, then the supplied asreml object will be returned. Also, reml.test will have the likelihood ratio and the p-value set to NA and the degrees of freedom to zero. Similarly, the row of test.summary for the term will have its name, a p-value set to NA, and action set to Absent.

See Also

asreml3Plus-package, asrtests, newrcov.asrtests,

choose.model.asrtests, reml.lrt.asreml, rmboundary.asrtests,
newfit.asreml, testswapran.asrtests, addrm.terms.asrtests,
sig.devn.reparam.asrtests

Examples

## Not run: 
data(Wheat.dat)
current.asr <- asreml(yield ~ Rep + WithinColPairs + Variety, 
                      random = ~ Row + Column + units,
                      rcov = ~ ar1(Row):ar1(Column), 
                      data=Wheat.dat)
current.asrt <- asrtests(current.asr, NULL, NULL)
current.asrt <- rmboundary.asrtests(current.asrt)
# Test Row autocorrelation
current.asrt <- testrcov.asrtests("~ Row:ar1(Column)", current.asrt, 
                                  label="Row autocorrelation", simpler=TRUE)
print(current.asrt)

## End(Not run)

[Package asreml3Plus version 2.0-14 Index]