Last data update: 2014.03.03

R: A function used to make a 'meta4diag' object.
makeObjectR Documentation

A function used to make a meta4diag object.

Description

Takes an internal data list, an internal prior setting list and an INLA object produced by makeData(), makePriors() and runModel(), respectively and makes a meta4diag object which contains various informations for later use. This function is used in the main function meta4diag() and can also be used as a separate function.

Usage

  makeObject(outdata, outpriors, model, nsample=FALSE)

Arguments

outdata

A list of the internal data that can be used in INLA and the original data as obtained by the function makeData().

outpriors

A list of prior settings as obtained by the function makePriors(). Contains the internal setting, priors of precisions and transfomed correlation that are used in INLA.

model

An INLA object. Get from function runModel().

nsample

A numerical value specifying the number of posterior samples, default is FALSE. The posterior samples are used to compute the marginals and estimates values of non-linear functions, such as log ratios and diagnostic odds ratios. If nsample is given, summary.summarized.statistics, summary.fitted.LRpos, summary.fitted.LRneg, summary.fitted.DOR and samples of E(se), E(sp), E(1-se) and E(1-sp) will be returned.

Value

makeObject returns a meta4diag object with components:

data

The provided input data.

outdata

The internal data that could be used in INLA from function makeData().

priors.density

Prior distributions for the variance components and correlation from function makePriors().

names.fitted

Names of the jointly modelled accuracies in the model. For example, se and sp or (1-se) and sp.

names.transf.fitted

Names of transformed accuracies. If se and sp are jointly estimated in model, then names.transf.fitted=c("(1-se)","(1-sp")).

cpu.used

The cpu time used for running the model.

call

The matched call.

summary.fixed

Matrix containing the mean and standard deviation (plus, possibly quantiles) of the fixed effects of the model.

marginals.fixed

A list containing the posterior marginal densities of the fixed effects of the model.

summary.expected.gtransformed.accuracy

Matrix containing the mean and standard deviation (plus, possibly quantiles) of the mean of accuracies transformed with the link function, i.e. E(g(Se)), E(g(Sp)), E(g(1-Se)) and E(g(1-Sp)).

marginals.expected.gtransformed.accuracy

A list containing the posterior marginal densities of the mean of accuracies transformed with the link function, i.e. E(g(Se)), E(g(Sp)), E(g(1-Se)) and E(g(1-Sp)).

summary.expected.accuracy

Matrix containing the mean and standard deviation (plus, possibly quantiles) of the mean of the accuracies, i.e. E(Se), E(Sp), E(1-Se) and E(1-Sp).

marginals.expected.accuracy

A list containing the posterior marginal densities of of the mean of the accuracies, i.e. E(Se), E(Sp), E(1-Se) and E(1-Sp).

summary.hyperpar

A matrix containing the mean and sd (plus, possibly quantiles) of the hyperparameters of the model.

marginals.hyperpar

A list containing the posterior marginal densities of the hyperparameters of the model.

correlation.linear.comb

A correlation matrix between the mean of the accuracies transformed with the link function.

covariance.linear.comb

A covariance matrix between the mean of the accuracies transformed with the link function.

summary.predict.(...)

A matrix containing the mean and sd (plus, possibly quantiles) of the linear predictors one transformed accuracy in the model. The accuracy type depends on the model type. See argument model.type. For example, the possible accuracy type could be g(se) and g(sp) when model.type=1, where g() is the link function.

marginals.predict.(...)

A list containing the posterior marginals of the linear predictors of one transformed accuracy in the model. The accuracy type depends on the model type. See argument model.type. For example, the possible accuracy type could be g(se) and g(sp) when model.type=1, where g() is the link function.

summary.fitted.(...)

A matrix containing the mean and sd (plus, possibly quantiles) of the linear predictors one back-transformed accuracy in the model. The accuracy type depends on the model type. See argument model.type. For example, the possible accuracy type could be g^{-1}(se) and g^{-1}(sp) when model.type=1, where g() is the link function.

marginals.fitted.(...)

A list containing the posterior marginals of the linear predictors of one back-transformed accuracy in the model. The accuracy type depends on the model type. See argument model.type. For example, the possible accuracy type could be g^{-1}(se) and g^{-1}(sp) when model.type=1, where g() is the link function.

misc

Some other settings that maybe useful retruned by meta4diag.

dic

The deviance information criteria and effective number of parameters.

cpo

A list of three elements: cpo$cpo are the values of the conditional predictive ordinate (CPO), cpo$pit are the values of the probability integral transform (PIT) and cpo$failure indicates whether some assumptions are violated. In short, if cpo$failure[i] > 0 then some assumption is violated, the higher the value (maximum 1) the more seriously.

waic

A list of two elements: waic$waic is the Watanabe-Akaike information criteria, and waic$p.eff is the estimated effective number of parameters.

mlik

The log marginal likelihood of the model

inla.result

A INLA object that from function runModel() which implements INLA.

summary.summarized.statistics

A matrix containing the mean and sd (plus, possibly quantiles) of mean positive and negative likelihood ratios and mean diagnostic odds ratios if nsample is given.

summary.fitted.LRpos

A matrix containing the mean and sd (plus, possibly quantiles) of fitted positive likelihood ratios for each study if nsample is given.

summary.fitted.LRneg

A matrix containing the mean and sd (plus, possibly quantiles) of fitted negative likelihood ratios for each study if nsample is given.

summary.fitted.DOR

A matrix containing the mean and sd (plus, possibly quantiles) of fitted diagnostic odds ratios for each study if nsample is given.

mean(Se).samples

A vector of mean sensitivity samples if nsample is given.

mean(Sp).samples

A vector of mean specificity samples if nsample is given.

mean(1-Se).samples

A vector of mean fnr samples if nsample is given.

mean(1-Sp).samples

A vector of mean fpr samples if nsample is given.

Author(s)

Jingyi Guo

See Also

makeData, makePriors, runModel, meta4diag

Examples

## Not run: 
if(requireNamespace("INLA", quietly = TRUE)){
  require("INLA", quietly = TRUE)
  data(Catheter)
  outdata = makeData(Catheter)
  outpriors = makePriors()
  model = runModel(outdata=outdata, outpriors=outpriors, link="logit")
  res = makeObject(outdata, outpriors, model, nsample=2000)
}

## End(Not run)

Results