Convert template ma.model.template.R to a JAGS model.

write.ma.model(
  modelfile,
  outfile,
  reg.model,
  pr.dist,
  pr.param.a,
  pr.param.b,
  n,
  trt.n,
  site.n,
  ghs.n,
  tauA,
  tauB
)

Arguments

modelfile

model template file (ma.model.template.R)

outfile

file name of model created

reg.model

structure of regression model

pr.dist

A string representing the root distribution name used by R, e.g. 'norm', 'lnorm', 'gamma', 'beta', etc.

pr.param.a

first parameter value accepted by pr.dist

pr.param.b

second parameter value accepted by pr.dist

n

number of observations in data

trt.n

number of distinct treatments in data

site.n

number of distinct sites in data

ghs.n

= 1 if only non-greenhouse or greenhouse studies included, 2 if both

tauA

parameter a for gamma prior on precision

tauB

parameter b for gamma prior on precision

Value

Nothing, but as a side effect, the model is written

Details

Writes a meta-analysis model based on available data and prior specification. Inspired by the R2WinBUGS::write.model by Jouni Kerman and Uwe Ligges.

Author

David LeBauer and Mike Dietze.