Function to plot the log-likelihood of a certain parameter corresponding to an outcome or effect size measure given the study data.
llplot(measure="OR", ai, bi, ci, di, n1i, n2i, data, subset, drop00=TRUE,
xvals=1000, xlim, ylim, xlab, ylab, scale=TRUE,
lty, lwd, col, level=99.99, refline=0, …)
a character string indicating for which effect size or outcome measure the log-likelihood should be calculated. See ‘Details’ for possible options and how the data should be specified.
vector to specify the \(2 \times 2\) table frequencies (upper left cell).
vector to specify the \(2 \times 2\) table frequencies (upper right cell).
vector to specify the \(2 \times 2\) table frequencies (lower left cell).
vector to specify the \(2 \times 2\) table frequencies (lower right cell).
vector to specify the group sizes or row totals (first group/row).
vector to specify the group sizes or row totals (second group/row).
optional data frame containing the variables given to the arguments above.
optional vector indicating the subset of studies that should be used. This can be a logical vector or a numeric vector indicating the indices of the studies to include.
logical indicating whether studies with no cases (or only cases) in both groups should be dropped. See ‘Details’.
integer specifying for how many distinct values of the (log) odds ratio the log-likelihood should be evaluated.
x-axis limits. If unspecified, the function tries to set the x-axis limits to some sensible values.
y-axis limits. If unspecified, the function tries to set the y-axis limits to some sensible values.
title for the x-axis. If unspecified, the function tries to set an appropriate axis title.
title for the y-axis. If unspecified, the function tries to set an appropriate axis title.
logical indicating whether the log-likelihood values should be scaled, so that the total area under each curve is (approximately) equal to 1.
the line type (either a single value or a vector of length \(k\)). If unspecified, the function uses solid lines for tables where the MLE of the odds ratio is finite and dashed/dotted lines otherwise.
the line width (either a single value or a vector of length \(k\)). If unspecified, the function sets the widths according to the sampling variances (so that the line is thicker for more precise studies and vice-versa).
the line color (either a single value or a vector of length \(k\)). If unspecified, the function uses various gray shades according to the sampling variances (so that darher shades are used for more precise studies and vice-versa).
numerical value between 0 and 100 specifying the plotting limits for each density line in terms of the confidence interval (the default is 99.99).
value at which a vertical ‘reference’ line should be drawn (the default is 0). The line can be suppressed by setting this argument to NA
.
other arguments.
At the moment, the function only accepts measure="OR"
. For each \(2 \times 2\) table, the function then plots the log-likelihood of the (log) odds ratio based on the non-central hypergeometric distribution. Since studies with no cases (or only cases) in both groups have a flat likelihood and are not informative about the odds ratio, they are dropped by default (i.e., drop00=TRUE
). For studies that have a single zero count, the MLE of the odds ratio is infinite and these likelihoods are indicated by a dashed line.
van Houwelingen, H. C., Zwinderman, K. H., & Stijnen, T. (1993). A bivariate approach to meta-analysis. Statistics in Medicine, 12, 2273--2284.
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1--48. http://www.jstatsoft.org/v36/i03/.
# NOT RUN {
### create plot (Figure 2 in van Houwelingen, Zwinderman, & Stijnen, 1993)
llplot(measure="OR", ai=b.xci, n1i=nci, ci=b.xti, n2i=nti, data=dat.collins1985a,
lwd=1, refline=NA, xlim=c(-4,4), drop00=FALSE)
# }
Run the code above in your browser using DataLab