testranfix.asrtests {asreml3Plus} | R Documentation |
asreml
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.
testranfix.asrtests(term=NULL, asrtests.obj, alpha = 0.05, allow.unconverged = TRUE, drop.ran.ns = TRUE, positive.zero = FALSE, bound.test.parameters = "none", 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, ...)
term |
A single model term that is valid in |
asrtests.obj |
An |
alpha |
The significance level for the test. |
allow.unconverged |
A |
drop.ran.ns |
A |
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 |
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 |
drop.fix.ns |
a |
denDF |
Specifies the enthod to use in computing approximate denominator
degrees of freedom when |
dDF.na |
the method to use to obtain substitute denominator degrees of freedom.
when the numeric or algebraic methods produce an |
dDF.values |
A |
trace |
if TRUE then partial iteration details are displayed when ASReml-R functions are invoked; if FALSE then no output is displayed. |
update |
if |
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
|
constraints |
a character vector specifying the constraints to be applied
to the terms specified in |
initial.values |
a character vector specifying the initial values for
the terms specified in |
... |
further arguments passed to |
An asrtests
object, which is a list containing:
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
;
wald.tab
: a 4-column data.frame
containing a
pseudo-anova table for the fixed terms produced by wald.asreml
;
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.
asreml3Plus-package
, asrtests
,
choose.model.asrtests
, reml.lrt.asreml
,
rmboundary.asrtests
,
newfit.asreml
, sig.devn.reparam.asrtests
,
addrm.terms.asrtests
## 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 nugget term current.asrt <- testranfix.asrtests("units", current.asrt, positive=TRUE) ## End(Not run)