nsca_plot: Plot both frontiers

View source: R/plots.R

nsca_plotR Documentation

Plot both frontiers

Description

Draws the scatter plot with the necessity and sufficiency frontiers and shades the admissible region between them. Several frontier techniques may be drawn at once; unlike the computation, a chart compares nothing numerically, so mixing techniques here is safe and often informative.

Usage

nsca_plot(model, x = NULL, ceilings = NULL, shade = TRUE, annotate = TRUE)

## S3 method for class 'nsca_result'
plot(x, ...)

Arguments

model

An object returned by nsca_analysis().

x

Optional condition names or positions.

ceilings

Frontier techniques to draw. Defaults to all that were estimated.

shade

Shade the admissible region under the first technique.

annotate

Label the two corners that the claim requires to be empty.

...

Passed on to nsca_plot() by the plot() method.

Value

A ggplot for one condition, or a named list of plots.

See Also

nsca_analysis(), nsca_table()

Examples

set.seed(1)
x <- sort(runif(60))
dat <- data.frame(X = x, Y = pmin(pmax(x + rnorm(60, 0, 0.1), 0), 1))
fit <- nsca_analysis(dat, "X", "Y", ceilings = "ce_fdh")
nsca_plot(fit)
plot(fit)

NSCA documentation built on Oct. 10, 2026, 5:08 p.m.