Learn R Programming

asremlPlus (version 2.0-2)

newrcov.asrtests: Fits a new rcov formula using asreml.

Description

Fits a new rcov formula using asreml. Any boundary terms resulting after fitting the new rcov model are removed using rmboundary.asrtests. A row is added to the test.summary data.frame using the supplied label and the action Set.

Usage

newrcov.asrtests(terms=NULL, asrtests.obj, label = "R model", 
                 update = TRUE, trace = FALSE, denDF="default", 
                 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
label
a character string to use as the label in test.summary and which indicates what is being tested.
update
if TRUEthen 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 s
trace
if TRUE then partial iteration details are displayed when ASReml-R functions are invoked; if FALSE then no output is displayed.
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,
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 igno
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 i
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 leng
...
further arguments passed to asreml and to wald.asreml.

Value

  • An asrtests object, which is a list containing:
    1. asreml.obj: anasremlobject containing the fit after thetermhas been omitted from the model;
    2. wald.tab: a 4-columndata.framecontaining a pseudo-anova table for the fixed terms produced bywald.asreml;
    3. test.summary: adata.framewith columnsterm,DF,denDF,pandaction. 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,RemovedandBoundary. If the changed model did not converge,Unconvergedwill be added to the code. Note that the logicalasreml.obj$convergealso 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

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

Examples

Run this code
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)
# Fit Row autocorrelation
current.asrt <- newrcov.asrtests("~ Row:ar1(Column)", current.asrt, 
                                 label="Row autocorrelation")
print(current.asrt)

Run the code above in your browser using DataLab