bugsModel | R Documentation |
Generating OpenBUGS model file
bugsModel(formula, fd, sd, random = NULL, modelname = "bugmodel", wd = getwd())
formula |
A formula object, with the DV on the left of an ~ operator, and predictors on the right. For the part on the right of '~', the specification of submodels can be separated by '|'. So |
fd |
A string that specifies the parent distribution (see cdfqrFamily). |
sd |
A string that specifies the sub-family distribution. |
random |
Character or vector of characters that indicates the random effect factors. |
modelname |
The name of the model file; optional. |
wd |
The working directory in which OpenBUGS will work (i.e., generate the model files and chain information). |
A model ‘.txt’ file is generated in the specified working directory. The function also returns a list of values:
Default initial values for MCMC two chain procedure.
A list of variables that are included in the estimation.
a list of characters that specify the nodes to be monitored.
## Not run:
# Need write access in the working directory before executing the code.
# No random component
bugsModel(y ~ x1 | x2, 't2','t2', random = NULL)
# Random component as subject ID
bugsModel(y ~ x1 | x2, 't2','t2', random = 'ID')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.