Добавил:
Sekretar
kiopkiopkiop18@yandex.ru
t.me/Prokururor I Вовсе не секретарь, но почту проверяю
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_2767_Библиотеки_им_академика_М_И_Перельмана
.pdf
10 Undertaking meta- analysis
https://t.me/medicina_free
Box 10.7.b Arguments of the function diagmeta()
function (TP, FP, TN, FN, cutoff, studlab, data = NULL,
distr = "logistic",
model = "CICS", equalvar = FALSE, lambda = 0.5, log.
cutoff = FALSE,
method.weights = "invvar", level = 0.95, incr = 0.5,
n.iter.max = 1000, tol = 1e- 08, silent = TRUE, ...)
The first six arguments are mandatory; TP, FP, TN, and FN represent the 2×2data,
cutoff represents the threshold and studlab the study identifier. The argument
data refers to the data set used, distr is one of “logistic” (default) or “normal”,
model the model used for estimation (see later), and with equalvar it can be specified
whether the variances of the marker in both groups are assumed to be equal or not
(default is FALSE). The argument log.
cutoff is to specify whether the marker values
are to be log- transformed. Here is a typical call for diagmeta():
diag1 <- diagmeta(tpos, fpos, tneg, fneg, cutpoint,
studlab = paste(author, year, group),
data = Schneider2017,
model = "CICS", log.cutoff = TRUE)
The first five arguments TP, FP, TN, FN, cutoff correspond to the columns
tpos, fpos, tneg, fneg, cutpoint for the FeNO dataset. Note that here these arguments
are not explicitly written, thus they are interpreted in the fixed order given by args().
It would also be possible to call them in a different order, but then they must be explicitly specified, for example
diag1 <- diagmeta(TP = tpos, FP = fpos, TN = tneg, FN = fneg,
cutoff = cutpoint, …)
(call truncated). The study label (argument studlab) is a combination of author, year
and (sub)group (the latter is empty except for one study). Alternatively, the variable
study_id could be chosen as the study label, as it uniquely characterizes the study or
substudy. The dataset is Schneider 2017, the model is “CICS”, which stands for “Common
Intercept and Common Slope” and refers to the random part of the model. For more
details of the modelling, see the original publication (Steinhauser 2016). The argument
log.cutoff is set to TRUE, which means that the thresholds are log- transformed
(because FeNO is known to have a skewed distribution). The call of diagmeta()creates
an R object named diag1. Writing print(diag1) gives the output in Box10.7.c.
The output in Box10.7.c presents the number of studies (29), the number of data lines
(150), the number of unique reported thresholds (53), details of the model and a summary of the results, consisting of the ‘optimal’ threshold (28.179)– for this example
defined as the threshold that maximizes the Youden index– and sensitivity and specificity
at this threshold with 95% CIs. Here, sensitivity and specificity are equally weighted.
Alternatively, different weights can be specified. If, for example, one is more concerned
about false negatives than false positives, one might like to give more weight to
308

10.7 Meta- analysis withmultiple thresholds per study
https://t.me/medicina_free
Box 10.7.c Output of the R object diag1 after calling diagmeta()
*** Results of multiple cutoffs model ***
Total number of studies: 29
Total number of cutoffs: 150
Number of different cutoffs: 53
Model: CICS
Type of distribution: logistic
Cutoffs log transformed: TRUE
The optimal cutoff value: 28.179
Sensitivity and specificity at optimal cutoff:
Sens: 0.5841 [0.4853; 0.6766]
Spec: 0.8086 [0.7348; 0.8656]
Area under the curve (AUC):
0.7342 [0.6667; 0.7938] - confidence region for sensitivity
given specificity
0.7340 [0.6888; 0.7745] - confidence region for specificity
given sensitivity
Box 10.7.d Using function diagstats() to obtain sensitivity and specificity at specified
thresholds
diagstats (diag1, c(25, 30))
cutoff Sens seSens lower.Sens upper.Sens Spec seSpec lower.Spec upper.Spec
25 0.6320 0.1995 0.5374 0.7174 0.7550 0.2110 0.6708 0.8233
30 0.5583 0.2056 0.4580 0.6541 0.8329 0.2177 0.7649 0.8842
sensitivity (say, 80%) by setting the weighting parameter lambda of function diagmeta to a different value, say lambda = 0.8.
A more extensive output (not shown) can be obtained using summary(diag1),
which lists all thresholds and their frequency, all studies with their number of thresholds, information about the distribution of thresholds, and the summary output from
the lmer() function from the lme4 package, which is run in the background. Use function diagstats() to obtain sensitivity and specificity at the chosen thresholds of 25
and 30 shown in Box10.7.d. For further options of diagstats(), see the help file.
Finally, to create graphical output, use plot(diag1), which provides the four
plots (panels a to d) in Figure10.7.a. Studies on the plots are characterized by different
colours. Panel (a) shows ‘survival curves’ that give the estimated probability for individuals with (solid line, TP) or without (dashed line, FP) the target condition (here asthma)
having a positive result, given the threshold. Each circle corresponds to either a truepositive rate (solid circles) or a false positive rate (hollow circles) within a study. Thus,
this plot provides the true- positive rate and the false positive rate of the test at each
309

10 Undertaking meta- analysis
(a)
Prob(positive test)
1–Specificity
(b)
(c)
Sensitivity
1–Specificity
https://t.me/medicina_free
threshold. The vertical line indicates the point where the curves have maximal distance
apart (28.179). Panel (b) shows the Youden index (the difference between both curves)
as a function of the varying threshold, its maximum (0.393, assumed in 28.179) indicated by the vertical line. Panel (c) shows the study- specific ROC curves and panel
(d) shows the model- based SROC curve based on the full data.
Figure10.7.a was also obtained using the plot.diagmeta function as follows:
plot(diag1, which = "SROC", mark.optcut = TRUE,
ciSens = TRUE, ciSpec = TRUE, shading = "hatch",
ellipse = TRUE)
0.8
0.6
0.4
0.2
0.0
0.8
0.6
0.4
0.2
Survival curves
1. 0
5
1. 0
10 20
FeNO [ppm]
ROC curves
50 10 0
1. 0
0.8
0.6
0.4
(Weighted) Yo uden index
0.2
0.0
51020
(d)
1. 0
0.8
0.6
Sensitivity
0.4
0.2
Youden index
50 10 0
FeNO [ppm]
SROC curve
0.0
0.0 0.2 0.4 0.6
Figure10.7.a Graphical output from diagmeta for meta- analysis of multiple thresholds using FeNO
data. (a) Survival plot of positive rates for individuals with and without asthma (solid circles/ hollow
circles), varying with the threshold; (b) Youden index, varying with the threshold; (c) study- specific ROC
curves; (d) model- based SROC curve. Points or lines of the same colour belong to the same study.
310
0.8 1.0
0.0
0.0 0.2 0.4 0.6
0.8 1.0

10.7 Meta- analysis withmultiple thresholds per study
Sensitivity
Specificity
https://t.me/medicina_free
1. 0
0.8
0.6
0.4
0.2
0.0
0.0 0.2 0.4 0.6 0.8 1. 0
Figure10.7.b SROC curve and summary point for the threshold that maximizes the Youden index
with 95% confidence regions
The generic plot function can be applied to objects of a large number of classes. Here,
using function diagmeta(), an R object diag1 of class "diagmeta" was created.
When the plot function is applied to diag1, R recognizes that this is a diagmeta object
and calls plot.diagmeta. Figure10.7.b shows the model- based SROC curve with two
95% confidence regions (vertical hatching corresponds to pointwise confidence intervals
for sensitivity, given specificity; horizontal hatching corresponds to pointwise confidence
intervals for specificity, given sensitivity). The cross represents the summary point that
corresponds to the threshold that maximizes the Youden index, and the summary point
is surrounded by its 95% confidence region. For a full description of possible features,
see help(plot.diagmeta).
10.7.2 Meta- analysis ofmultiple thresholds withrjags
An alternative model, fitted using Bayesian statistical software, was described by Jones
(2019). WinBUGS code to fit the model can be found in the article’s appendix. This section shows how to fit the model using rjags, with application to the FeNO data introduced in Section10.7.1. In contrast to the two- stage model described in Section10.7.1,
which requires normal approximations to the likelihood, this model is fitted in a single
stage and models the observed count data directly using multinomial likelihoods. In
fitting the model, these multinomial distributions are re- parameterized as conditional
binomial distributions for computational convenience.
It is assumed that higher values of the numerical test result are associated with
increased likelihood of having the target condition, such that test results lying above
a threshold are considered positive and those below are considered negative. The
311

10 Undertaking meta- analysis
https://t.me/medicina_free
populations without and with the target condition are indexed by j=1, 2, respectively.
The Jones model is based on the assumption that some transformation, g(), of the continuous test results in population j of study i has a logistic distribution, with mean μij
and scale parameter σij. The transformation g() can be pre- specified: for example, as the
identity function or (if the continuous test results are known to be right skewed) the log
transformation. This corresponds to assumptions of underlying logistic or log- logistic
distributions, respectively. A much more flexible but more computationally intensive
option is to assume only that g() is in the set of Box- Cox transformations, defined by a
transformation parameter λ that is estimated alongside the other model parameters.
This extended version of the model allows for a wide range of possible distributions for
the underlying continuous test results.
The probability of a positive test result at threshold C
denoted by pf
, i.e. FPR (j=1) and TPR (j=2). It follows from the earlier distributional
ijt
in population j of study i is
it
assumption that
gC
logitpf
ij it
ijt
(10.9)
ij
The study- specific location and scale parameters are modelled as random effects,
assumed to be normally distributed across studies, the latter on the log scale (which
ensures that fitted scale parameters are always positive, as they must be by definition). Across studies, μij has mean mμj and standard deviation τμj, while log(σij) has
mean mσj and standard deviation τσj. Several options for the correlation structure
between these four sets of random effects are described in Jones (2019). Prior distributions are required for the hyperparameters: mμj, mσj, τμj, τσj(j=1, 2) and any correlation
parameters.
Box10.7.e shows JAGS model code for the version of the model with g() set to log()
and with a structured covariance matrix of the form described in Schneider (2017). This
choice of g() may be a reasonable approximation for many positive- valued test results,
which are often right skewed. JAGS code for the extended version of the model, with g()
not pre- specified, is provided in Appendix 18 of the online supplementary material (10.
S1 Code for undertaking meta- analysis).
In the model code, x
population j, at threshold Cit. In other words, x
x
denotes numbers of true positives. Binomial likelihoods are assumed for these, simi-
i2t
is used to denote the number of positive test results in study i,
ijt
denotes numbers of false positives and
i1t
lar to Section10.3.2. For t>1, each binomial likelihood is conditional on the number of
positive results at the preceding (next lowest) threshold, x
. This conditional formula-
ijt−1
tion is equivalent to fitting multinomial likelihoods to full contingency tables of test
results.
Note that if there are zero positive test results at threshold C
=0), then there are, by definition, zero positives at threshold Cit in that population.
t−1
in population j (i.e. x
i, t−1
This is the case, for example, in the Woo 2012 study in the FeNO dataset, where there are
zero false positive results at the 13th, 14th and 15th thresholds (i.e.x
i, 1, 13
=x
i, 1, 14
=x
i, 1, 15
=0).
If fitting the model in WinBUGS, we need to first remove the last two, uninformative, data
points, because WinBUGS will not accept binomial observations with a denominator of
zero (see Jones 2019). This is not necessary with JAGS, however.
ij,
312

10.7 Meta- analysis withmultiple thresholds per study
https://t.me/medicina_free
Box 10.7.e Specification of the Jones multiple thresholds model in rjags
model{
#=== LIKELIHOOD ===#
for(i in 1:I){
for(j in 1:2){
for(t in 1:T[i]){
x[i,j,t] ~ dbin(p[i,j,t], n[i,j,t])
}
# DEFINE CONDITIONAL BINOMIAL ORDER PARAMETERS
n[i,j,1] <-
for(t in 2:T[i]){
n[i,j,t] <-
}
# DEFINE CONDITIONAL BINOMIAL PROBABILITIES
# IN TERMS OF FPR AND TPR
p[i,j,1] <- pr[i,j,1]
for(t in 2:T[i]){
p[i,j,t] <- pr[i,j,t] / pr[i,j,t- 1]
}
# === MODEL FOR STUDY- LEVEL LOGIT(FPR) AND LOGIT(TPR) === #
for(t in 1:T[i]){
d[i,j,t] <- (mu[i,j] - log(C[i,t]) ) / s[i,j]
pr[i,j,t] <- ilogit(d[i,j,t])
}
}
# === 4 SETS OF RANDOM EFFECTS ACROSS STUDIES === #
# COVARIANCE STRUCTURE AS DESCRIBED IN JONES 2019
mu[i,1] ~ dnorm(m_mu[1], prec_mu[1])
mu[i,2] ~ dnorm(cond_mean_mu[i], cond_prec_mu)
cond_mean_mu[i] <mu[1])
for(j in 1:2){
cond_mean_s[i,j] <- m_sigma[j] + (rho_mu_sigma
logs[i,j] ~ dnorm(cond_mean_s[i,j], cond_prec_s[j])
s[i,j] <- exp(logs[i,j])
}
}
*(mu[i,1] - m_mu[1])
sigma[j]/tau_mu[j])
N[i,j]
x[i,j,t- 1]
m_mu[2] + (rho_mu
*(mu[i,j] - m_mu[j])
*tau_mu[2]/tau_
*tau_
313

10 Undertaking meta- analysis
https://t.me/medicina_free
# DEFINE PRECISION PARAMETERS FOR CONDITIONAL NORMAL DISTRIBUTIONS
cond_var_mu <-
cond_prec_mu <-
(1- pow(rho_mu,2))
1/cond_var_mu
*pow(tau_mu[2], 2)
for(j in 1:2){
cond_var_s[j]<- (1- pow(rho_mu_sigma,2))
cond_prec_s[j] <-
1/cond_var_s[j]
*pow(tau_sigma[j], 2)
}
#=== HYPER PRIOR DISTRIBUTIONS ===#
for(j in 1:2){
# MEAN LOCATION PARAMETERS OF UNDERLYING LOGISTIC DISTRIBUTIONS
m_mu[j] ~ dnorm(0, 0.001)
# MEAN LOG(SCALE) PARAMETERS OF UNDERLYING LOGISTIC DISTRIBUTIONS
m_sigma[j] ~ dnorm(0, 0.001)
# BETWEEN-
STUDY STANDARD DEVIATION OF LOCATION PARAMETERS
tau_mu[j] ~ dunif(0,5)
# BETWEEN-
STUDY STANDARD DEVIATION OF LOG(SCALE) PARAMETERS
tau_sigma[j] ~ dunif(0,5)
prec_mu[j] <- pow(tau_mu[j], - 2)
prec_sigma[j] <- pow(tau_sigma[j], - 2)
}
# BETWEEN- STUDY CORRELATIONS
rho_mu ~ dunif(- 1,1)
rho_mu_sigma ~ dunif(- 1,1)
}
In Box10.7.e, we assume vague Normal prior distributions for mμj, mσj and Uniform
priors for the standard deviation parameters τ
prior distributions are often used for standard deviations of random effects, and sensitivity analyses may be run varying these.
To fit the model, the following data are required to pass to JAGS:
●
I: Number of studies.
●
N: I by 2 dimensional matrix, with elements Nij denoting the number of individuals in
population j=1, 2 of study i.
●
T: I dimensional vector, with elements Ti denoting the number of distinct thresholds
reported in study i.
●
C: I by max(Ti) dimensional matrix, containing the explicit threshold values reported
in each study, C
●
x: An array of dimension I by 2 by max(Ti), containing numbers of individuals testing
. Elements Cit=NA for t>Ti.
it
positive at each threshold: x
lation j at threshold Cit, x
314
, τσj. As noted in Section10.2.4.4, other
μj
= number of individuals testing positive in study i, popu-
ijt
=NA for t>Ti.
ijt

10.7 Meta- analysis withmultiple thresholds per study
0
Probability positive
Threshold (ppm)
ee (FPR)
https://t.me/medicina_free
Code to fit the model to the FeNO data using rjags is provided in Appendix 18 of the
online supplementary material (10.S1 Code for undertaking meta- analysis). As with all
Bayesian modelling, it is crucial that the analyst checks convergence and mixing of the
chains; see Section10.2.4.2 for details. This is particularly important for the extended
(‘ Box- Cox’) version of the model (provided in Appendix 18 of the online supplementary
material (10.S1 Code for undertaking meta- analysis)), for which mixing of the chains
may be poor, requiring long simulation runs for robust parameter estimation.
The main quantities of interest from this model will usually be the ‘summary’ estimates of TPR and FPR (or, equivalently, sensitivity and specificity) across a range of
possible threshold values. These are estimated by evaluating equation10.9 at each
iteration of the MCMC simulation. This can be done by adding additional lines to the
JAGS model code or, alternatively, by post processing of the ‘coda’ (simulated values
from the posterior distributions of each parameter) in R. Post processing of the coda
is more computationally efficient. R code to achieve this is provided in Appendix 18 of
the online supplementary material (10.S1 Code for undertaking meta-
analysis), while
the WinBUGS code provided in Jones (2019) can be adapted to perform the calculations within JAGS if preferred. As with all other parameters, wethen summarize the
chains by the medians (parameter estimates) and 2.5th and 97.5th percentiles (95%
credible intervals). As in the other Bayesian models (e.g. Section10.2.4), it is also
straightforward to obtain predicted distributions for the sensitivity and specificity (in
this case, for any given threshold value) in a new study. SeeJones (2019) for details.
For the FeNO dataset, summary TPR and FPR with 95% credible intervals, across a
range of reported threshold values, are shown in Figure10.7.c, alongside the observed
study- level data. R code to generate this plot is provided in Appendix 18 of the online
supplementary material (10.S1 Code for undertaking meta- analysis).
1.
0.80.60.4
0.20.0
5710 14 20
Figure10.7.c Summary true- positive rate (TPR or sensitivity) and false positive rate (FPR or
1- specificity) across thresholds, with 95% credible intervals, for the FeNO data
30 40 60
Observed diseased (TPR)
Observed disease-fr
Summary TPR
Summary FPR
100
315

10 Undertaking meta- analysis
*
1 c1 * 1 c2 covc max c1, c2 c1 c2
https://t.me/medicina_free
10.8 Meta- analysis withimperfect reference standard: latent
class meta- analysis
This section illustrates one approach for extending the bivariate model to the situation
where the reference standard is not perfect (Xie 2017). The target condition of interest is
assumed to be latent, i.e. it cannot be observed. Therefore, a slightly different notation
is used. The 2×2 table observed in each study included in the meta- analysis is denoted
by (n11, n10, n01, n00), where nij refers to the number of subjects in the cell where the
index test has value i and the reference standard has value j, where i,j have a value of 1
for a positive test result and a value of 0 for a negative test result.
The metameningitis (Kohli 2018) is used as a motivating example. In each study the index test was
Xpert and the reference standard was culture. Both tests have near perfect specificity but
suboptimal sensitivity, therefore the true TB meningitis status of each subject is not known
with certainty. The likelihood function of an individual study is expressed as follows:
(n11,n10,n01,n00) ~ Multinomial((p11,p10,p01,p00), N), where
p11 = prev*(se1*se2 + covs) + (1-prev)*((1-sp1)*(1-sp2) + covc)
p10 = prev*(se1*(1-se2) - covs) + (1-prev)*((1-sp1)*sp2 - covc)
p01 = prev*((1-se1)*se2 - covs) + (1-prev)*(sp1*(1-sp2) - covc)
p00 = prev*((1-se1)*(1-se2) + covs) + (1-prev)*(sp1*sp2 + covc), where
analysis of the accuracy of the GeneXpert (Xpert) test for tuberculosis (TB)
1 s1 * 1 s2 covs max s1, s2 s1 s2
*
(10.10)
where prev denotes the prevalence of the latent target condition, se1 and sp1 denote
the sensitivity and specificity of the index test, se2 and sp2 denote the sensitivity and
specificity of the reference standard, covs is the covariance between the tests among
those who have the target condition, covc is the covariance between the tests among
those who do not have the target condition and N is the total sample size in all four cells.
Notice that the probability of each cell of the 2×2 table is the sum of two parts. The
latent class model assumes that each observed cell can be further split into those that
have the target condition and those that do not have it. The covariance terms adjust
for conditional dependence, i.e. the dependence between the index test and reference
standard conditional on the target condition. In our example, conditional dependence
may arise among patients with the target condition because among individuals with a
low bacterial load, the target condition is more likely to be missed (false negative) by
both Xpert and culture, whereas among individuals with a high bacterial load, the target condition is more likely to be detected by both tests (true positive). Ignoring the
possibility of conditional dependence will lead to biased estimates for test accuracy
and prevalence parameters (Vacek1985, Torrance- Rynard 1997).
10.8.1 Specification ofthe latent class bivariate meta- analysis model inrjags
This section describes how to extend the rjags model for bivariate meta- analysis introduced in Section10.2.4 to include the structure of a latent class analysis (see Appendix
6 of the online supplementary material (10.S1 Code for undertaking meta- analysis),
316

10.8 Meta- analysis withimperfect reference standard: latent class meta- analysis
https://t.me/medicina_free
Section A6.5). The likelihood function is replaced by a multinomial likelihood whose
probabilities are given in equation 10.10. A prior distribution is needed for each
unknown parameter to carry out Bayesian estimation. A hierarchical prior distribution
structure is specified for the sensitivity and specificity of the index test to account for
both between- and within- study variability and the correlation between sensitivity and
sensitivity and specificity of the reference standard. Additionally, prior distributions
must be specified for the prevalence in each study and for the covariance parameters.
10.8.2 Monitoring convergence
When running the jags.model() function in the rjags code, it is possible that a warning
message appears about the adaptation phase being incomplete. This is due to the complexity of the latent class meta- analysis model (this message is unlikely to appear for
the simpler Bayesian models presented earlier where a perfect reference standard was
assumed). After carefully studying convergence, we conclude that this warning has little
to no impact on our results and can be ignored. Monitoring the trace plots and density
plots of the posterior samples is crucial in the case of a latent class meta- analysis model
to determine whether the model has converged. A peculiarity of latent class analysis is
that the model may interchange the labels of ‘target condition positive’ and ‘target condition negative’. This results in different MCMC chains reaching apparently different but
algebraically identical solutions. For example, one chain may reach the solution for
(prev, se1, sp1, se2, sp2), while the other reaches the ‘mirror’ solution (1-prev, 1-se1,
1-sp1, 1-se2, 1-sp2). Consequently, the average results across chains may not be very
meaningful. This problem is magnified in the case of latent class meta- analysis, as it can
happen separately for each study. The plots in Figure10.8.a illustrate the problem using
the example of the posterior distribution of the disease prevalence and specificity of the
Xpert test for the study by Bahr 2015 from the TB meningitis meta- analysis. The individual chains converge to a solution, but the blue chain reaches one solution while the
red chain reaches another. Which of these solutions is correct?
For this particular example, from prior experience it is known that Xpert has very high
specificity and that the solution attained by the red curve (posterior median = 0.99) is
the correct one, while the solution attained by the blue curve (posterior median = 0.15)
is not sensible. This implies that the correct solution for the prevalence is also that
obtained by the red line (posterior median = 0.24) and not the solution obtained by the
blue line (posterior median = 0.88). An appropriate selection of initial values closer to
the solution with the desired labelling will usually avoid the problem. In some cases,
redefining the prior distribution so that its domain only covers plausible values is helpful. In this example, a prior distribution for the logit specificity of Xpert that is truncated
at the lower limit of 0 could be used to ensure that specificity is always above 50%.
Alternatively, an informative prior distribution may be used.
10.8.3 Summary statistics and summary ROC plot
The results of summary statistics for the bivariate latent class meta- analysis model are
compared here to those obtained from the Bayesian estimation of the standard bivariate meta- analysis model for the same data (Box10.8.a). Figure10.8.b compares the
SROC plots obtained from the two methods.
317
Соседние файлы в папке Библиотека им академика М.И. Перельмана
