Learn R Programming

asremlPlus (version 2.0-9)

testranfix.asrtests: Tests for a single fixed or random term in model fitted using asreml

Description

Tests for a single term, using a REML LRT for a random term or based on Wald statistics for a fixed term. The term must be in the fitted model. A random term is removed from the model fit and a REML likelihood ratio test is performed using reml.lrt.asreml. It compares the fit of the model in asreml.obj and the newly fitted model without the term. If the newly fitted model is retained, any boundary terms are then removed using rmboundary.asrtests. For a fixed term, the probability of the Wald statistics is extracted from the pseudo-anova table produced by wald.asreml. If this is available in the asrtests object, it is used; otherwise wald.asreml is called to add it to the asrtests object. Whether nonsignificant terms are dropped is controlled by drop.ran.ns for random terms and drop.fix.ns for fixed terms. A row is added to the test.summary data.frame for the term that is tested.

Usage

testranfix.asrtests(term=NULL, asrtests.obj, alpha = 0.05, drop.ran.ns = TRUE, positive.zero = FALSE, drop.fix.ns = FALSE, denDF="default", dDF.na = "none", dDF.values = NULL, trace = FALSE, update = TRUE, set.terms = NULL, ignore.suffices = TRUE, constraints = "P", initial.values = NA, ...)

Arguments

term
a single model term that is valid 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.
alpha
the significance level for the test.
drop.ran.ns
a logical indicating whether to drop a random term from the model when it is nonsignificant .
positive.zero
a logical indicating whether the hypothesized values for the varaince components being tested are on the boundary of the parameter space. For example, this is be true for positively-constrained variance components that, under the reduced model, are zero.
drop.fix.ns
a logical indicating whether to drop a fixed term from the model when it is nonsignificant
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.
dDF.na
the method to use to obtain substitute denominator degrees of freedom. when the numeric or algebraic methods produce an NA. If dDF.na = "none", no subtitute denominator degrees of freedom are employed; if dDF.na = "residual", the residual degrees of freedom from asreml.obj$nedf are used; if dDF.na = "maximum", the maximum of those denDF that are available, excluding that for the Intercept, is used; if all denDF are NA, asreml.obj$nedf is used. If dDF.na = "supplied", a vector of values for the denominator degrees of freedom is to be supplied in dDF.values. Any other setting is ignored and a warning message produced. Generally, substituting these degrees of freedom is anticonservative in that it is likely that the degrees of freedom used will be too large.
dDF.values
A vector of values to be used when dDF.na = "supplied". Its values will be used when denDF in a test for a fixed effect is NA. This vector must be the same length as the number of fixed terms, including (Intercept) whose value could be NA.
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 to fit the model to be tested. 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) models are modifed for the supplied terms 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

asrtests object, which is a list containing:
  1. asreml.obj: an asreml object containing the fit after the term has been tested; it will be a new model if the term is nonsignificant and the appropriate argument out of drop.ran.ns and drop.fix.ns is TRUE;
  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 tested, the row containing the name of the term, the degrees of freedom (numerator DF for a Wald test and the number of extra paramters for a REML ratio tests), the p-value and a for the action taken. Possible codes are: Dropped, Retained, 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, DF set to NA, p-value set to NA, and action set to Absent.

See Also

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