
Predicted Means for Linear and Semiparametric Models
Source:R/predictmeans-package.R
predictmeans-package.RdThis package provides functions to diagnose and make inferences from linear, generalized linear, mixed and semiparametric models, such as those obtained from 'aov', 'lm', 'glm', 'gls', 'lme', 'lmer', 'glmer', 'glmmTMB', 'gam' and 'semireg'. Inferences include predicted means and standard errors, contrasts, multiple comparisons, permutation tests, adjusted R-square and graphs (autoplot()). Vignettes (browseVignettes("predictmeans")) show worked examples. For AI assistants and scripted use, system.file("llms-context.md", package = "predictmeans") gives a compact description of the result tables, defaults and common recipes.
What predictmeans aims for
Defaults chosen on evidence (simulation, literature): Kenward-Roger df and adjusted SEs for REML
lmerfits; permutation p-values \((b + 1)/(B + 1)\), never 0; Genstat-style stratum SEs foraovmodels withError()strata.Checked against outside references: SAS PROC MIXED and Genstat runs (
dev/sas,dev/genstatin the package sources), pbkrtest, nlme and emmeans, in tests with stated tolerances.Works across
lm,glm,aov,lmer,glmer,lme,gls,glmmTMB,gamandsemiregfits; when a result cannot be computed correctly it stops with a clear message.Advice triggered by this fit and data, read with
advice.Results are the same for any
ncore.
References
Welham, S., Cullis, B., Gogel, B., Gilmour, A., & Thompson, R. (2004), Prediction in linear mixed models, Australian and New Zealand Journal of Statistics, 46(3), 325-347.
