writeBugsModel {glmmBUGS} | R Documentation |
Given a list of effect groups, and the covariates associated with each level, a bugs model file is written using ragged arrays corresponding to output from winBugsRaggedArray
writeBugsModel(file, effects, covariates, observations, family = c("bernoulli", "binomial", "poisson", "normal", "other"), spatial=NULL)
file |
a character string denoting the name of the bugs model file writen. |
effects |
vector of effect groups |
covariates |
A list with names corresponding to effects and each element being a vector of covariates applicable at that level |
observations |
A character string giving the column of observations, or a vector where the first element is the observations and the remaning are offsets. |
family |
Response distribution |
spatial |
spatial variable |
The arguments to the function specify a generalised linear mixed model. A file containing code for a corresponding bugs model is written. The model uses ragged arrays to specify grouping factors, and includes covariates at the appropriate levels to aid in chain convergence. It is intended that the user will edit this file before it's use. The prior distributions in particular may not be appropriate.
A file, suitable for passing to the bugs
function in R2WinBUGS
.
You are strongly encouraged to modify the model file prior to using it.
Patrick Brown, patrick.brown@utoronto.ca
"Handling unbalanced datasets" in the "Tricks: Advanced Use of the BUGS Language" section of the bugs manual, at \url{http://mathstat.helsinki.fi/openbugs/data/Docu/Tricks.html#HandlingUnbalancedDatasets}
writeBugsModel("model.bug", effects="Strip", observations="conc", covariates=list(observations="length"), family="normal")