| plot_surface | R Documentation |
Renders the same context-conditioned reference surface that
plot.grass_card(type = "surface") shows, but driven by scalar inputs
rather than a fitted grass_report() result. The intended use case is
prospective study design: a practitioner planning a multi-rater study at
design (pi_hat, k, N) can ask "what does my reference surface look
like for this metric, before I collect data?" – and plot_surface()
answers without requiring a rating matrix.
plot_surface(
metric,
pi_hat = NULL,
observed = NULL,
k = NULL,
N = NULL,
axis = c("inter", "intra"),
bands = NULL,
...
)
metric |
Character scalar. One of |
pi_hat |
Optional numeric scalar in |
observed |
Optional numeric scalar. An observed (or hypothetical)
coefficient value. When supplied with |
k |
Optional integer. Rater count. Used for the subtitle only; non-ICC closed-form surfaces are k-invariant. |
N |
Optional integer. Sample size. Used for the subtitle only; non-ICC closed-form surfaces are N-invariant in the large-N limit the surface represents. |
axis |
One of |
bands |
Optional numeric length-5 increasing vector of |
... |
Reserved for future extension. |
The plot is a heatmap of the closed-form expectation
E[metric](M_1, q) over the surface, where M_1 is the marginal
positive rate and q in [0.5, 1] is the diagonal rater operating
quality. When pi_hat is supplied alone, a dashed vertical
line marks the design's marginal. When both pi_hat and observed
are supplied, a filled marker pins the implied (M_1, hat q) point on
the surface; hat q is recovered by closed-form inversion of observed
against the reference curve at pi_hat.
This function uses the closed-form non-ICC surfaces only (PABAK,
Fleiss kappa, mean-pairwise AC1, Krippendorff alpha). ICC surfaces
depend on the full subject-prevalence distribution F and the
GLMM-gap-corrected fitted reference;
those are accessed via position_on_surface() with metric = "icc"
and (if available) a fitted card via plot.grass_card(type = "surface").
A ggplot object.
plot.grass_card() for the card-driven surface view that
adds card-specific annotations (consistency band, primary-coefficient
pin); position_on_surface() for the underlying inversion machinery.
if (requireNamespace("ggplot2", quietly = TRUE)) {
# Bare surface -- what does PABAK's reference look like?
plot_surface("pabak")
# Mark a design context (no observed value yet -- pre-data).
plot_surface("fleiss_kappa", pi_hat = 0.30, k = 5, N = 200)
# Pin a hypothetical observation on the surface.
plot_surface("mean_ac1", pi_hat = 0.30, observed = 0.62,
k = 5, N = 200)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.