Dynamically Generated Analysis Reports for 'rma.uni' Objects
The function dynamically generates analysis reports for objects of class "rma.uni"
.
reporter(x, ...) ## S3 method for class 'rma.uni' reporter(x, dir, filename, format="html_document", open=TRUE, digits, forest, funnel, footnotes=FALSE, verbose=TRUE, ...)
x |
an object of class |
dir |
optional character string specifying the directory for creating the report (by default, |
filename |
optional character string specifying the filename (without file extension) for the report (by default, the function sets a filename automatically). |
format |
output format for the report (either |
open |
logical indicating whether the report should be opened after it has been generated (default is |
digits |
integer specifying the number of decimal places to which the printed results should be rounded (if unspecified, the default is to take the value from the object). |
forest |
optional character string with arguments to be added to the call to |
funnel |
optional character string with arguments to be added to the call to |
footnotes |
logical indicating whether additional explanatory footnotes should be added to the report (default is |
verbose |
logical indicating whether information on the progress of the report generation should be provided (default is |
... |
other arguments. |
The function dynamically generates an analysis report based on the model object. The report includes information about the model that was fitted, the distribution of the observed outcomes, the estimate of the average outcome based on the fitted model, tests and statistics that are informative about potential (residual) heterogeneity in the outcomes, checks for outliers and/or influential studies, and tests for funnel plot asymmetry. A forest plot and a funnel plot are also provided.
The function generates either a html, pdf, or docx file and returns (invisibly) the path to the generated document.
Since the report is created based on an R markdown document that is generated by the function, the rmarkdown
package (https://cran.r-project.org/package=rmarkdown) and pandoc
(http://pandoc.org) must be installed.
To render the report into a pdf document (i.e., using format="pdf_document"
) requires a LaTeX installation. If LaTeX is not already installed, you could try using the tinytex package (https://yihui.name/tinytex/) to install a lightweight LaTeX distribution based on TeX Live.
Once the report is generated, the function tries to open the output file (either a .html, .pdf, or .docx file) with an appropriate application (if open=TRUE
). This will only work when an appropriate application for the file type is installed and associated with the extension.
If filename
is unspecified, the default is to use report
, followed by an underscore (i.e., _
) and the name of the object passed to the function. Both the R markdown file (with extension .rmd) and the actual report (with extension .html, .pdf, or .docx) are named accordingly. To generate the report, the model object is also saved to a file (with the same filename as above, but with extension .rdata). Also, files references.bib
and apa.csl
are copied to the same directory (these files are needed to generate the references in APA format).
Since the report is put together based on predefined text blocks, the writing is not very elegant. Also, using personal pronouns (‘I’ or ‘we’) does not make sense for such a report, so a lot of passive voice is used.
The generated report provides an illustration of how the results of the model can be reported, but is not a substitute for a careful examination of the results.
Wolfgang Viechtbauer wvb@metafor-project.org http://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://www.jstatsoft.org/v036/i03.
### copy BCG vaccine data into 'dat' dat <- dat.bcg ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, slab=paste(author, ", ", year, sep="")) ### random-effects model res <- rma(yi, vi, data=dat) ## Not run: ### generate pdf report reporter(res) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.