asrtests.object
.Fits a new residual formula
using asreml-R4
(replaces the rcov
formula
of asreml-R3) 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
REMLRT.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
. If the two models have the same number of variance
parameters, then no change is made to the residual. A row is added to the
test.summary
data.frame
using the supplied label
.
# S3 method for asrtests
testresidual(asrtests.obj, terms=NULL, label = "R model",
simpler = FALSE, alpha = 0.05,
allow.unconverged = TRUE, allow.fixedcorrelation = TRUE,
checkboundaryonly = FALSE, positive.zero = FALSE,
bound.test.parameters = "none",
bound.exclusions = c("F","B","S","C"), REMLDF = NULL,
denDF="numeric", IClikelihood = "none",
update = TRUE, trace = FALSE,
set.terms = NULL, ignore.suffices = TRUE,
bounds = "P", initial.values = NA, ...)
An asrtests.object
containing the components (i) asreml.obj
,
(ii) wald.tab
, and (iii) test.summary
.
If the term
is not in the model, then the supplied asreml.obj
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.
an asrtests.object
for a fitted model that is a list
containing the componets (i) asreml.obj
, (ii) wald.tab
(iii) test.summary
.
A model for the residual
argument in asreml-R4
(the rcov
formula in older versions of asreml
), stored
as a character
. To remove the model, enter "-(.)"
.
A character string to use as the label in test.summary
and
which indicates what is being tested.
A logical indicating whether the new model to be fitted is
simpler than the already fitted model whose fit is stored in
asrtests.obj
.
The significance level for the test.
A logical
indicating whether to accept a new model
even when it does not converge. If FALSE
and the fit of the new
model does not converge, the supplied asreml
object is returned.
Also, if FALSE
and the fit of the new model has converged, but that
of the old model has not, the new model will be accepted.
A logical
indicating whether to accept a new model
even when it contains correlations in the model whose values have been
designated as fixed, bound or singular. If FALSE
and the new model
contains correlations whose values have not been able to be estimated,
the supplied asrtests.obj
is returned. The fit in the
asreml.obj
component of the supplied asrtests.obj
will
also be tested and a warning issued if both fixed correlations are found
in it and allow.fixedcorrelation
is FALSE
.
If TRUE
then boundary and singular terms are not removed by
rmboundary.asrtests
; a warning is issued instead.
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.
Indicates whether for the variance components
being tested, at least some of the hypothesized values
are on the boundary of the parameter space.
The possibilities are "none"
, "onlybound"
and "one-and-one"
. The default is "none"
,
although if it is set to "none"
and
positive.zero
is TRUE
then
bound.test.parameters
is taken to be "onlybound"
.
When bound.test.parameters
is set to
"one-and-one"
, it 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.
A character
specifying one or more bound (constraint) codes that
will result in a variance parameter being excluded from the count of
estimated variance parameters in using REMLRT.asreml
.
If set to NULL
then none will be excluded.
A numeric
giving the difference in the number of variance parameters
whose estimates are not of the type specified in bound.exclusions
for two models being compared in a REML ratio test using
REMLRT.asreml
. If NULL
then this is determined from
the information in the asreml
object for the two models.
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.
A character
that controls both the occurence and the type
of likelihood for information criterion in the test.summary
of the new asrtests.object
. If none
, none are
included. Otherwise, if REML
, then the AIC and BIC based
on the Restricted Maximum Likelihood are included; if full
,
then the AIC and BIC based on the full likelihood, evaluated
using REML estimates, are included.
(See also infoCriteria.asreml
.)
If TRUE
, and set.terms
is NULL
, then
newfit.asreml
is called to fit the model to be tested,
using the values of the variance parameters stored in
the asreml.object
, that is stored in asrtests.obj
, as starting values.
If FALSE
or set.terms
is not NULL
, then
newfit.asreml
will not use the stored variance parameter
values as starting values when fitting the new model, the only
modifications being (i) the residual
(rcov
) model is
that specified in terms
(ii) those specified via ...
.
If TRUE
then partial iteration details are displayed when ASReml-R
functions are invoked; if FALSE then no output is displayed.
A character
vector specifying the terms that are to have
bounds and/or initial values set prior to fitting.
The names must match those in the vparameters
component of the
asreml.obj
component in the new asrtests.object
.
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
.
A character
vector specifying the bounds to be applied
to the terms specified in set.terms
. This vector
must be of length one or the same length as set.terms
.
If it is of length one then the same constraint is
applied to all the terms in set.terms
.
If any of the bounds are equal to NA then they are
left unchanged for those terms.
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
, wald.asreml
and
as.asrtests
.
Chris Brien
Kenward, M. G., & Roger, J. H. (1997). Small sample inference for fixed effects from restricted maximum likelihood. Biometrics, 53, 983-997.
asremlPlus-package
, as.asrtests
, changeTerms.asrtests
,
chooseModel.asrtests
,
REMLRT.asreml
, rmboundary.asrtests
,
newfit.asreml
, testswapran.asrtests
,
changeModelOnIC.asrtests
,
changeTerms.asrtests
, reparamSigDevn.asrtests
if (FALSE) {
data(Wheat.dat)
current.asr <- asreml(yield ~ Rep + WithinColPairs + Variety,
random = ~ Row + Column + units,
residual = ~ ar1(Row):ar1(Column),
data=Wheat.dat)
current.asrt <- as.asrtests(current.asr, NULL, NULL)
current.asrt <- rmboundary(current.asrt)
# Test Row autocorrelation
current.asrt <- testresidual(current.asrt, "~ Row:ar1(Column)",
label="Row autocorrelation", simpler=TRUE)
print(current.asrt)
}
Run the code above in your browser using DataLab