View source: R/SpecPrior-generators.R
Exch | R Documentation |
Specify a prior for main effects or interactions in which the units are exchangeable. Units are exchangeable if the labels or ordering of the units does not provide any information about their distribution.
Exch(covariates = NULL, error = Error())
covariates |
An object of class
|
error |
An object of class |
The prior specified by Exch
has the form
parameter[j] = covariates[j] + error[j].
Including a covariates term can make the assumption of exchangeability
more plausible. For instance, treating regional effects as exchangeable
is more plausible after the region effects have been adjusted for
differences in regions' incomes and population sizes. A covariates term
can be specified using function Covariates
.
Errors can have a normal or t distribution. The error term is
specified using function Error
.
An object of class SpecExch
.
ExchFixed
specifies a simpler
exchangeable prior. DLM
specifies a
non-exchangeable prior.
Exch()
Exch(error = Error(robust = TRUE))
Exch(error = Error(scale = HalfT(scale = 0.5)))
## with covariates
data <- data.frame(region = letters[1:10],
income = rnorm(10))
Exch(covariates = Covariates(mean ~ income, data = data))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.