Learn R Programming

R2MLwiN (version 0.1-7)

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

Description

An R list object containing informative prior information for a multilevel model is translated into a concise vector object to be used in an MLwiN macro.

Usage

prior2macro(prior, formula, levID, D, indata)

Arguments

prior
An R list object containing prior information for a multilevel model. See Value below.
formula
A character string specifying the model formula. See Formula.translate.
levID
A character (vector) specifying the level ID(s).
D
A character string/vector specifying the distribution of the current model.
indata
A data.frame object containing the variables to be modelled.

Value

  • priorContains the prior information for a multilevel model. Also see the examples in demo(Chapter06).
  • fixeFor 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.commonFor multivariate normal, multinomial and mixed response models, if common coefficients are added, use fixe.common rather than fixe.
  • fixe.sepIf the common coefficients are added, use fixe.sep for the separate coefficients.
  • rp1A list object specifying the Wishart or gamma prior for the covariance matrix or scalar variance at level 1. 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.
  • rp2A list object specifying the Wishart or gamma prior for the covariance matrix or scalar variance at level 2. 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.
  • ......
  • A long vector is returned in the format of MLwiN macro language. This includes all the specified prior parameters.

References

MCMC estimation in MLwiN Version 2.25. Browne, W.J. (2012) Centre for Multilevel Modelling, University of Bristol.

See Also

runMLwiN