An internal function which takes an R list object containing informative prior information for a multilevel model and translates it into a concise vector object to be used in an MLwiN macro.
prior2macro(prior, formula, levID, D, indata)
An R list object containing prior information for a multilevel model. See `Details' below.
A formula object; see
Formula.translate
or Formula.translate.compat
.
A string vector specifying the level ID(s).
A character string/vector specifying the distribution of the current model.
A data.frame object containing the variables to be modelled.
A long vector is returned in the format of MLwiN macro language. This includes all the specified prior parameters.
The prior
list can contain the following:
fixe
: For the fixed
parameters, if proper normal priors are used for some parameters, a list of
vectors of length two is provided, each of which specifies the mean and the
standard deviation. If not given, default ('flat' or 'diffuse') priors are
used for the parameters.
fixe.common
: For multivariate normal,
multinomial and mixed response models, if common coefficients are added, use
fixe.common
rather than fixe
.
fixe.sep
: If the common
coefficients are added, use fixe.sep
for the separate coefficients.
rp<level number>
: A list object specifying the Wishart or gamma prior for the
covariance matrix or scalar variance at the levels specified, e.g. rp1
for
level 1, rp2
for level 2, etc. Consists of: (1)
estimate
-- an estimate for the true value of the inverse of the
covariance matrix; (2) size
-- the number of rows in the covariance
matrix. Note that this is a weakly-informative prior and the default prior
is used if missing.