makeData: Make internally used data structure.

View source: R/makeData.R

makeDataR Documentation

Make internally used data structure.

Description

Transform the format of the input dataset into internal use format. This function is used within the main function meta4diag() and can also be used as a separate function.

Usage

makeData(data = NULL, model.type = 1, modality = NULL, covariates = NULL)

Arguments

data

A data frame contains at least 4 columns specifying the number of True Positive(TP), False Negative(FN), True Negative(TN) and False Positive(FP). The additional columns other than studynames will be considered as potential covariates and the name or the column number of the potential covariates can be set in the arguments modality and covariates to use them in the model.

model.type

A numerical value specifying the model type, options are 1(default), 2, 3 and 4. model.type=1 indicates that the Sensitivity(se) and Specificity(sp) will be modelled in the bivariate model, i.e. g(se) and g(sp) are bivariate normal distributed. model.type=2,3,4 indicate that the Sensitivity(se) and False Negative Rate(1-sp), False Positive Rate(1-se) and Specificity(sp), False Positive Rate(1-se) and False Negative Rate(1-sp) are modelled in the bivariate model, respectively.

modality

A string specifying the modality variable, which is a categorical variable, such as test threshold. Default value is NULL. See also examples.

covariates

A vector specifying the continuous covariates variables, such as disease prevalence or average individual patients status of each study. Default value is NULL. See also examples.

Value

A constructed list with components:

internaldata

a data frame used as internal data in INLA.

originaldata

a data frame which is equal to the provided input data.

covariates.setting

a vector specified the setting of covariates, if covariates is given.

modality.setting

a vector specified the setting of modality, if modality is given.

model.type

a value specified the model type.

Author(s)

Jingyi Guo and Andrea Riebler

Examples

## Not run: 
data(Catheter)

a = makeData(data=Catheter,model.type=1,modality="type")
b = makeData(data=Catheter,model.type=1,modality=2)
c = makeData(data=Catheter,model.type=1,covariates="prevalence")
d = makeData(data=Catheter,model.type=1,covariates=3)
e = makeData(data=Catheter,model.type=1,modality="type",covariates="prevalence")

## End(Not run)

meta4diag documentation built on Nov. 29, 2023, 3:01 a.m.