changeModelOnIC.asrtests | R Documentation |
Uses information criteria to decide whether to change the fitted model
stored in the supplied asrtests.object
according to the specified
modifications. The function changeTerms
is
used to change the model. Thus, the model can be modified using a
combination of adding and removing sets of terms from one or both of the fixed
or random models, replacing the residual model and changing the bounds and/or initial
values of some terms. The model will be unchanged
if terms specified in dropFixed
or dropRandom
are not in the fitted
model.
A row is added to the test.summary
data.frame
of the
asrtests.object
using the supplied label
and stating
whether or not the new model has been swapped for the supplied model.
Convergence in fitting the model is checked and a note included in the
action
if there was not. All components of the
asrtests.object
are updated to exhibit the differences
between the supplied and new models.
To obtain a list of the information criteria for a set of models use
changeTerms.asrtests
with IClikelihood
set to
REML
or full
, or use infoCriteria.asreml
.
## S3 method for class 'asrtests'
changeModelOnIC(asrtests.obj,
dropFixed = NULL, addFixed = NULL,
dropRandom = NULL, addRandom = NULL,
newResidual = NULL, label = "Changed terms",
allow.unconverged = TRUE, allow.fixedcorrelation = TRUE,
checkboundaryonly = FALSE,
trace = FALSE, update = TRUE, denDF = "numeric",
set.terms = NULL, ignore.suffices = TRUE,
bounds = "P", initial.values = NA,
which.IC = "AIC", IClikelihood = "REML",
fixedDF = NULL, varDF = NULL,
bound.exclusions = c("F","B","S","C"),
...)
asrtests.obj |
An |
dropFixed |
A single |
addFixed |
A single |
dropRandom |
A single |
addRandom |
A single |
newResidual |
A single |
label |
A |
allow.unconverged |
A |
allow.fixedcorrelation |
A |
checkboundaryonly |
If |
trace |
If TRUE then partial iteration details are displayed when ASReml-R functions are invoked; if FALSE then no output is displayed. |
update |
If |
denDF |
Specifies the method to use in computing approximate denominator
degrees of freedom when |
set.terms |
A |
ignore.suffices |
A logical vector specifying whether the suffices of the
|
bounds |
A |
which.IC |
A |
IClikelihood |
A |
fixedDF |
A |
varDF |
A |
initial.values |
A character vector specifying the initial values for
the terms specified in |
bound.exclusions |
A |
... |
Further arguments passed to |
An asrtests.object
containing the components (i) asreml.obj
,
(ii) wald.tab
, and (iii) test.summary
. The values of the degrees of
freedom and the information criteria are differences between those of the changed
model and those of the model supplied to changeModelOnIC
.
Chris Brien
as.asrtests
, rmboundary.asrtests
,
testranfix.asrtests
, testresidual.asrtests
,
newfit.asreml
, reparamSigDevn.asrtests
,
chooseModel.asrtests
, changeTerms.asrtests
,
infoCriteria.asreml
## Not run:
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,
label = "Maximal model")
current.asrt <- rmboundary(current.asrt)
# Drop both Row and Column terms
current.asrt <- changeModelOnIC(current.asrt,
dropRandom = "Row + Column",
checkboundaryonly = TRUE,
which.IC = "AIC", IClikelihood = "full")
current.asrt <- iterate(current.asrt)
# Add and drop both fixed and random terms
current.asrt <- changeModelOnIC(current.asrt,
addFixed = "vRow", dropFixed = "WithinColPairs",
addRandom = "spl(vRow)", dropRandom = "units",
checkboundaryonly = TRUE,
which.IC = "AIC", IClikelihood = "full")
# Replace residual with model without Row autocorrelation
current.asrt <- changeModelOnIC(current.asrt,
newResidual = "Row:ar1(Column)",
label="Row autocorrelation",
IClikelihood = "full")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.