Ra {GLMMGibbs}R Documentation

Create Random Factor

Description

Create a random factor to be used in the glmm function for fitting generalised linear mixed models by Gibbs sampling

Usage

Ra(data, shape=0.001, scale=0.001, type="identity",
contrast="identity", map="none", zlevel=1, of.interest=FALSE)

Details

Ra returns an a factor, which when included in the model passed to the glmm function, is treated as a random effect.

The effect values have a multivariate normal prior with mean zero and a covariance matrix which depends on the `type' of random effect and the parameterisation being used. Its inverse is the product of a fixed matrix and a random scalar hyperparameter, which has a gamma prior distribution with given shape and scale parameters.

Full details are given in the document "GLMMGibbs: An R Package for Estimating Bayesian Generalised Linear Mixed Models by Gibbs Sampling", supplied with this package.

Value

A value of class factor, but with additional attributes.

Author(s)

Jonathan Myles, Imperial Cancer Research Fund, and David Clayton, Wellcome Trust mylesj@icrf.icnet.uk

References

Clayton, D.G. (1996) Generalized Linear Mixed Models in em Ph{Markov chain Monte Carlo in Practice}, ed. Gilks, W. R. and Richardson, S. and and Spiegelhalter, D. J., Chapman & Hall.

See Also

glmm