| 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 isoverallthen it is for all predictions. -
minimumLSD, meanLSD, maximumLSD: These are computed for eitheroverall,factor.combinations,per.predictionorsuppliedLSD values, as specified by theLSDtypeargument. ThemeanLSDis calculated using the square root of the mean of the variances of set of pairwise differences appropriate to the specificLSDtypeargument.For
overall, the mean, minimum and maximum of the LSDs for all pairwise comparisons are computed.If
factor.combinationswas specified forLSDtypewhen the LSDs were being calculated, then theLSD.framecontains a row for each combination of the values of thefactorsandnumericsspecified byLSDby. The values in a row are calculated from the LSD values for the pairwise differences for each combination of thefactorsandnumericsvalues, 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.frameis set up based on the setting ofLSDby: a single row with nameoverallifLSDbyisNULLor, ifLSDbyis a vector offactorandnumericnames, rows for each observed combinations of the values of the namedfactorsandnumerics. TheLSDsuppliedargument is used to provide the values to be stored in the columnassignedLSD. -
assignedLSD: TheassignedLSDcolumn contains the values that are assigned for use in calculatinghalfLeastSignificanterror.intervals. Its contents are determined byLSDstatisticandLSDsuppliedarguments. TheLSDsuppliedargument allows the direct specification of values to be placed in theassignedLSDcolumn of theLSD.frame. The default is to use the values in themeanLSDcolumn. -
LSDaccuracy: TheLSDaccuracygives an indication of the proportion that the correct LSD for a singlepredicted.valuemight deviate from itsassignedLSDvalue. The contents of theaccuracyLSDcolumn is controlled by theLSDaccuracyargument. -
falsePosandfalseNeg: These columns contain the number of false positives and negatives if theassignedLSDvalue(s) is(are) used to determine the significance of the pairwise predictions differences. Each LSD value in theassignedLSDcolumn 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)
}