Skip to contents

Results of predictmeans functions carry short advice when this fit and these data call for a choice or a caution the user may not know about: an unbalanced design, empty cells, a covariate aliased with a factor, a singular fit, an extrapolated mean, few degrees of freedom, many tests, too few permutations, and so on. Advice is printed at the end of the result as an "Advice:" block (! a caution: the result may mislead as it stands; i a note: a choice worth knowing). It is never generic, and no test is run that was not asked for. advice() returns it as a data frame, for code and AI assistants.

options(predictmeans.advice = FALSE) stops the printing; the advice is still stored.

Usage

advice(x)

Value

A data frame with columns id (stable, listed below), level ("caution" or "note") and text; zero rows when there is no advice.

Advice ids

idfromwhen
nonestimable_meanspredictmeans, covariatemeanssome means cannot be estimated (NA)
empty_cellspredictmeansmeans average over the observed cells only
aliased_covariatepredictmeansa covariate is constant within a factor's levels
large_sepredictmeansa mean's SE is over 3 times the median SE
lsd_variespredictmeansthe average LSD judges some pair differently from its own test
bias_adjustpredictmeans, covariatemeansback-transformed means are a typical cluster's or a median, not the mean
contrast_common_cellscontrastmeanscontrasts are estimated on the cells their means share
small_dfpredictmeans, contrastmeansdegrees of freedom below 5
many_tests_unadjustedpredictmeans, contrastmeans6 or more requested tests with adj = "none"
singular_fitpredictmeans, contrastmeans, R2_model, semirega variance at zero or a correlation at +-1
anova_unbalanced_typeI, _typeII, _typeIIIanovaunbalanced data: what the type tests
anova_nested_in_dataanovaa factor nested in another in the data, without the nesting in the model
h2_standard_unbalancedheritabilitythe standard form with unequal plots per genotype or incomplete blocks
h2_forms_differheritabilitythe forms differ by more than 0.1
h2_above_oneheritabilitya family heritability above 1 (beyond or within its sampling error)
h2_genotype_zeroheritabilitythe genotypic variance estimated as 0
h2_genotype_nestedheritabilitygenotypes nested in a fixed factor
anova_empty_cellsanovaempty cells: no type tests a main effect over all cells
anova_covariate_zeroanovaType III with a covariate in an interaction (tests at covariate = 0)
check_<name>pm_checka check worth a look (the note of its row)
few_permutationspermmodels, bootmodelsfewer than 999 resamples and a p-value at the floor or near 0.05
r2_latent_scaleR2_modela non-gaussian model: R2 on the link scale
variance_at_zerovarcomp, se_ranefa variance estimated as zero
few_re_levelsvarcomp, se_ranefa random effect with fewer than 5 levels
variance_test_boundaryvarcomphow to test a variance against zero (test = TRUE)
ranef_conditional_fixedse_ranefconditional SEs of a random term that contains a fixed factor
smooth_linearsemirega smooth estimated as a straight line (variance 0)
extrapolationsemipred, covariatemeans, pm_slopespredictions beyond the range of the data
pointwise_regionssemipred, covariatemeansregions of difference read from pointwise limits
smooth_other_covariatesemipreda smooth in the prediction does not involve covariate (adds a constant)
nonestimable_slopespm_slopesthe covariate is aliased with a factor: slopes NA, their differences kept
slopes_equal_by_modelpm_slopesno covariate x term interaction: the slopes are equal by assumption
slopes_at_valuepm_slopesa curved term or a link: the slopes depend on at

Examples

oats <- nlme::Oats
oats$nitro <- factor(oats$nitro)
fm <- lme4::lmer(log(yield) ~ nitro * Variety + (1 | Block), data = oats)
res <- predictmeans(fm, "nitro:Variety", pairwise = TRUE)
#> The response is log(yield): the means are also given back-transformed to the original scale (trans = I for the model scale only).
advice(res)
#>                      id level
#> 1           bias_adjust  note
#> 2 many_tests_unadjusted  note
#>                                                                                                                                                                                             text
#> 1 'response' is the median of the original scale (the geometric mean for a log), not the mean. If the mean on the original scale is wanted (totals, averages to report), use bias_adjust = TRUE.
#> 2                                      66 pairs tested without adjustment: some will be significant by chance. If they are a family, use adj = "holm" (any design) or "tukey"/"mvt" (all pairs).