
Last chance! 50% off unlimited learning
Sale ends in
Generating OpenBUGS model file
bugsModel(formula, fd, sd, random = NULL, modelname = "bugmodel", wd = getwd())
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.
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 y ~ X1 | X2
means the DV is y
,X1
is the term in the mean submodel, and X2
is the term in the dispersion submodel.
A string that specifies the parent distribution (see cdfqrFamily).
A string that specifies the sub-family distribution.
Character or vector of characters that indicates the random effect factors.
The name of the model file; optional.
The working directory in which OpenBUGS will work (i.e., generate the model files and chain information).
if (FALSE) {
# 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')
}
Run the code above in your browser using DataLab