Adds sections of JAGS code for an MBNMA model that correspond to the likelihood
write.likelihood(
model,
timecourse,
rho = 0,
covar = "varadj",
link = "identity",
sdscale = FALSE,
fun
)A character vector of JAGS MBNMA model code that includes likelihood components of the model
A character object of JAGS MBNMA model code
A character object representing the time-course used in the MBNMA model
The correlation coefficient when modelling within-study correlation between time points. The default is a string representing a
prior distribution in JAGS, indicating that it be estimated from the data (e.g. rho="dunif(0,1)"). rho also be assigned a
numeric value (e.g. rho=0.7), which fixes rho in the model to this value (e.g. for use in a deterministic sensitivity analysis).
If set to rho=0 (the default) then this implies modelling no correlation between time points.
A character specifying the covariance structure to use for modelling within-study correlation between time-points. This can be done by specifying one of the following:
"varadj" - a univariate likelihood with a variance adjustment to assume a constant correlation between subsequent
time points jansen2015MBNMAtime. This is the default.
"CS" - a multivariate normal likelihood with a
compound symmetry structure
"AR1" - a multivariate normal likelihood with an
autoregressive AR1 structure
Can take either "identity" (the default),
"log" (for modelling Ratios of Means friedrich2011MBNMAtime) or
"smd" (for modelling Standardised Mean Differences - although this also corresponds to an identity link function).
Logical object to indicate whether to write a model that specifies a reference SD
for standardising when modelling using Standardised Mean Differences. Specifying sdscale=TRUE
will therefore only modify the model if link function is set to SMD (link="smd").
An object of class "timefun" generated (see Details) using any of
tloglin(), tpoly(), titp(), temax(), tfpoly(), tspline() or tuser()