ll.call | R Documentation |
GeMTC implements various likelihood/link combinations.
Functionality specific to the likelihood/link is handled by methods with names ending in
.<likelihood>.<link>
.
This convenience function calls such methods.
ll.call(fnName, model, ...)
fnName |
The name of the function to call. See details for available functions. |
model |
An object of S3 class |
... |
Additional arguments to be passed to the function. |
The following methods currently need to be implemented to implement a likelihood/link:
mtc.arm.mle
: calculates a (corrected) maximum likelihood estimate for an arm-level
effect. Used to generate starting values.
mtc.rel.mle
: calculates a (corrected) maximum likelihood estimate for a relative
effect. Used to generate starting values.
mtc.code.likelihood
: generates JAGS code implementing the likelihood.
scale.log
: returns TRUE if plots should use the log scale.
scale.name
: returns the user-facing name of the outcome metric.
scale.limit.inits
: returns an upper and lower bound for the initial values, because
some initial values might trigger boundary conditions such as probability 0 or 1 for the binomial.
required.columns.ab
: returns the required columns for arm-based data.
The first two methods can now also be used to selectively apply continuity corrections in case the maximum likelihood estimates are used for other purposes. mtc.arm.mle
has an additional k=0.5
argument to specify the correction factor. mtc.rel.mle
has arguments correction.force=TRUE
to force application of the continuity correction even if unnecessary, correction.type="constant"
to specify the type of correction (specify "reciprocal"
) for a correction proportional to the reciprocal of the size of the other arm, and correction.magnitude=1
to specify the (total) magnitude of the correction. These corrections apply only for count data, and will be ignored for continuous likelihood/links.
The return value of the called function.
Gert van Valkenhoef
mtc.model
# The "model" may be a stub.
model <- list(likelihood="poisson", link="log")
ll.call("scale.name", model)
# "Hazard Ratio"
ll.call("mtc.arm.mle", model, c('responders'=12, 'exposure'=80))
# mean sd
#-1.8562980 0.1118034
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.