prior2macro: Translates informative prior information into a concise MLwiN...

View source: R/prior2macro.R

prior2macroR Documentation

Translates informative prior information into a concise MLwiN macro.

Description

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.

Usage

prior2macro(prior, D, fpart, nrand)

Arguments

prior

An R list object containing prior information for a multilevel model. See ‘Details’ below.

D

A character string specifying the type of distribution, which can be one of 'Normal', 'Binomial', 'Poisson', 'Negbinom', 'Multinomial', 'Multivariate Normal', or 'Mixed'

fpart

An R list containing the list of fixed part parameter labels.

nrand

An R list of lists, containing the number of random parameters at each level.

Details

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. The names used in the list should match those in the model output.

  • 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 – a prior guess for the true value of the covariance matrix; (2) size – sample size for guess. Note that this is a weakly-informative prior and the default prior is used if missing.

Value

A long vector is returned in the format of MLwiN macro language. This includes all the specified prior parameters.

Author(s)

Zhang, Z., Charlton, C.M.J., Parker, R.M.A., Leckie, G., and Browne, W.J. (2016) Centre for Multilevel Modelling, University of Bristol.

See Also

runMLwiN


R2MLwiN documentation built on March 31, 2023, 9:17 p.m.

Related to prior2macro in R2MLwiN...