predictPlus.asreml | R Documentation |
This function forms the predictions for term
using
classify
and the supplied asreml
object and stores
them in an alldiffs.object
. If x.num
is
supplied, the predictions will be obtained for the values supplied
in x.pred.values
and, if supplied, x.plot.values
will
replace them in the alldiffs.object
that is returned.
If x.fac
, but not x.num
, is specified, predictions
will involve it and, if supplied, x.plot.values
will replace
the levels of x.fac
in the alldiffs.object
that is returned. In order to get the correct predictions you may
need to supply additional arguments to predict.asreml
through ...
e.g. present
, parallel
, levels
.
Any aliased predictions will be removed, as
will any standard error of pairwise differences involving them.
Also calculated are the approximate degrees of freedom of the
standard errors of the predictions. If the denominator degrees of
freedom for term
are available in wald.tab
, they are
used. Otherwise the residual degrees of freedom or the maximum of
the denominator degrees in wald.tab
, excluding the
Intercept, are used. Which is used depends on the setting of
dDF.na
. These degrees of freedom are used for the
t-distribution on which p-values and confidence intervals are
based. It is stored as an attribute to the alldiffs.object
.
The degrees of freedom are also used in calculating the minimum,
mean and maximum LSD for comparing pairs of predictions, which are
also stored in the alldiffs.object
.
If pairwise = TRUE
, all pairwise differences between the
predictions
, their standard errors, p-values and LSD
statistics are computed using allDifferences.data.frame
.
This adds them to the alldiffs.object
as additional
list
components named differences
, sed
,
p.differences
and LSD
.
If a linear transformation of the predictions is specified then the values of this linear transformation are returned, instead of the original predictions, along with their standard errors and the pairwise differences and associated statistics.
If a transformation has been applied in the analysis (any one of
transform.power
is not one, scale
is not one and
offset
is nonzero), the backtransforms of the transformed
values and their lower and upper error intervals are added
to a data.frame
that is consistent with the predictions
data.frame
.
If transform.power
is other than
one, the standard.error
column of the data.frame
is set to NA
. This data.frame
is added to the
alldiffs.object
as a list
component called
backtransforms
.
The printing of the components produced is controlled by the
tables
argument. The order of plotting the levels of
one of the factors indexing the predictions can be modified
and is achieved using sort.alldiffs
.
## S3 method for class 'asreml'
predictPlus(asreml.obj, classify, term = NULL,
inestimable.rm = TRUE,
linear.transformation = NULL, EGLS.linTransform = TRUE,
error.intervals = "Confidence", alpha = 0.05,
wald.tab = NULL, dDF.na = "residual", dDF.values = NULL,
pairwise = TRUE, Vmatrix = FALSE,
avsed.tolerance = 0.25, accuracy.threshold = NA,
LSDtype = "overall", LSDsupplied = NULL, LSDby = NULL,
LSDstatistic = "mean", LSDaccuracy = "maxAbsDeviation",
x.num = NULL, x.fac = NULL,
x.pred.values = NULL, x.plot.values = NULL,
titles = NULL, tables = "all" , level.length = NA,
transform.power = 1, offset = 0, scale = 1,
transform.function = "identity",
sortFactor = NULL, sortParallelToCombo = NULL,
sortNestingFactor = NULL, sortOrder = NULL,
decreasing = FALSE, trace = FALSE, ...)
asreml.obj |
|
classify |
A |
term |
A |
inestimable.rm |
A |
linear.transformation |
A If a In either case, as well as the values of the linear combinations, their standard errors, pairwise differences and associated statistics are returned. |
EGLS.linTransform |
A |
error.intervals |
A |
alpha |
A |
wald.tab |
A |
dDF.na |
A |
dDF.values |
A |
pairwise |
A |
Vmatrix |
A |
avsed.tolerance |
A
|
accuracy.threshold |
A |
LSDtype |
A See |
LSDsupplied |
A |
LSDby |
A |
LSDstatistic |
A |
LSDaccuracy |
A |
titles |
A |
tables |
A |
x.num |
A |
x.fac |
A |
x.pred.values |
The values of |
x.plot.values |
The actual values to be plotted on the x axis. They are
needed when values different to those in |
level.length |
The maximum number of characters from the levels of factors to use in the row and column labels of the tables of pairwise differences and their p-values and standard errors. |
transform.power |
A |
offset |
A |
scale |
A |
transform.function |
A |
sortFactor |
A |
sortParallelToCombo |
A |
sortNestingFactor |
A |
sortOrder |
A The following creates a |
decreasing |
A |
trace |
A |
... |
further arguments passed to |
For linear.transformations
set to NULL
, an S3-class
alldiffs.object
with predictions and their standard
errors and, depending on the settings of the arguments, all pairwise
differences between predictions, their standard errors and p-values
and LSD statistics. Also, unless the sortFactor
or sortOrder
arguments are invoked, the rows of predictions
component are ordered
so that they are in standard order for the variables in the classify
.
That is, the values of the last variable change with every row, those of the
second-last variable only change after all the values of the last variable have
been traversed; in general, the values of a variable are the same for all the
combinations of the values to the variables to its right in the classify
.
In addition, if necessary, the order of the columns of the variables in the
predictions
component are changed to match their order in the classify
.
If transform.power
or scale
is not one or offset
is not zero, it will contain a data.frame
with the backtransformed
linear transformation of the predictions. The backtransformation will, after
backtransforming for any power transformation, subtract the offset
and then divide by the scale
.
If error.intervals
is not "none"
, then the
predictions
component and, if present, the
backtransforms
component will contain columns for the lower
and upper values of the limits for the interval.
The name of the response
, the response.title
,
the term
, the classify
, tdf
, sortFactor
and the sortOrder
will be set as attributes to the object.
Also, if error.intervals
is "halfLeastSignificant"
, then those of
LSDtype
, LSDby
and LSDstatistic
that are not NULL
will be added as attributes of the object and of the predictions frame
;
additionally, LSDvalues
will be added as attribute of the
predictions frame
, LSDvalues
being the LSD values used in
calculating the error.intervals
.
Note that the classify
in an alldiffs.object
is based on the
variables indexing the predictions, which may differ from the
classify
used to obtain the original predictions (for example,
when the alldiffs.object
s stores a linear transformation of predictions.
For linear.transformations
set to other than NULL
,
an alldiffs.object
with the linear.transformation
applied to the predictions
and their standard errors and,
depending on the settings of the arguments, all pairwise
differences between the linearly transformed predictions, their
standard errors and p-values and LSD statistics.
(See also linTransform.alldiffs
.)
Chris Brien
alldiffs.object
, as.alldiffs
, print.alldiffs
,
linTransform.alldiffs
, sort.alldiffs
,
subset.alldiffs
, allDifferences.data.frame
,
redoErrorIntervals.alldiffs
,
recalcLSD.alldiffs
, exploreLSDs.alldiffs
,
pickLSDstatistics.alldiffs
,
predictPresent.asreml
,
plotPredictions.data.frame
, as.Date
, predict.asreml
## Not run:
data(WaterRunoff.dat)
asreml.options(keep.order = TRUE) #required for asreml-R4 only
current.asr <- asreml(fixed = pH ~ Benches + (Sources * (Type + Species)),
random = ~ Benches:MainPlots,
keep.order=TRUE, data= WaterRunoff.dat)
current.asrt <- as.asrtests(current.asr, NULL, NULL)
diffs <- predictPlus(classify = "Sources:Type",
asreml.obj = current.asr,
wald.tab = current.asrt$wald.tab,
present = c("Sources", "Type", "Species"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.