Learn R Programming

NMADTA (version 0.1.2)

plot.nmadt: Plot method for `nmadt` objects

Description

This method automatically generates diagnostic meta-analysis plots based on the fitted `nmadt` object and the specified plot `type`.

Usage

# S3 method for nmadt
plot(x, type = c("sroc", "density", "forest", "contour"), ...)

Value

Invisibly returns the input `nmadt` object x. The function is primarily called for its side effect of generating plots rather than returning a value.

Arguments

x

An object of class `nmadt`, typically produced by one of the model-fitting functions:

  • nmadt.hierarchical() — hierarchical model under MAR assumption;

  • nmadt.hsroc() — HSROC model under MAR assumption;

  • nmadt.hierarchical.MNAR() — hierarchical model allowing for MNAR (missing not at random) mechanism;

  • nmadt.hsroc.MNAR() — HSROC model allowing for MNAR mechanism.

These functions all return an object of class `nmadt` suitable for plotting.

type

Character string specifying the type of plot to generate. One of "sroc", "density", "forest", or "contour". Defaults to "sroc" if not specified.

...

Additional arguments passed to the underlying plotting functions (e.g., graphical parameters such as cex.axis, cex.lab, etc.).

Details

The available plot types are:

"sroc" (default)

Summary Receiver Operating Characteristic (SROC) curve. Visualizes the trade-off between sensitivity and specificity across studies, along with the hierarchical model fit.

"density"

Posterior density plots for study- and test-level sensitivity and specificity parameters. Useful for checking convergence and posterior uncertainty.

"forest"

Forest plot summarizing point estimates and uncertainty intervals for sensitivity and specificity of each test across studies. Helpful for visualizing study heterogeneity.

"contour"

Contour-enhanced plots showing joint posterior density of sensitivity and specificity for each test or study. Useful for visual comparison of test performance.

If type is not specified, the function defaults to "sroc". For example, both plot(x) and plot(x, type = "sroc") will produce the SROC plot.

Examples

Run this code
# \donttest{
data(dat.kang)
set.seed(9)
kang.out <- nmadt.hierarchical(nstu=12, K=2, data=dat.kang, 
            testname=c("D-dimer","Ultrasonography"))
plot(kang.out, type = "sroc")
plot(kang.out, type = "forest")
plot(kang.out, type = "contour")
plot(kang.out, type = "density")
# }

Run the code above in your browser using DataLab