Description Usage Arguments Value Author(s) See Also Examples
Uses supplied predictions and standard errors of pairwise differences,
or the variance matrix of predictions to form, in an
alldiffs.object
, for those components not already present,
(i) a table of all pairwise differences of the predictions,
(ii) the pvalue of each pairwise difference, and
(iii) the minimum, mean, maximum and accuracy of LSD values.
Predictions that are aliased (or nonestimable) are removed from the
predictions
component of the alldiffs.object
and
standard errors of differences involving them are removed from the sed
component.
If necessary, the order of the columns of the variables in the predictions
component are changed to be the initial columns of the predictions.frame
and to match their order in the classify
. Also, 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 secondlast 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
. The sortFactor
or sortOrder
arguments can be used
to order of the values for the classify
variables, which is achieved using
sort.alldiffs
.
Each pvalue is computed as the probability of a tstatistic as large as or larger
than the absolute value of the observed difference divided by its standard error. The
pvalues are stored in the p.differences
component. The degrees of freedom of
the tdistribution is the degrees of freedom stored in the tdf
attribute of
the alldiffs.object
. This tdistibrution is also used in calculating
the LSD statistics stored in the LSD
component of the alldiffs.object
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  ## S3 method for class 'data.frame'
allDifferences(predictions, classify, vcov = NULL,
differences = NULL, p.differences = NULL, sed = NULL,
LSD = NULL, LSDtype = "overall", LSDsupplied = NULL,
LSDby = NULL, LSDstatistic = "mean",
LSDaccuracy = "maxAbsDeviation",
retain.zeroLSDs = FALSE,
zero.tolerance = .Machine$double.eps ^ 0.5,
backtransforms = NULL,
response = NULL, response.title = NULL,
term = NULL, tdf = NULL,
x.num = NULL, x.fac = NULL,
level.length = NA,
pairwise = TRUE, alpha = 0.05,
transform.power = 1, offset = 0, scale = 1,
inestimable.rm = TRUE,
sortFactor = NULL, sortParallelToCombo = NULL,
sortNestingFactor = NULL, sortOrder = NULL,
decreasing = FALSE, ...)

predictions 
A 
classify 
A 
vcov 
A 
differences 
A 
p.differences 
A 
sed 
A 
LSD 
An 
LSDtype 
A 
LSDsupplied 
A 
LSDby 
A 
LSDstatistic 
A 
LSDaccuracy 
A 
retain.zeroLSDs 
A 
zero.tolerance 
A 
backtransforms 
A 
response 
A 
response.title 
A 
term 
A 
tdf 
an 
x.num 
A character string giving the name of the numeric covariate that
corresponds to 
x.fac 
A character string giving the name of the factor that corresponds to

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 pvalues and standard errors. 
pairwise 
A logical indicating whether all pairwise differences of the

alpha 
A 
transform.power 
A 
offset 
A 
scale 
A 
inestimable.rm 
A 
sortFactor 
A 
sortParallelToCombo 
A 
sortNestingFactor 
A 
sortOrder 
A The following creates a 
decreasing 
A 
... 
provision for passsing arguments to functions called internally  not used at present. 
An alldiffs.object
with components
predictions
, vcov
, differences
, p.differences
sed
, and LSD
.
The name of the response
, the response.title
,
the term
, the classify
, tdf
, alpha
, sortFactor
and the sortOrder
will be set as attributes to the object.
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.
Also, see predictPlus.asreml
for more information.
Chris Brien
asremlPluspackage
, as.alldiffs
, as.predictions.frame
,
sort.alldiffs
, subset.alldiffs
,
print.alldiffs
, renewClassify.alldiffs
,
redoErrorIntervals.alldiffs
,
recalcLSD.alldiffs
, plotPredictions.data.frame
,
predictPlus.asreml
,
predictPresent.asreml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55  data(Oats.dat)
## Use asreml to get predictions and associated statistics
## Not run:
m1.asr < asreml(Yield ~ Nitrogen*Variety,
random=~Blocks/Wplots,
data=Oats.dat)
current.asrt < as.asrtests(m1.asr)
Var.pred < asreml::predict.asreml(m1.asr, classify="Nitrogen:Variety",
sed=TRUE)
if (getASRemlVersionLoaded(nchar = 1) == "3")
Var.pred < Var.pred$predictions
Var.preds < Var.pred$pvals
Var.sed < Var.pred$sed
Var.vcov < NULL
wald.tab < current.asrt$wald.tab
den.df < wald.tab[match("Variety", rownames(wald.tab)), "denDF"]
## End(Not run)
## Use lmerTest and emmmeans to get predictions and associated statistics
if (requireNamespace("lmerTest", quietly = TRUE) &
requireNamespace("emmeans", quietly = TRUE))
{
m1.lmer < lmerTest::lmer(Yield ~ Nitrogen*Variety + (1Blocks/Wplots),
data=Oats.dat)
Var.emm < emmeans::emmeans(m1.lmer, specs = ~ Nitrogen:Variety)
Var.preds < summary(Var.emm)
den.df < min(Var.preds$df)
## Modify Var.preds to be compatible with a predictions.frame
Var.preds < as.predictions.frame(Var.preds, predictions = "emmean",
se = "SE", interval.type = "CI",
interval.names = c("lower.CL", "upper.CL"))
Var.vcov < vcov(Var.emm)
Var.sed < NULL
}
## Use the predictions obtained with either asreml or lmerTest
if (exists("Var.preds"))
{
## Order the Varieties in decreasing order for the predictions values in the
## first N level
Var.diffs < allDifferences(predictions = Var.preds,
classify = "Nitrogen:Variety",
sed = Var.sed, vcov = Var.vcov, tdf = den.df,
sortFactor = "Variety", decreasing = TRUE)
print.alldiffs(Var.diffs, which="differences")
## Change the order of the factors in the alldiffs object and reorder components
Var.reord.diffs < allDifferences(predictions = Var.preds,
classify = "Variety:Nitrogen",
sed = Var.sed, vcov = Var.vcov, tdf = den.df)
print.alldiffs(Var.reord.diffs, which="predictions")
}

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.