Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hpd.summary

Summarize an emmGrid from a Bayesian model


Description

This function computes point estimates and HPD intervals for each factor combination in object@emmGrid. While this function may be called independently, it is called automatically by the S3 method summary.emmGrid when the object is based on a Bayesian model. (Note: the level argument, or its default, is passed as prob).

Usage

hpd.summary(object, prob, by, type, point.est = median,
  bias.adjust = get_emm_option("back.bias.adj"), sigma, ...)

Arguments

object

an emmGrid object having a non-missing post.beta slot

prob

numeric probability content for HPD intervals (note: when not specified, the current level option is used; see emm_options)

by

factors to use as by variables

type

prediction type as in summary.emmGrid

point.est

function to use to compute the point estimates from the posterior sample for each grid point

bias.adjust

Logical value for whether to adjust for bias in back-transforming (type = "response"). This requires a value of sigma to exist in the object or be specified.

sigma

Error SD assumed for bias correction (when type = "response". If not specified, object@misc$sigma is used, and an error is thrown if it is not found. Note: sigma may be a vector, as long as it conforms to the number of observations in the posterior sample.

...

required but not used

Value

an object of class summary_emm

See Also

summary.emmGrid

Examples

if(require("coda")) {
  # Create an emmGrid object from a system file
  cbpp.rg <- do.call(emmobj, 
      readRDS(system.file("extdata", "cbpplist", package = "emmeans")))
  hpd.summary(emmeans(cbpp.rg, "period"))
}

emmeans

Estimated Marginal Means, aka Least-Squares Means

v1.6.0
GPL-2 | GPL-3
Authors
Russell V. Lenth [aut, cre, cph], Paul Buerkner [ctb], Maxime Herve [ctb], Jonathon Love [ctb], Hannes Riebl [ctb], Henrik Singmann [ctb]
Initial release
2021-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.