Title: | Meta-Analysis of Diagnostic Accuracy |
---|---|
Description: | Provides functions for diagnostic meta-analysis. Next to basic analysis and visualization the bivariate Model of Reitsma et al. (2005) that is equivalent to the HSROC of Rutter & Gatsonis (2001) can be fitted. A new approach based to diagnostic meta-analysis of Holling et al. (2012) is also available. Standard methods like summary, plot and so on are provided. |
Authors: | Philipp Doebler with contributions from Bernardo Sousa-Pinto |
Maintainer: | Philipp Doebler <[email protected]> |
License: | GPL-2 |
Version: | 0.5.11 |
Built: | 2025-02-06 03:25:11 UTC |
Source: | https://github.com/cran/mada |
This package provides functions for diagnostic meta-analysis. Next to basic analysis and visualization the bivariate Model of Reitsma et al. (2005) that is equivalent to the HSROC of Rutter&Gatsonis (2001) can be fitted. A new approach based to diagnostic meta-analysis of Holling et al. (2012) is also available. Standard methods like summary, plot and so on are provided.
Package: | mada |
Type: | Package |
Version: | 0.5.8 |
Date: | 2017-10-06 |
License: | GPL-2 |
The package provides tools for the meta-analysis of diagnostic accuracy data. For this the number true positives (TP), false negatives (FN), true negatives (TN) and false postives (FP) for each study must be known. The package can fit the bivariate model of Reitsma et al (2005), a bivariate random effects model. This model has been shown by Harbord et al. (2007) to be equivalent to the HSROC proposed by Rutter & Gatsonis (2001). We approach this model as a linear mixed effects model to avoid the complications of non-linear mixed effects model. The main function to fit such model is reitsma
and standard methods are available for the output of this function.
Author and Maintainer: Philipp Doebler
Rutter, C., & Gatsonis, C. (2001). “A hierarchical regression approach to meta-analysis of diagnostic test accuracy evaluations.” Statistics in Medicine, 20, 2865–2884.
Reitsma, J., Glas, A., Rutjes, A., Scholten, R., Bossuyt, P., & Zwinderman, A. (2005). “Bivariate analysis of sensitivity and specificity produces informative summary measures in diagnostic reviews.” Journal of Clinical Epidemiology, 58, 982–990.
Harbord, R., Deeks, J., Egger, M., Whiting, P., & Sterne, J. (2007). “A unification of models for meta-analysis of diagnostic accuracy studies.” Biostatistics, 8, 239–251.
Calculates the area under the curve given a function or a fitted model.
## Default S3 method: AUC(x, fpr = 1:99/100, ...) ## S3 method for class 'phm' AUC(x, level = 0.95, ...) ## S3 method for class 'reitsma' AUC(x, fpr = 1:99/100, sroc.type = "ruttergatsonis", ...)
## Default S3 method: AUC(x, fpr = 1:99/100, ...) ## S3 method for class 'phm' AUC(x, level = 0.95, ...) ## S3 method for class 'reitsma' AUC(x, fpr = 1:99/100, sroc.type = "ruttergatsonis", ...)
x |
a function with range and domain in ROC space (default method) or an object of class |
fpr |
numeric vector, points on which the (S)ROC curve is evaluated |
level |
numeric, confidence level for the calculations of confidence intervals. |
sroc.type |
character, which SROC curve should be used to calculate the AUC? Besides the default |
... |
further arguments, currently not used. |
The area under the curve is calculated using the trapezoidal rule. The argument fpr
is the grid on which the (S)ROC curve is evaluated. In many cases the default grid will contain points on which the SROC curve can only be calculated by extrapolation; however if only a subinterval is specified a partial AUC is calculated and the AUC value might differ substantially.
For phm
objects the AUC and its confidence interval is calculated analytically, for reitsma
objects a call to the default method is invoked.
An object of the class AUC
which is really a list with component AUC
and an optional component ci
, which is currently only available from the AUC
method for phm
ojects.
Philipp Doebler <[email protected]>
data(AuditC) AUC(phm(AuditC))
data(AuditC) AUC(phm(AuditC))
.
Using Fisher's z-transformation (atanh
) and the classic normal approximation confidence intervals for a vector of correlations is computed.
CIrho(rho, N, level = 0.95)
CIrho(rho, N, level = 0.95)
rho |
numeric vector, must be between -1 and 1. |
N |
integer vector, sample sizes. |
level |
numeric, confidence level. |
A matrix with first column rho
and two further columns with the lower and upper bound.
Philipp Doebler <[email protected]>
CIrho(c(0.34,0.19), c(22, 48), level = 0.80)
CIrho(c(0.34,0.19), c(22, 48), level = 0.80)
Given estimates from primary studies and the weights of the single studies calculate Cochran's Q as a measure of heterogeneity.
cochran.Q(x, weights)
cochran.Q(x, weights)
x |
numeric, typically a vector of effect sizes like (log-)OR |
weights |
numeric, see Details |
In fixed effects settings the weights are often inverse proportional to the variances of the primary studies. Cochran's Q is known to have low power to detect heterogeneity.
A named vector of length 3. First element is Q
followed by the p-value
and the degrees of freedom.
Philipp Doebler <[email protected]>
Produces a crosshair plot or adds such a plot to an existing plot.
## Default S3 method: crosshair(x, correction = 0.5, level = 0.95, method = "wilson", xlim = c(0,1), ylim = c(0,1), length = 0.1, pch = 1, add = FALSE, suppress = TRUE, ...)
## Default S3 method: crosshair(x, correction = 0.5, level = 0.95, method = "wilson", xlim = c(0,1), ylim = c(0,1), length = 0.1, pch = 1, add = FALSE, suppress = TRUE, ...)
x |
a data frame with variables including |
correction |
numeric, continuity correction applied to zero cells. |
level |
numeric, confidence level for the calculations of confidence intervals. |
method |
character, method used to calculate the confidence intervals for sensitivities, specificities and false positive rates. One of |
xlim |
part of ROC space to be plotted |
ylim |
part of ROC space to be plotted |
length |
length of "whiskers" of the crosshair. |
pch |
Symbol used to plot point estimates. Use |
add |
logical, should the plot be added to the current plot? |
suppress |
logical, should the warnings produced by the internal call to |
... |
further arguments passed on to |
Crosshair plots go back to Phillips et al. (2010). Note that for fits of the reitsma
function a crosshair method is available to plot pooled estimate, see reitsma-class
.
Besides plotting, the function returns an invisible NULL
.
Philipp Doebler <[email protected]>
Phillips, B., Stewart, L.A., & Sutton, A.J. (2010). “'Cross hairs' plots for diagnostic meta-analysis.” Research Synthesis Methods, 1, 308–315.
data(AuditC) crosshair(AuditC)
data(AuditC) crosshair(AuditC)
Produce a forest plot. Includes graphical summary of results if applied to output of suitable model-fitting function. forest
methods for madad
and madauni
objects are provided.
## S3 method for class 'madad' forest(x, type = "sens", log = FALSE, ...) ## S3 method for class 'madauni' forest(x, log = TRUE, ...) forestmada(x, ci, plotci = TRUE, main = "Forest plot", xlab = NULL, digits = 2L, snames = NULL, subset = NULL, pch = 15, cex = 1, cipoly = NULL, polycol = NA, ...)
## S3 method for class 'madad' forest(x, type = "sens", log = FALSE, ...) ## S3 method for class 'madauni' forest(x, log = TRUE, ...) forestmada(x, ci, plotci = TRUE, main = "Forest plot", xlab = NULL, digits = 2L, snames = NULL, subset = NULL, pch = 15, cex = 1, cipoly = NULL, polycol = NA, ...)
x |
an object for which a |
ci |
numeric matrix, each row corresponds to a confidence interval (the first column being the lower bound and the second the upper). |
plotci |
logical, should the effects sizes and their confidence intervals be added to the plot (as text)? |
main |
character, heading of plot. |
xlab |
label of x-axis. |
digits |
integer, number of digits for axis labels and confidence intervals. |
snames |
character vector, study names. If |
subset |
integer vector, allows to study only a subset of studies in the plot. One can also reorder the studies with the help of this argument. |
pch |
integer, plotting symbol, defaults to a small square. Also see |
cex |
numeric, scaling parameter for study names and confidence intervals. |
cipoly |
logical vector, which confidence interval should be plotted as a polygon? Useful for summary estimates. If set to |
polycol |
color of the polygon(s), passed on to |
type |
character, one of |
log |
logical, should the log-transformed values be plotted? |
... |
arguments to be passed on to |
Produces a forest plot to graphically assess heterogeneity. Note that forestmada
is called internally, so that the ...
argument can be used to pass on arguments to this function; see the examples.
Returns and invisible NULL
.
Philipp Doebler <[email protected]>
data(AuditC) ## Forest plot of log DOR with random effects summary estimate forest(madauni(AuditC)) ## Forest plot of negative likelihood ratio (no log transformation) ## color of the polygon: light grey ## draw the individual estimate as filled circles forest(madauni(AuditC, type = "negLR"), log = FALSE, polycol = "lightgrey", pch = 19) ## Paired forest plot of sensitivities and specificities ## Might look ugly if device region is too small old.par <- par() AuditC.d <- madad(AuditC) plot.new() par(fig = c(0, 0.5, 0, 1), new = TRUE) forest(AuditC.d, type = "sens", xlab = "Sensitivity") par(fig = c(0.5, 1, 0, 1), new = TRUE) forest(AuditC.d, type = "spec", xlab = "Specificity") par(old.par) ## Including study names ## Using Letters as dummies forest(AuditC.d, type = "spec", xlab = "Specificity", snames = LETTERS[1:14])
data(AuditC) ## Forest plot of log DOR with random effects summary estimate forest(madauni(AuditC)) ## Forest plot of negative likelihood ratio (no log transformation) ## color of the polygon: light grey ## draw the individual estimate as filled circles forest(madauni(AuditC, type = "negLR"), log = FALSE, polycol = "lightgrey", pch = 19) ## Paired forest plot of sensitivities and specificities ## Might look ugly if device region is too small old.par <- par() AuditC.d <- madad(AuditC) plot.new() par(fig = c(0, 0.5, 0, 1), new = TRUE) forest(AuditC.d, type = "sens", xlab = "Sensitivity") par(fig = c(0.5, 1, 0, 1), new = TRUE) forest(AuditC.d, type = "spec", xlab = "Specificity") par(old.par) ## Including study names ## Using Letters as dummies forest(AuditC.d, type = "spec", xlab = "Specificity", snames = LETTERS[1:14])
Six data frames with diagnostic accuracy data from binary test outcomes.
data("AuditC") data("Dementia") data("IAQ") data("SAQ") data("skin_tests") data("smoking")
data("AuditC") data("Dementia") data("IAQ") data("SAQ") data("skin_tests") data("smoking")
Six data frames with frequencies of true positives, false negatives, false positives and true negatives. The data set smoking
combines the IAQ
and SAQ
data sets and these are the only ones with variables in addition to the frequencies.
numeric. number of true positives
numeric. number of false negatives
numeric. number of false positives
numeric. number of true negatives
factor. self-administered (SAQ) or interviewer-administered questionnaire (IAQ)
factor. Author(s) of review and year
numeric. ID variable for study
integer. ID variable for (dependent) 2x2-tables from the same study
factor. general (G) or student (S) population
The AuditC
data is from Kriston et al. (2008). The Dementia
from Mitchell (2009) and the SAQ
and IAQ
data are subsets from the data in Patrick et al. (1994), while smoking
is the complete data. The skin_tests
data is part of the data from Sousa-Pinto et al. (2021) and concerns the accuracy of penicillin allergy skin tests.
Kriston, L., H\"oelzel, L., Weiser, A., Berner, M., & Haerter, M. (2008).“ Meta-analysis: Are 3 Questions Enough to Detect Unhealthy Alcohol Use?” Annals of Internal Medicine, 149, 879–888.
Mitchell, A. (2009). “A meta-analysis of the accuracy of the mini-mental state examination in the detection of dementia and mild cognitive impairment.” Journal of Psychiatric Research, 43, 411–431.
Patrick, D., Cheadle, A., Thompson, D., Diehr, P., Koepsell, T., & Kinne, S. (1994). “The validity of self-reported smoking: a review and meta-analysis.” American Journal of Public Health, 84, 1086–1093.
Sousa-Pinto, B., Tarrio, I., Blumenthal, K.G., Araujo, L., Azevedo, L.F., Delgado, L. & Fonseca, J.A. (2021). “Accuracy of penicillin allergy diagnostic tests: A systematic review and meta-analysis.” Journal of Allergy and Clinical Immunology, 147, 296–308.
Given the frequencies of true positives, false negative, false positives and true negatives from primary diagnostic studies madad
calculates various summary statistics. Apart from sensitivities, specificities and false positive rates the function also calculates the diagnostic odds ratio (DOR) and the positve and negative likelihood ratios, together with their respective confidence intervals. Also two hypothesis tests are calculated: one testing the equality of the sensitivities and the same for the false positive rates.
madad(x = NULL, TP, FN, FP, TN, level = 0.95, correction = 0.5, correction.control = "all", method = "wilson", yates = TRUE, suppress = TRUE, ...) ## S3 method for class 'madad' print(x, digits = 3, ...)
madad(x = NULL, TP, FN, FP, TN, level = 0.95, correction = 0.5, correction.control = "all", method = "wilson", yates = TRUE, suppress = TRUE, ...) ## S3 method for class 'madad' print(x, digits = 3, ...)
x |
any object that can be converted to a data frame with integer variables |
TP |
vector of integers, ingored if |
FN |
vector of integers, ingored if |
FP |
vector of integers, ingored if |
TN |
vector of integers, ingored if |
correction |
numeric, continuity correction applied to zero cells. |
correction.control |
character, if set to |
level |
numeric, confidence level for the calculations of confidence intervals. |
method |
character, method used to calculate the confidence intervals for sensitivities, specificities and false positive rates. One of |
yates |
logical, should a Yates correction be used for testing the equality of sensitivities and specificities? |
digits |
integer, to what decimal place is the output to be rounded? |
suppress |
logical, suppress the warning that is generated by |
... |
further arguments to be passed on the other funtions (currently none). |
All calculations are performed using the continuity corrected cell counts, so if there are zero cells, the sensitivities and specificities not equal to 1. This can be avoided by setting correction.control
to "none"
.
The test for the equality of sensitivities and its counterpart for the specificities is based on prop.test
. This function will occasionally output warnings.
An object of class madad
which is essentially a list with the following components:
sens |
A list of two components, |
spec |
A list of two components, |
fpr |
A list of two components, |
sens.htest |
An object of class |
spec.htest |
An object of class |
DOR |
A list of two components, |
posLR |
A list of two components, |
negLR |
A list of two components, |
cor_sens_fpr |
numeric, the correlation of the sensitivities and false-positive rates. |
level |
numeric |
method |
character |
names |
character vector, if the main argument of |
nobs |
integer, number of primary studies. |
data |
data frame, with columns |
data.name |
character, name of the main argument. |
correction |
numeric |
correction.control |
character |
Philipp Doebler <[email protected]>
data(AuditC) AuditC.d <- madad(AuditC) print(AuditC.d, digits = 2) #round everything to 2 digits
data(AuditC) AuditC.d <- madad(AuditC) print(AuditC.d, digits = 2) #round everything to 2 digits
The classic strategy to meta-analysis of diagnostic accuracy data is to pool a univariate measure of accuracy like the diagnostic odds ratio, the positive likelihood ratio or the negative likelihood ratio. For fixed effect estimation a Mantel-Haenszel estimator is implemented and for random effect estimation a DerSimonian-Laird estimator is available.
madauni(x, type = "DOR", method = "DSL", suppress = TRUE, ...)
madauni(x, type = "DOR", method = "DSL", suppress = TRUE, ...)
x |
any object that can be converted to a data frame with integer variables |
type |
character, what effect size should be pooled? Either |
method |
character, method of estimation. Either |
suppress |
logical, should warnings produced by the internal call to |
... |
further arguments to be passed on to |
First note that the function madad
is used to calculate effect measures. You can pass on arguments to this function via the ...
arguments. This is especially useful for the correction.control
and correction
arguments, see the example.
The Mantel-Haenszel method performs fixed effect estimation of the effect sizes. For the DOR the variance of this estimator is calculated according to Robins et al. (1986) and for the likelihood ratios the variance is based on Greenland et al. (1985).
The DerSimonian-Laird method performs a random effects meta-analysis. For this , the variance of the log-transformed effect size (DOR, positive or negative likelihood ratio) is calculated by the DerSimonian and Laird (1986) method. The confidence interval for
is derived by inverting the Q-Test of Viechtbauer (2007).
Zwindermann and Bossuyt (2008) argue, that univariate summary points like the likelihood ratios should be derived from the bivariate model of Reitsma et al (2005). The function SummaryPts
, using output of reitsma
supports this approach.
An object of class madauni
, for which some standard methods are available, see madauni-class
Performing univariate meta-analysis of diagnostic studies can not be recommended anymore now that bivariate methods are available, at least not if a reasonable number of primary studies is availabel. The package mada
provides this functionality for exploratory purposes and for meta-analysis of a small number of studies. The prefered way is to use reitsma
in conjunction with SummaryPts
.
The default value of correction.control
used madad
(and hence in the calculation of the effect sizes for madauni
) is "all"
, i.e. the continuity correction is added to all studies if any has a zero cell. This is a different default value than the metafor
package uses. Set correction.control
to "single"
to arrive at the same values.
Philipp Doebler <[email protected]>
DerSimonian, R. and Laird, N. (1986). “Meta-analysis in clinical trials.” Controlled clinical trials, 7, 177–188.
Greenland, S. and Robins, J.M. (1985). “Estimation of a Common Effect Parameter from Sparse Follow-Up Data.” Biometrics, 41, 55–68.
Reitsma, J., Glas, A., Rutjes, A., Scholten, R., Bossuyt, P., & Zwinderman, A. (2005). “Bivariate analysis of sensitivity and specificity produces informative summary measures in diagnostic reviews.” Journal of Clinical Epidemiology, 58, 982–990.
Robins, J. and Greenland, S. and Breslow, N.E. (1986). “A general estimator for the variance of the Mantel-Haenszel odds ratio.” American Journal of Epidemiology, 124, 719–723.
Viechtbauer, W. (2007). “Confidence intervals for the amount of heterogeneity in meta-analysis.” Statistics in Medicine, 26, 37–52.
Zwinderman, A., & Bossuyt, P. (2008). “We should not pool diagnostic likelihood ratios in systematic reviews.”Statistics in Medicine, 27, 687–697.
madauni-class
, reitsma
, SummaryPts
data(AuditC) ## First example: DOR meta-analysis AuditC.uni <- madauni(AuditC) summary(AuditC.uni) ## Second example: sensitivity analysis ## Do continuity corrections make a difference? AuditC.uni_low <- madauni(AuditC, correction = 0.1) AuditC.uni_single <- madauni(AuditC, correction.control = "single") ## default is "all" confint(AuditC.uni) confint(AuditC.uni_low) confint(AuditC.uni_single)
data(AuditC) ## First example: DOR meta-analysis AuditC.uni <- madauni(AuditC) summary(AuditC.uni) ## Second example: sensitivity analysis ## Do continuity corrections make a difference? AuditC.uni_low <- madauni(AuditC, correction = 0.1) AuditC.uni_single <- madauni(AuditC, correction.control = "single") ## default is "all" confint(AuditC.uni) confint(AuditC.uni_low) confint(AuditC.uni_single)
madauni
.
Various methods for the output of the function madauni
. Also the default method confint
works for this class.
## S3 method for class 'madauni' print(x, digits = 3, ...) ## S3 method for class 'madauni' vcov(object, ...) ## S3 method for class 'madauni' summary(object, level = 0.95, ...) ## S3 method for class 'summary.madauni' print(x, digits = 3, ...)
## S3 method for class 'madauni' print(x, digits = 3, ...) ## S3 method for class 'madauni' vcov(object, ...) ## S3 method for class 'madauni' summary(object, level = 0.95, ...) ## S3 method for class 'summary.madauni' print(x, digits = 3, ...)
x |
An object of class |
object |
An object of class |
level |
numeric, the confidence level for the confidence intervals in the summary. |
digits |
integer indicating the number of decimal places to round to. |
... |
arguments to be passed to methods |
summary.madauni
returns a list of class summary.madauni
which is printed with print.summary.madauni
.
Philipp Doebler <[email protected]>
The approach to SROC curve modeling is described in the paper of Moses, Shapiro and Littenberg (1993). It is considered outdated and is included in mada
so that users can reproduce older results and compare different SROC curves.
mslSROC(data = NULL, subset=NULL, TP="TP", FN="FN", FP="FP", TN="TN", fpr = NULL, extrapolate = FALSE, correction = 0.5, correction.control = "all", add = FALSE, lty = 1, lwd = 1, col = 1, ...)
mslSROC(data = NULL, subset=NULL, TP="TP", FN="FN", FP="FP", TN="TN", fpr = NULL, extrapolate = FALSE, correction = 0.5, correction.control = "all", add = FALSE, lty = 1, lwd = 1, col = 1, ...)
data |
any object that can be converted to a data frame with integer variables for observed frequencies of true positives, false negatives, false positives and true negatives. The names of the variables are provided by the arguments |
TP |
character or integer: name for vector of integers that is a variable of |
FN |
character or integer: name for vector of integers that is a variable of |
FP |
character or integer: name for vector of integers that is a variable of |
TN |
character or integer: name for vector of integers that is a variable of |
subset |
the rows of |
fpr |
Points between 0 and 1 on which to draw the SROC curve. Should be tightly spaced. If set to |
extrapolate |
logical, should the SROC curve be extrapolated beyond the region where false positive rates are observed? |
correction |
numeric, continuity correction applied if zero cells |
correction.control |
character, if set to |
add |
logical, should the SROC curve be added to an existing plot? |
lty |
line type, see |
lwd |
line width, see |
col |
color of SROC, see |
... |
arguments to be passed on to plotting functions. |
Details are found in the paper of Moses, Shapiro and Littenberg (1993).
Besides plotting the SROC, an invisible
list is returned which contains the parameters of the SROC.
Philipp Doebler <[email protected]>
Moses L.E., Shapiro D., & Littenberg B. (1993) “Combining independent studies of a diagnostic test into a summary ROC curve: data-analytic approaches and some additional considerations.” Statistics in Medicine, 12, 1293–1316.
reitsma-class
, talpha
, SummaryPts
## First Example data(Dementia) ROCellipse(Dementia) mslSROC(Dementia, add = TRUE) # Add the MSL-SROC to this plot ## Second Example # Make a fancy plot and look at the coefficients msl_Dementia <- mslSROC(Dementia, col = 3, lwd = 3, lty = 3) msl_Dementia$A2 # intercept on logit SROC space msl_Dementia$B2 # slope on logit SROC space
## First Example data(Dementia) ROCellipse(Dementia) mslSROC(Dementia, add = TRUE) # Add the MSL-SROC to this plot ## Second Example # Make a fancy plot and look at the coefficients msl_Dementia <- mslSROC(Dementia, col = 3, lwd = 3, lty = 3) msl_Dementia$A2 # intercept on logit SROC space msl_Dementia$B2 # slope on logit SROC space
The function fits the model of Holling et al. (2012). The adjusted profile maximum likelihood estimator (APMLE) is implemented for homogeneity and heterogeneity of primary studies.
phm(data, ...) ## Default S3 method: phm(data = NULL, subset=NULL, TP="TP", FN="FN", FP="FP", TN="TN", correction = 0.5, correction.control = "all", hetero = TRUE, estimator = "APMLE", l = 100, ...)
phm(data, ...) ## Default S3 method: phm(data = NULL, subset=NULL, TP="TP", FN="FN", FP="FP", TN="TN", correction = 0.5, correction.control = "all", hetero = TRUE, estimator = "APMLE", l = 100, ...)
data |
any object that can be converted to a data frame with integer variables |
subset |
the rows of |
TP |
character or integer: name for vector of integers that is a variable of |
FN |
character or integer: name for vector of integers that is a variable of |
FP |
character or integer: name for vector of integers that is a variable of |
TN |
character or integer: name for vector of integers that is a variable of |
correction |
numeric, continuity correction applied if zero cells |
correction.control |
character, if set to |
hetero |
logical, should heterogeneity of studies be assumed? Will fit model for homogeneity otherwise. |
estimator |
character, determines estimator used. Currently only |
l |
interger, number of iterations for fixed point algorithm |
... |
arguments passed on to other functions (currently not used) |
The model of Holling et al. (2012) assumes that the relationship between false positive rates and and sensitivities
can be described by
where is the diagnostic accuracy parameter. If homogeneity of the studies can be assumed,
is estimated as a fixed effect. Under heterogeneity a random effect with variance
describes the variation of the diagnostic accuracy parameter in the population of studies. Since the error of each observed
depends only on the sample size and
the model has only one parameter in the case of homogeneity and two parameters under heterogeneity, making it suitable for diagnostic meta-analysis with low sample size. Estimation proceeds by a fixed point algorithm derived from the adjusted profile likelihood. More details on the computational approach can be found in Holling et al. (2012).
An object of the class phm
for which many standard methods are available. See phm-class
for details.
Philipp Doebler <[email protected]>, Walailuck Boehning (original implementation of estimation algorithm)
Holling, H., Boehning W., Boehning, D. (2012) “Meta-Analysis of Diagnostic Studies based upon SROC-Curves: a Mixed Model Approach using a Proportional Hazards Model.” Statistical Modelling, 12, 347???-375.
data(AuditC) (fit <- phm(AuditC)) summary(fit) plot(fit)
data(AuditC) (fit <- phm(AuditC)) summary(fit) plot(fit)
phm
objects.
Objects of the class phm
are output by the function with the same name. Apart from standard methods the function sroc
provides SROC curves and confidence bands for model fits.
## S3 method for class 'phm' print(x, ...) ## S3 method for class 'phm' summary(object, level = 0.95, ...) ## S3 method for class 'phm' sroc(fit, fpr = 1:99/100, ...) ## S3 method for class 'phm' plot(x, extrapolate = FALSE, confband = TRUE, level = 0.95, ylim = c(0,1), xlim = c(0,1), sroclty = 1, sroclwd = 1, confbandlty = 2, confbandlwd = 0.5, ...)
## S3 method for class 'phm' print(x, ...) ## S3 method for class 'phm' summary(object, level = 0.95, ...) ## S3 method for class 'phm' sroc(fit, fpr = 1:99/100, ...) ## S3 method for class 'phm' plot(x, extrapolate = FALSE, confband = TRUE, level = 0.95, ylim = c(0,1), xlim = c(0,1), sroclty = 1, sroclwd = 1, confbandlty = 2, confbandlwd = 0.5, ...)
x |
a |
object |
a |
fit |
a |
level |
numeric, the confidence level for calculations of confidence intervals ( |
fpr |
numeric, the false positives rates for which to calculate the predicted sensitivities. |
extrapolate |
logical, should the sroc curve be plotted beyond the observed false positive rates? |
confband |
logical, should confidence bands be plotted? |
ylim |
numeric of length 2, which section of the sensitivities to plot? |
xlim |
numeric of length 2, which section of the false positive rates to plot? |
sroclty |
integer, line type of the SROC curve |
sroclwd |
integer, line width of the SROC curve |
confbandlty |
integer, line type of the SROC curve's confidence band |
confbandlwd |
integer, line width of the SROC curve's confidence band |
... |
arguments to be passed on to other functions |
The SROC curve is derived from the model formula. The confidence bands are calculated from the bounds of the confidence interval for the diagnostic accuracy parameter . The parameter and its confidence interval are then also used to calculate the AUC and partial AUC using the formulae
and
where is the lower bound of the observed false positive rates and
the upper.
The sroc
function returns a matrix ready for plotting. Each row corresponds to one point in ROC space.
Philipp Doebler <[email protected]>
Holling, H., Boehning D., Boehning, W. (2012) “Meta-Analysis of Diagnostic Studies based upon SROC-Curves: a Mixed Model Approach using a Proportional Hazards Model.” Statistical Modelling, 12, 347–375.
# load data data(AuditC) # fit model fit <- phm(AuditC) #calculate a SROC curve, but do not plot it sroc.AuditC <- sroc(fit) # plot the SROC curve in ROC space as a line plot(sroc.AuditC, type = "l") # Fancy version using plot plot(fit)
# load data data(AuditC) # fit model fit <- phm(AuditC) #calculate a SROC curve, but do not plot it sroc.AuditC <- sroc(fit) # plot the SROC curve in ROC space as a line plot(sroc.AuditC, type = "l") # Fancy version using plot plot(fit)
Estimation of projected summary predictive values based on a prevalence probability distribution and pooled (meta-analytical) sensitivities and specificities. Probability distributions for negative and positive predictive values are obtained.
predv_d(x,prop_m,prop_sd,zb=TRUE,n_iter=100000,...)
predv_d(x,prop_m,prop_sd,zb=TRUE,n_iter=100000,...)
x |
dataset containing data from the primary studies. It must correspond to any object that can be converted to a data frame with integer variables |
prop_m |
mean value of the prevalence probability distribution. It must be stated as a proportion (i.e., as a numeric value between 0 and 1). If both prop_m and prop_sd are not defined, a probability distribution for the prevalence based on available primary studies' data will be computed (see details). |
prop_sd |
standard-deviation of the prevalence probability distribution. It must be stated as a value between 0 and 1. If both prop_m and prop_sd are not defined, a probability distribution for the prevalence based on available primary studies' data will be computed (see details). |
zb |
logical. If TRUE (default), the Zwindermann & Bossuyt approach will be used to generate samples for observed sensitivities and false positive rate (as in SummaryPts function). If FALSE, beta distributions will be obtained based on 95 percent confidence interval bounds of pooled sensitivities and specificities (while this latter approach may not take fully into account the correlation between sensitivity and false positive rate, it may lead to faster results). |
n_iter |
number of simulations being performed. Default value is 100,000. |
... |
further arguments to be passed on to |
The predv_d function projects summary predictive values distributions from (i) a prevalence probability distribution, and (ii) pooled sensitivities and specificities obtained in the context of diagnostic test accuracy meta-analysis using a bivariate random-effects model. The bivariate random-effects model is equivalent to the hierarchical summary receiver operating characteristic model. By default, a sampling-based approach is used to generate samples for observed sensitivities and false positive rates. From these samples, and based on the prevalences probability distribution being considered, distributions of predictive values will be obtained based on the application of the Bayes theorem. The prevalence probability distribution can be obtained by providing a value for the mean (argument prop_m) and a value for the standard-deviation (argument prop_sd). If both prop_m and prop_sd are missing/not defined, a probability distribution for the prevalence based on available primary studies' data will be computed. That is, random-effects meta-analysis of log-transformed prevalences will be performed (using metafor) using data from included primary studies; the pooled results will then be used to obtain the probability distribution for prevalences. This may be a suboptimal option (as there may be considerable heterogeneity, diagnostic accuracy primary studies may not be the best ones to estimate the prevalence of a disease/condition...) compared to user-defined arguments, particularly if good prevalence studies exist.
Guided example
The dataset skin_tests contains results from a set of primary studies assessing the accuracy of skin tests for diagnosing penicillin allergy (they are part of the data analysed by Sousa-Pinto et al [2021]). This dataset contains four columns, displaying - for each primary study - the number of true positives (TP), true negatives (TN), false positives (FP) and false negatives (FN). Let us now assume that the prevalence of penicillin allergy can be modeled by a probability distribution, having a mean of 0.05 (5 percent) and a standard-deviation of 0.015. Distributions of negative and positive predictive values can be estimated by:
predv_d(x=skin_tests,prop_m=0.05,prop_sd=0.015,zb=TRUE)
For negative predictive values, we obtain a probability distribution defined by a mean value of 0.96 and a standard-deviation of 0.01 (95 percent credible interval=0.93-0.98). For positive predictive values, we obtain a probability distribution defined by a mean value of 0.31 and a standard-deviation of 0.12 (95 percent credible interval=0.11-0.57). Values may differ slightly from the ones just described, as we are dealing with simulation results.
If we had no information on how the prevalence of penicillin allergy could be modeled by a probability distribution, we would opt for solely relying on data provided by included primary studies:
predv_d(x=skin_tests)
In that case, in addition to the results, we would get an warning message stating that considerable heterogeneity was found when doing meta-analysis of prevalences. Results should be carefully interpreted.
An object of class predv_d
, for which some standard methods are available, see predv_d-class
. Some of the obtainable components include:
SummaryData |
A dataframe displaying the mean, standard-deviation (SD) and percentiles (p) for the probability distribution of the summary negative predictive values ("NPV" row) and positive predictive values ("PPV" row). |
results_pred |
A dataframe displaying the results for all samples. |
Bernardo Sousa-Pinto <[email protected]>
Reitsma, J., Glas, A., Rutjes, A., Scholten, R., Bossuyt, P., & Zwinderman, A. (2005). “Bivariate analysis of sensitivity and specificity produces informative summary measures in diagnostic reviews.” Journal of Clinical Epidemiology, 58, 982–990.
Zwinderman, A., & Bossuyt, P. (2008). “We should not pool diagnostic likelihood ratios in systematic reviews.” Statistics in Medicine, 27, 687–697.
Sousa-Pinto, B., Tarrio, I., Blumenthal, K.G., Azevedo, L.F., Delgado, L., & Fonseca, J.A. (2021). “Accuracy of penicillin allergy diagnostic tests: A systematic review and meta-analysis.” Journal of Allergy and Clinical Immunology, 147, 296–308.
Joseph L, Belisle P. (2017). “Computing Beta distribution parameters.” [Internet] Accessible at: https://www.medicine.mcgill.ca/epidemiology/Joseph/PBelisle/BetaParmsFromQuantiles.html
data(skin_tests) pred_skin_tests <- predv_d(x=skin_tests,prop_m=0.05,prop_sd=0.015,zb=TRUE) pred_skin_tests
data(skin_tests) pred_skin_tests <- predv_d(x=skin_tests,prop_m=0.05,prop_sd=0.015,zb=TRUE) pred_skin_tests
predv_d
.
Various methods for the output of the function predv_d
.
## S3 method for class 'predv_d' print(x, xlim_npv=c(0,1),xlim_ppv=c(0,1), ...) ## S3 method for class 'predv_d' summary(object, xlim_npv=c(0,1),xlim_ppv=c(0,1), ...)
## S3 method for class 'predv_d' print(x, xlim_npv=c(0,1),xlim_ppv=c(0,1), ...) ## S3 method for class 'predv_d' summary(object, xlim_npv=c(0,1),xlim_ppv=c(0,1), ...)
x |
An object of class |
object |
An object of class |
xlim_npv |
limits of the x-axis for the plot on projected negative predictive values. Default is c(0,1). |
xlim_ppv |
limits of the x-axis for the plot on projected positive predictive values. Default is c(0,1). |
... |
arguments to be passed to methods |
summary.predv_d
returns a list of class summary.predv_d
.
Bernardo Sousa-Pinto <[email protected]>
Estimation of projected summary predictive values based on a prevalence range and pooled (meta-analytical) sensitivities and specificities. A probability distribution for the negative and positive predictive values are obtained for each prevalence value within a predetermined range.
predv_r(x,prop_min,prop_max,zb=TRUE,n_iter=100000,...)
predv_r(x,prop_min,prop_max,zb=TRUE,n_iter=100000,...)
x |
dataset containing data from the primary studies. It must correspond to any object that can be converted to a data frame with integer variables |
prop_min |
minimum prevalence value being considered. It must be stated as a proportion (i.e., as a numeric value between 0 and 1). If both prop_min and prop_max are not defined, a prevalence range based on available primary studies' data will be computed (see details). |
zb |
logical. If TRUE (default), the Zwindermann & Bossuyt approach will be used to generate samples for observed sensitivities and false positive rate (as in SummaryPts function). If FALSE, beta distributions will be obtained based on 95 percent confidence interval bounds of pooled sensitivities and specificities (while this latter approach may not take fully into account the correlation between sensitivity and false positive rate, it may lead to faster results). |
prop_max |
maximum prevalence value being considered. It must be stated as a proportion (i.e., as a numeric value between 0 and 1). If both prop_min and prop_max are not defined, a prevalence range based on available primary studies' data will be computed (see details). |
n_iter |
number of simulations being performed. Default value is 100,000. |
... |
further arguments to be passed on to |
The predv_r function projects summary predictive values from (i) a prevalence range, and (ii) pooled sensitivities and specificities obtained in the context of diagnostic test accuracy meta-analysis using a bivariate random-effects model. The bivariate random-effects model is equivalent to the hierarchical summary receiver operating characteristic model. By default, a sampling-based approach is used to generate samples for observed sensitivities and false positive rate. From these samples, and for each prevalence value within the range being considered, distributions of predictive values will be obtained based on the application of the Bayes theorem. The prevalence range can be user-defined, by providing a value for the minimum (argument prop_min) and a value for the maximum value of that range (argument prop_max). If both prop_min and prop_max are missing/not defined, a prevalence range based on available primary studies' data will be computed. That is, the lowest and highest frequency of patients with disease/condition across included primary studies will be considered. This may be a suboptimal option compared to user-defined arguments, particularly if good prevalence studies are available.
Guided example
The dataset skin_tests contains results from a set of primary studies assessing the accuracy of skin tests for diagnosing penicillin allergy (they are part of the data analysed by Sousa-Pinto et al [2021]). This dataset contains four columns, displaying - for each primary study - the number of true positives (TP), true negatives (TN), false positives (FP) and false negatives (FN). Let us assume that the prevalence of penicillin allergy ranges between 0.01 and 0.10 (1 and 10 percent). Pooled negative and positive predictive values can be estimated by:
predv_r(x=skin_tests,prop_min=0.01,prop_max=0.15,zb=TRUE)
The results indicate that the point estimates for the negative predictive value range between 0.88 (prevalence=0.15) and 0.99 (prevalence=0.01). For the positive predictive value, point estimates range between 0.09 (prevalence=0.01) and 0.59 (prevalence=0.15), although uncertainty is particularly high for the latter estimate (95 percent credible interval=0.36-0.80). Values may differ slightly from the ones just described, as we are dealing with simulation results.
If we had no information on how the prevalence range of penicillin allergy, we would opt for solely relying on data provided by included primary studies:
pred_skin_tests1 <- predv_r(x=skin_tests)
An object of class predv_r
, for which some standard methods are available, see predv_r-class
. Some of the obtainable components include:
NPV |
A dataframe displaying the mean, standard-deviation (SD) and percentiles (p) for the probability distribution of negative predictive values for each prevalence value within the defined range. |
PPV |
A dataframe displaying the mean, standard-deviation (SD) and percentiles (p) for the probability distribution of positive predictive values for each prevalence value within the defined range. |
Bernardo Sousa-Pinto <[email protected]>
Reitsma, J., Glas, A., Rutjes, A., Scholten, R., Bossuyt, P., & Zwinderman, A. (2005). “Bivariate analysis of sensitivity and specificity produces informative summary measures in diagnostic reviews.” Journal of Clinical Epidemiology, 58, 982–990.
Zwinderman, A., & Bossuyt, P. (2008). “We should not pool diagnostic likelihood ratios in systematic reviews.” Statistics in Medicine, 27, 687–697.
Sousa-Pinto, B., Tarrio, I., Blumenthal, K.G., Azevedo, L.F., Delgado, L., & Fonseca, J.A. (2021). “Accuracy of penicillin allergy diagnostic tests: A systematic review and meta-analysis.” Journal of Allergy and Clinical Immunology, 147, 296–308.
data(skin_tests) pred_skin_tests <- predv_r(x=skin_tests,prop_min=0.01,prop_max=0.15,zb=TRUE) pred_skin_tests
data(skin_tests) pred_skin_tests <- predv_r(x=skin_tests,prop_min=0.01,prop_max=0.15,zb=TRUE) pred_skin_tests
predv_r
.
Various methods for the output of the function predv_r
.
## S3 method for class 'predv_r' print(x, ylim_npv=c(0,1),ylim_ppv=c(0,1), ...) ## S3 method for class 'predv_r' summary(object, ylim_npv=c(0,1),ylim_ppv=c(0,1), ...)
## S3 method for class 'predv_r' print(x, ylim_npv=c(0,1),ylim_ppv=c(0,1), ...) ## S3 method for class 'predv_r' summary(object, ylim_npv=c(0,1),ylim_ppv=c(0,1), ...)
x |
An object of class |
object |
An object of class |
ylim_npv |
limits of the y-axis for the plot on projected negative predictive values. Default is c(0,1). |
ylim_ppv |
limits of the y-axis for the plot on projected positive predictive values. Default is c(0,1). |
... |
arguments to be passed to methods |
summary.predv_r
returns a list of class summary.predv_r
.
Bernardo Sousa-Pinto <[email protected]>
The function fits the bivariate model of Reitsma et al. (2005) that Harbord et al. (2007) have shown to be equivalent to the HSROC of Rutter&Gatsonis (2001). We specify the model as a linear mixed model with known variances of the random effects, similar to the computational approach by Reitsma et al. (2005). Variance components are estimated by restricted maximum likelihood (REML) as a default but ML estimation is available as well. In addition meta-regression is possible and the use of other transformations than the logit, using the approach of Doebler et al. (2012).
reitsma(data, ...) ## Default S3 method: reitsma(data = NULL, subset=NULL, formula = NULL, TP="TP", FN="FN", FP="FP", TN="TN", alphasens = 1, alphafpr = 1, correction = 0.5, correction.control = "all", method = "reml", control = list(), ...)
reitsma(data, ...) ## Default S3 method: reitsma(data = NULL, subset=NULL, formula = NULL, TP="TP", FN="FN", FP="FP", TN="TN", alphasens = 1, alphafpr = 1, correction = 0.5, correction.control = "all", method = "reml", control = list(), ...)
data |
any object that can be converted to a data frame with integer variables for observed frequencies of true positives, false negatives, false positives and true negatives. The names of the variables are provided by the arguments |
TP |
character or integer: name for vector of integers that is a variable of |
FN |
character or integer: name for vector of integers that is a variable of |
FP |
character or integer: name for vector of integers that is a variable of |
TN |
character or integer: name for vector of integers that is a variable of |
subset |
the rows of |
formula |
Formula for meta-regression using standard |
alphasens |
Transformation parameter for (continuity corrected) sensitivities, see details. If set to 1 (the default) the logit transformation is used. |
alphafpr |
Transformation parameter for (continuity corrected) false positive rates, see details |
correction |
numeric, continuity correction applied if zero cells |
correction.control |
character, if set to |
method |
character, either |
control |
a list of control parameters, see the documentation of |
.
... |
arguments to be passed on to other functions, currently ignored |
In a first step the observed frequencies are continuity corrected if values of 0 or 1 would result for the sensitivity or false positive rate otherwise. Then the sensitivities and false positive rates are transformed using the transformation
Note that for , the default value, the logit transformation results, i.e. the approach of Reitsma et al. (2005). A bivariate random effects model is then fitted to the pairs of transformed sensitivities and false positive rates.
Parameter estimation makes use of the fact that the fixed effect parameters can be profiled in the likelihood. Internally the function mvmeta
is called. Currently only standard errors for the fixed effects are available. Note that when using method = "mm"
or method = "vc"
, no likelihood can be computed and hence no AIC or BIC values.
If you want other summary points like negative or positive likelihood ratios, see SummaryPts
, while for positive or negative predictive values, see predv_r
and predv_d
.
An object of the class reitsma
for which many standard methods are available. See reitsma-class
for details.
Philipp Doebler <[email protected]>
Rutter, C., & Gatsonis, C. (2001). “A hierarchical regression approach to meta-analysis of diagnostic test accuracy evaluations.” Statistics in Medicine, 20, 2865–2884.
Reitsma, J., Glas, A., Rutjes, A., Scholten, R., Bossuyt, P., & Zwinderman, A. (2005). “Bivariate analysis of sensitivity and specificity produces informative summary measures in diagnostic reviews.” Journal of Clinical Epidemiology, 58, 982–990.
Harbord, R., Deeks, J., Egger, M., Whiting, P., & Sterne, J. (2007). “A unification of models for meta-analysis of diagnostic accuracy studies.” Biostatistics, 8, 239–251.
Doebler, P., Holling, H., Boehning, D. (2012) “A Mixed Model Approach to Meta-Analysis of Diagnostic Studies with Binary Test Outcome.” Psychological Methods, to appear
reitsma-class
, talpha
, SummaryPts
data(Dementia) (fit <- reitsma(Dementia)) summary(fit) plot(fit) ## Meta-Regression data(smoking) # contains more than one 2x2-table ## reduce to subset of independent 2x2-tables by using the ## first table from each study only smoking1 <- subset(smoking, smoking$result_id == 1) ## use type of questionnaire as covariate (fit <- reitsma(smoking1, formula = cbind(tsens, tfpr) ~ type)) summary(fit) ## sensitivities significantly lower for SAQ
data(Dementia) (fit <- reitsma(Dementia)) summary(fit) plot(fit) ## Meta-Regression data(smoking) # contains more than one 2x2-table ## reduce to subset of independent 2x2-tables by using the ## first table from each study only smoking1 <- subset(smoking, smoking$result_id == 1) ## use type of questionnaire as covariate (fit <- reitsma(smoking1, formula = cbind(tsens, tfpr) ~ type)) summary(fit) ## sensitivities significantly lower for SAQ
reitsma
objects.
Objects of the class reitsma
are output by the function with the same name. Apart from standard methods the functions sroc
, mcsroc
and ROCellipse
provide SROC curves and confidence regions for fits.
## S3 method for class 'reitsma' print(x, digits = 4, ...) ## S3 method for class 'reitsma' summary(object, level = 0.95, sroc.type = "ruttergatsonis", ...) ## S3 method for class 'reitsma' sroc(fit, fpr = 1:99/100, type = "ruttergatsonis", return_function = FALSE, ...) ## S3 method for class 'reitsma' mcsroc(fit, fpr = 1:99/100, replications = 10000, lambda = 100, ...) ## S3 method for class 'reitsma' ROCellipse(x, level = 0.95, add = FALSE, pch = 1, ...) ## S3 method for class 'reitsma' crosshair(x, level = 0.95, length = 0.1, pch = 1, ...) ## S3 method for class 'reitsma' plot(x, extrapolate = FALSE, plotsumm = TRUE, level = 0.95, ylim = c(0,1), xlim = c(0,1), pch = 1, sroclty = 1, sroclwd = 1, predict = FALSE, predlty = 3, predlwd = 1, type = "ruttergatsonis", ...) ## S3 method for class 'reitsma' anova(object, fit2, ...) ## S3 method for class 'anova.reitsma' print(x, digits = 4, ...)
## S3 method for class 'reitsma' print(x, digits = 4, ...) ## S3 method for class 'reitsma' summary(object, level = 0.95, sroc.type = "ruttergatsonis", ...) ## S3 method for class 'reitsma' sroc(fit, fpr = 1:99/100, type = "ruttergatsonis", return_function = FALSE, ...) ## S3 method for class 'reitsma' mcsroc(fit, fpr = 1:99/100, replications = 10000, lambda = 100, ...) ## S3 method for class 'reitsma' ROCellipse(x, level = 0.95, add = FALSE, pch = 1, ...) ## S3 method for class 'reitsma' crosshair(x, level = 0.95, length = 0.1, pch = 1, ...) ## S3 method for class 'reitsma' plot(x, extrapolate = FALSE, plotsumm = TRUE, level = 0.95, ylim = c(0,1), xlim = c(0,1), pch = 1, sroclty = 1, sroclwd = 1, predict = FALSE, predlty = 3, predlwd = 1, type = "ruttergatsonis", ...) ## S3 method for class 'reitsma' anova(object, fit2, ...) ## S3 method for class 'anova.reitsma' print(x, digits = 4, ...)
x |
a |
object |
a |
fit |
a |
fit2 |
a |
digits |
number of decimal digits to print. |
level |
numeric, the level for calculations of confidence intervals ( |
sroc.type |
character, which SROC curve should be used to calculate the AUC in the summary? Besides the default |
return_function |
logical. Should a function on ROC space be returned or the values at the points given by |
fpr |
numeric, the false positives rates for which to calculate the predicted sensitivities |
replications |
integer, the number of replications for the Monte-Carlo SROC curve |
lambda |
numeric, the parameter lambda of the Monte-Carlo run, see details |
add |
logical, should the confidence region be added to the current plot? If set to |
extrapolate |
logical, should the SROC curve be plotted beyond the observed false positive rates? |
plotsumm |
logical, should the summary pair of sensitivity and false positive rate together with its confidence region be plotted? |
length |
positve numeric, length of the "whiskers" of the crosshairs. |
ylim |
numeric of length 2, which section of the sensitivities to plot? |
xlim |
numeric of length 2, which section of the false positive rates to plot? |
pch |
integer, symbol for the pair of mean sensitivity and false positive rate |
sroclty |
integer, line type of the SROC curve |
sroclwd |
integer, line width of the SROC curve |
predict |
logical, draw prediction region? |
predlty |
integer, line type of prediction region |
predlwd |
integer, line width of prediction region |
type |
character, type of SROC curve to plot. Can be either the generalization of the Rutter & Gatsonis (2001) SROC curve (see below) or the naive curve implied the bivariate model. |
... |
arguments to be passed on to other functions |
The confidence regions of ROCellipse
are first calculated as ellipses on logit-ROC space, so the back-transformed regions that are output are not necessarily ellipses. The Monte-Carlo SROC curves are generated from random samples from the fitted model and a lowess
smooth through them is output. Many computational details are to be found in Doebler et al. (2012).
The summary
function for reitsma
objects also contains the five parameters of the HSROC model by Rutter & Gatsonis (2001) if no regression is performed. These values are calculated by using the formulae from Harbord et al. (2007).
The plot
method for reitsma
objects will plot the generalization of the Rutter-Gatsonis curve.
If you require positive or negative likelihood ratios, you should use SummaryPts
. If you require positive or negative predictive values, see predv_r
and predv_d
.
sroc
returns a matrix ready for plotting. Each row corresponds to one point in ROC space. mcsroc
returns a lowess
smooth. ROCellipse
returns a list, the first element being a matrix of points in ROC space that delimit the confidence region and the second is the point estimate of the pair of sensitivity and false positive rate in ROC space.
Philipp Doebler <[email protected]>
Doebler, P., Holling, H., Boehning, D. (2012) “A Mixed Model Approach to Meta-Analysis of Diagnostic Studies with Binary Test Outcome.” Psychological Methods, to appear
# load data data(Dementia) # fit model fit <- reitsma(Dementia) # calculate a confidence region but do not plot it cr.Dementia <- ROCellipse(fit) #calculate a SROC curve sroc.Dementia <- sroc(fit) # plot the confidence region in ROC space as a line plot(cr.Dementia$ROCellipse, type = "l", xlim = c(0,1), ylim = c(0,1)) # add the point estimate of the mean points(cr.Dementia$fprsens) # add the SROC curve lines(sroc.Dementia)
# load data data(Dementia) # fit model fit <- reitsma(Dementia) # calculate a confidence region but do not plot it cr.Dementia <- ROCellipse(fit) #calculate a SROC curve sroc.Dementia <- sroc(fit) # plot the confidence region in ROC space as a line plot(cr.Dementia$ROCellipse, type = "l", xlim = c(0,1), ylim = c(0,1)) # add the point estimate of the mean points(cr.Dementia$fprsens) # add the SROC curve lines(sroc.Dementia)
Plot individual confidence regions for the estimate from each primary study on ROC space or add such regions to an existing plot.
## Default S3 method: ROCellipse(x, correction = 0.5, level = 0.95, xlim = c(0, 1), ylim = c(0, 1), method = "wilson", pch = 1, add = FALSE, corr = 0, suppress = TRUE, ellipsecol = "grey", ...)
## Default S3 method: ROCellipse(x, correction = 0.5, level = 0.95, xlim = c(0, 1), ylim = c(0, 1), method = "wilson", pch = 1, add = FALSE, corr = 0, suppress = TRUE, ellipsecol = "grey", ...)
x |
a data frame with variables including |
correction |
numeric, continuity correction applied to zero cells. |
level |
numeric, confidence level for the calculations of confidence intervals. |
xlim |
numeric of length 2, which portion of ROC space should be plotted? All reasonable values should be within (0,1). |
ylim |
numeric of length 2, which portion of ROC space should be plotted? All reasonable values should be within (0,1). |
method |
character, method used to calculate the confidence intervals for sensitivities, specificities and false positive rates. One of |
pch |
Symbol used to plot point estimates. Use |
add |
logical, should the plot be added to the current plot? |
corr |
numeric or character, the correlation assumed in the calculation of the confidence ellipsoids on logit-ROC space. If set to |
suppress |
logical, should the warnings produced by the internal call to |
ellipsecol |
The color used for plotting the ellipses. |
... |
further arguments passed on to |
The confindence regions are ellipses on logit-ROC space, hence the name of the function. The standard deviations underlying confidence intervals for the sensitivities and false positive rates are used to determine the scale of the ellipses on logit-ROC space. These ellipses get backtransformed to ROC space and plotted. As a default no correlation is assumed on logit-ROC space.
The objects of class reitsma
have their own ROCellipse
method to add a confidence region for the pooled estimate, see reitsma-class
.
Besides plotting an invisble NULL
is returned.
Philipp Doebler <[email protected]>
data(AuditC) ROCellipse(AuditC)
data(AuditC) ROCellipse(AuditC)
Assuming that a weighted Youden index is maximized in all primary studies, the Ruecker-Schumacher approach estimates individual ROC curves and then averages them.
rsSROC(data = NULL, subset=NULL, TP="TP", FN="FN", FP="FP", TN="TN", lambda = "from_bivariate", fpr = NULL, extrapolate = FALSE, plotstudies = FALSE, correction = 0.5, correction.control = "all", add = FALSE, lty = 1, lwd = 1, col = 1, ...)
rsSROC(data = NULL, subset=NULL, TP="TP", FN="FN", FP="FP", TN="TN", lambda = "from_bivariate", fpr = NULL, extrapolate = FALSE, plotstudies = FALSE, correction = 0.5, correction.control = "all", add = FALSE, lty = 1, lwd = 1, col = 1, ...)
data |
any object that can be converted to a data frame with integer variables for observed frequencies of true positives, false negatives, false positives and true negatives. The names of the variables are provided by the arguments |
TP |
character or integer: name for vector of integers that is a variable of |
FN |
character or integer: name for vector of integers that is a variable of |
FP |
character or integer: name for vector of integers that is a variable of |
TN |
character or integer: name for vector of integers that is a variable of |
subset |
the rows of |
lambda |
numeric or |
fpr |
Points between 0 and 1 on which to draw the SROC curve. Should be tightly spaced. If set to |
extrapolate |
logical, should the SROC curve be extrapolated beyond the region where false positive rates are observed? |
plotstudies |
logical, should the ROC curves for the individual studies be added to the plot? The plot will become crowded if set to |
correction |
numeric, continuity correction applied if zero cells |
correction.control |
character, if set to |
add |
logical, should the SROC curve be added to an existing plot? |
lty |
line type, see |
lwd |
line width, see |
col |
color of SROC, see |
... |
arguments to be passed on to plotting functions. |
Details are found in the paper of Ruecker and Schumacher (2010).
Besides plotting the SROC, an invisible
list is returned which contains the parameters of the SROC.
Philipp Doebler <[email protected]> Original code kindly supplied by G. Ruecker.
Ruecker G., & Schumacher M. (2010) “Summary ROC curve based on a weighted Youden index for selecting an optimal cutpoint in meta-analysis of diagnostic accuracy.” Statistics in Medicine, 29, 3069–3078.
reitsma-class
, talpha
, SummaryPts
## First Example data(Dementia) ROCellipse(Dementia) rsSROC(Dementia, add = TRUE) # Add the RS-SROC to this plot ## Second Example # Make a crowded plot and look at the coefficients rs_Dementia <- rsSROC(Dementia, col = 3, lwd = 3, lty = 3, plotstudies = TRUE) rs_Dementia$lambda rs_Dementia$aa # intercepts of primary studies on logit ROC space rs_Dementia$bb # slopes
## First Example data(Dementia) ROCellipse(Dementia) rsSROC(Dementia, add = TRUE) # Add the RS-SROC to this plot ## Second Example # Make a crowded plot and look at the coefficients rs_Dementia <- rsSROC(Dementia, col = 3, lwd = 3, lty = 3, plotstudies = TRUE) rs_Dementia$lambda rs_Dementia$aa # intercepts of primary studies on logit ROC space rs_Dementia$bb # slopes
Calculate basic measures of diagnostic accuracy for a number of studies.
sens(x) spec(x) fpr(x)
sens(x) spec(x) fpr(x)
x |
a data frame with variables including |
These functions are the basic building blocks of many procedures to assess diagnostic accuracy. For a decent summary of set of primary studies it is better to use madad
, for graphical summaries crosshair
and ROCellipse
are available.
A numeric vector.
Philipp Doebler <[email protected]>
madad
, crosshair
, link{ROC.ellipse}
data(AuditC) plot(fpr(AuditC), sens(AuditC), main = "AUDIT-C data on ROC space", ylab = "Sensitivity", xlab = "False Positive Rate")
data(AuditC) plot(fpr(AuditC), sens(AuditC), main = "AUDIT-C data on ROC space", ylab = "Sensitivity", xlab = "False Positive Rate")
Zwindermann & Bossuyt (2008) argue that likelihood ratios should not be pooled by univariate meta-analysis. They propose a sampling based approach that uses the parameters of a fit to the bivariate model (implemented in reitsma
) to generate samples for observed sensitivities and false positive rates. From these samples the quantities of interest (and their confidence intervals) are estimated.
SummaryPts(object, ...) ## Default S3 method: SummaryPts(object, mu,Sigma,alphasens = 1, alphafpr = 1, n.iter = 10^6, FUN, ...) ## S3 method for class 'reitsma' SummaryPts(object, n.iter = 10^6, FUN = NULL, ...) ## S3 method for class 'SummaryPts' print(x, ...) ## S3 method for class 'SummaryPts' summary(object, level = 0.95, digits = 3, ...)
SummaryPts(object, ...) ## Default S3 method: SummaryPts(object, mu,Sigma,alphasens = 1, alphafpr = 1, n.iter = 10^6, FUN, ...) ## S3 method for class 'reitsma' SummaryPts(object, n.iter = 10^6, FUN = NULL, ...) ## S3 method for class 'SummaryPts' print(x, ...) ## S3 method for class 'SummaryPts' summary(object, level = 0.95, digits = 3, ...)
object |
an object for which a method exists |
x |
An object of class |
mu |
numeric of length 2, expected to be the mean parameter of a bivariate model |
Sigma |
2x2 variance covariance matrix, expected to be the matrix representing the standard error of |
alphasens |
numeric, alpha parameter for the sensitivities. Amounts to logit transformation if set to 1 (the default). See |
alphafpr |
numeric, alpha parameter for the false positive rates. Amounts to logit transformation if set to 1 (the default). See |
n.iter |
number of samples |
FUN |
A list of functions with 2 arguments ( |
level |
numeric, confidence level for confidence intervals |
digits |
number of significant digits to display |
... |
arguments to be passed on to other functions, currently ignored |
Samples are generated from a bivariate normal using rmvnorm
. Note that the FUN argument
An object of the class SummaryPts
for which print
and summary
methods are available.
Philipp Doebler <[email protected]>
Reitsma, J., Glas, A., Rutjes, A., Scholten, R., Bossuyt, P., & Zwinderman, A. (2005). “Bivariate analysis of sensitivity and specificity produces informative summary measures in diagnostic reviews.” Journal of Clinical Epidemiology, 58, 982–990.
Zwinderman, A., & Bossuyt, P. (2008). “We should not pool diagnostic likelihood ratios in systematic reviews.”Statistics in Medicine, 27, 687–697.
data(Dementia) (fit <- reitsma(Dementia)) mcmc_sum <- SummaryPts(fit, n.iter = 10^3) ## n.iter should be larger in applications! mcmc_sum #just the means summary(mcmc_sum) # 95% CIs by default summary(mcmc_sum, level = 0.80, digits = 5) ## more digits, smaller CIs ## Supplying other functions # Example 1: theta parameter of proportional hazards model # see "phm" in mada's documentation for details on theta theta <- function(sens,fpr){log(sens) / log(fpr)} theta_sum <- SummaryPts(fit, FUN = list(theta = theta), n.iter = 10^3) ## n.iter should be larger in applications! summary(theta_sum) # compare with phm: summary(phm(Dementia)) # the two estimators almost agree in this example # Example 2: Youden index Youden <- function(sens, fpr){sens - fpr} Youden_sum <- SummaryPts(fit, FUN = list(Youden = Youden), , n.iter = 10^3) ## n.iter should be larger in applications! summary(Youden_sum)
data(Dementia) (fit <- reitsma(Dementia)) mcmc_sum <- SummaryPts(fit, n.iter = 10^3) ## n.iter should be larger in applications! mcmc_sum #just the means summary(mcmc_sum) # 95% CIs by default summary(mcmc_sum, level = 0.80, digits = 5) ## more digits, smaller CIs ## Supplying other functions # Example 1: theta parameter of proportional hazards model # see "phm" in mada's documentation for details on theta theta <- function(sens,fpr){log(sens) / log(fpr)} theta_sum <- SummaryPts(fit, FUN = list(theta = theta), n.iter = 10^3) ## n.iter should be larger in applications! summary(theta_sum) # compare with phm: summary(phm(Dementia)) # the two estimators almost agree in this example # Example 2: Youden index Youden <- function(sens, fpr){sens - fpr} Youden_sum <- SummaryPts(fit, FUN = list(Youden = Youden), , n.iter = 10^3) ## n.iter should be larger in applications! summary(Youden_sum)
transformation as a link function for binary GLMs.
A parametric link function, i.e. a family of link functions intended for binary data.
talpha(alpha, verbose = FALSE, splineinv = TRUE, eps = 2 * .Machine$double.eps, maxit = 100)
talpha(alpha, verbose = FALSE, splineinv = TRUE, eps = 2 * .Machine$double.eps, maxit = 100)
alpha |
numeric, must be larger than 0 and smaller than 2. |
verbose |
logical, warn if truncation occurs when link function or inverse are used. |
splineinv |
logical, use spline interpolation for calculation of inverse link? |
eps |
if splineinv is |
maxit |
maximum number of iterations for Newton-Raphson. Ignored if splineinv is |
An object of class "link-glm"
, see family
and family
. Intended for use with glm
.
Philipp Doebler <[email protected]>
canonical <- binomial(link = talpha(1)) # logit-link talpha_fam <- function(alpha)binomial(link = talpha(alpha)) # talpha family ## A call to glm might look like this: glm(formula, family = talpha_fam(1.5))
canonical <- binomial(link = talpha(1)) # logit-link talpha_fam <- function(alpha)binomial(link = talpha(alpha)) # talpha family ## A call to glm might look like this: glm(formula, family = talpha_fam(1.5))