LSD.frame {asremlPlus} | R Documentation |
Description of an LSD frame
Description
A data.frame
that stores
Least Significant differences (LSDs) for predictions
for a fitted model.
Value
A data.frame
that can be a component of an alldiffs.object
and that
contains LSD values and statistics to be used in determining the significance of the
pairwise differences. In particular, they are used in calculating
halfLeastSignificant
limits to be included in a predictions.frame
.
Exactly what an LSD.frame
contains is
determined by the following arguments to functions that return an
alldiffs.object
: LSDtype
, LSDby
, LSDstatistic
,
LSDaccuracy
and LSDsupplied
. The rownames
of the LSD.frame
indicate, for each of its rows, for what group of predictions the entries in the row were calculated,
this being controlled by the LSDtype
and LSDby
arguments. The values for
all of the LSD arguments are stored as attributes to the alldiffs.object
and the
predictions
and, if present backtransforms
, components of the
alldiffs.object
.
An LSD.frame
always has the eight columns c
, minimumLSD
, meanLSD
,
maximumLSD
, assignedLSD
, accuracyLSD
, falsePos
and
falseNeg
.
-
c
: This gives the number of pairwise comparison of predictions for the combinations of the factor levels given by the row name. If the row name isoverall
then it is for all predictions. -
minimumLSD, meanLSD, maximumLSD
: These are computed for eitheroverall
,factor.combinations
,per.prediction
orsupplied
LSD values, as specified by theLSDtype
argument. ThemeanLSD
is calculated using the square root of the mean of the variances of set of pairwise differences appropriate to the specificLSDtype
argument.For
overall
, the mean, minimum and maximum of the LSDs for all pairwise comparisons are computed.If
factor.combinations
was specified forLSDtype
when the LSDs were being calculated, then theLSD.frame
contains a row for each combination of the values of thefactors
andnumerics
specified byLSDby
. The values in a row are calculated from the LSD values for the pairwise differences for each combination of thefactors
andnumerics
values, unless there is only one prediction for a combination, when notional LSDs are calculated that are based on the standard error of the prediction multiplied by the square root of two.For
per.prediction
, the minimum, mean and maximum LSD, based, for each prediction, on the LSD values for all pairwise differences involving that prediction are computed.For
supplied
, theLSD.frame
is set up based on the setting ofLSDby
: a single row with nameoverall
ifLSDby
isNULL
or, ifLSDby
is a vector offactor
andnumeric
names, rows for each observed combinations of the values of the namedfactors
andnumerics
. TheLSDsupplied
argument is used to provide the values to be stored in the columnassignedLSD
. -
assignedLSD
: TheassignedLSD
column contains the values that are assigned for use in calculatinghalfLeastSignificant
error.intervals
. Its contents are determined byLSDstatistic
andLSDsupplied
arguments. TheLSDsupplied
argument allows the direct specification of values to be placed in theassignedLSD
column of theLSD.frame
. The default is to use the values in themeanLSD
column. -
LSDaccuracy
: TheLSDaccuracy
gives an indication of the proportion that the correct LSD for a singlepredicted.value
might deviate from itsassignedLSD
value. The contents of theaccuracyLSD
column is controlled by theLSDaccuracy
argument. -
falsePos
andfalseNeg
: These columns contain the number of false positives and negatives if theassignedLSD
value(s) is(are) used to determine the significance of the pairwise predictions differences. Each LSD value in theassignedLSD
column is used to determine the significance of pairwise differences that involve predictions for the combination of values given by the row name for the LSD value.
See recalcLSD.alldiffs
for more information.
Author(s)
Chris Brien
See Also
recalcLSD.alldiffs
, redoErrorIntervals.alldiffs
,
predictPresent.asreml
,
predictPlus.asreml
Examples
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.diffs <- predictPlus(m1.asr, classify="Nitrogen:Variety",
wald.tab = current.asrt$wald.tab,
tables = "none")
## 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 + (1|Blocks/Wplots),
data=Oats.dat)
#Get predictions
Var.emm <- emmeans::emmeans(m1.lmer, specs = ~ Nitrogen:Variety)
Var.preds <- summary(Var.emm)
## 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
#Set up an alldiffs object, which includes overall LSDs
Var.diffs <- allDifferences(predictions = Var.preds, classify = "Variety:Nitrogen",
sed = Var.sed, vcov = Var.vcov, tdf = 45)
}
if (exists("Var.diffs"))
{
## Use recalcLSD to get LSDs for within Variety differences
Var.LSD.diffs <- recalcLSD(Var.diffs,
LSDtype = "factor.combinations", LSDby = "Variety")
print(Var.LSD.diffs$LSD)
}