Learn R Programming

meta4diag (version 2.1.1)

runModel: Run the bivariate model.

Description

Run the bivariate model with INLA. This function is used within the main function meta4diag() and can also be used as a separate function.

Usage

runModel(outdata, outpriors, link = "logit", 
  quantiles = c(0.025, 0.5, 0.975), verbose = FALSE, num.threads = 1)

Arguments

outdata

A data file for internal use.

outpriors

A list of prior settings prepared for internal use, see makePriors.

link

A string specifying the link function used in the model. Options are "logit", "probit" and "cloglog".

quantiles

A vector of quantiles, p(0), p(1),... to compute for each posterior marginal. The function returns, for each posterior marginal, the values x(0), x(1),... such that $$Prob(X<x)=p.$$ The default value are c(0.025, 0.5, 0.975). Not matter what other values are going to be given, the estimates for these 3 quantiles are always returned.

verbose

Boolean (default:FALSE) indicating whether the program should run in a verbose mode.

num.threads

Maximum number of threads the inla-program will use. xFor Windows this defaults to 1, otherwise its defaults to NULL (for which the system takes over control).

Value

A INLA object which will be used into function makeObject().

References

Havard Rue, Sara Martino, and Nicholas Chopin (2009). Approximate Bayesian Inference for Latent Gaussian Models Using Integrated Nested Laplace Approximations. Journal of the Royal Statistical Society B, 71, 319-392. (www.r-inla.org)

See Also

makeData, makePriors, makeObject, meta4diag, inla

Examples

Run this code
# NOT RUN {
if(requireNamespace("INLA", quietly = TRUE)) {
   require("INLA", quietly = TRUE)
   data(Catheter)

   outdata = makeData(data=Catheter,model.type=1,covariates="type")
   outpriors = makePriors(var.prior = "invgamma", cor.prior = "normal", 
                          var.par = c(0.25, 0.025), cor.par = c(0, 5))
   runModel(outdata, outpriors, link = "logit", 
            quantiles = c(0.025, 0.5, 0.975), verbose = FALSE)
}
# }

Run the code above in your browser using DataLab