View source: R/plot.rma.uni.selmodel.r
plot.rma.uni.selmodel | R Documentation |
Function to plot objects of class "plot.rma.uni.selmodel"
. \loadmathjax
## S3 method for class 'rma.uni.selmodel'
plot(x, xlim, ylim, n=1000, prec="max", scale=FALSE,
ci=FALSE, reps=1000, shade=TRUE, rug=TRUE, add=FALSE,
lty=c("solid","dotted"), lwd=c(2,1), ...)
x |
an object of class |
xlim |
x-axis limits. Essentially the range of p-values for which the selection function should be drawn. If unspecified, the function sets the limits automatically. |
ylim |
y-axis limits. If unspecified, the function sets the limits automatically. |
n |
numeric value to specify for how many p-values within the x-axis limits the function value should be computed (the default is 1000). |
prec |
either a character string (with options |
scale |
logical to specify whether the function values should be rescaled to a 0 to 1 range (the default is |
ci |
logical to specify whether a confidence interval should be drawn around the selection function (the default is |
reps |
numeric value to specify the number of bootstrap samples to draw for generating the confidence interval bounds (the default is 1000). |
shade |
logical to indicate whether the confidence interval region should be shaded (the default is |
rug |
logical to specify whether the observed p-values should be added as tick marks on the x-axis (the default is |
add |
logical to specify whether the function should be added to an existing plot (the default is |
lty |
the line types for the selection function and the confidence interval bounds. |
lwd |
the line widths for the selection function and the confidence interval bounds. |
... |
other arguments. |
The function can be used to draw the estimated selection function based on objects of class "plot.rma.uni.selmodel"
.
When the selection function incorporates a measure of precision (which, strictly speaking, is really a measure of imprecision), one can specify for which level of precision the selection function should be drawn. When prec="max"
, then the function is drawn for the least precise study (maximum imprecision), when prec="min"
, then the function is drawn for the most precise study (minimum imprecision), while prec="mean"
and prec="median"
will show the function for the mean and median level of imprecision, respectively. Alternatively, one can specify a numeric value for argument prec
to specify the precision value (where prec="max"
corresponds to prec=1
and higher levels of precision to prec
values below 1).
When ci=TRUE
(or equivalently, ci="boot"
), a confidence interval is drawn around the selection function. The bounds of this interval are generated using parametric bootstrapping, with argument reps
controlling the number of bootstrap samples to draw for generating the confidence interval bounds. When both n
and reps
are large, constructing the confidence interval can take some time.
For models where the selection function involves a single \mjseqn\delta parameter, one can also set ci="wald"
, in which case the confidence interval will be constructed based on the Wald-type CI of the \mjseqn\delta parameter (doing so is much quicker than using parametric bootstrapping). This option is also available for step function models (even if they involve multiple \mjseqn\delta parameters).
Wolfgang Viechtbauer wvb@metafor-project.org https://www.metafor-project.org
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. https://doi.org/10.18637/jss.v036.i03
selmodel
for the function to fit models for which the estimated selection function can be drawn.
### copy data into 'dat' and examine data
dat <- dat.hackshaw1998
### fit random-effects model using the log odds ratios
res <- rma(yi, vi, data=dat, method="ML")
res
### fit step selection model
sel1 <- selmodel(res, type="stepfun", steps=c(0.05, 0.10, 0.50, 1.00))
### plot selection function
plot(sel1, scale=TRUE)
### fit negative exponential selection model
sel2 <- selmodel(res, type="negexp")
### add selection function to the existing plot
plot(sel2, add=TRUE, col="blue")
### plot selection function with CI
plot(sel1, ci="wald")
### plot selection function with CI
plot(sel2, ci="wald")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.