nsca_reference: Central-tendency reference line

View source: R/results.R

nsca_referenceR Documentation

Central-tendency reference line

Description

Fits the ordinary least-squares regression of the outcome on each condition, on the same observations both frontiers were fitted to. This is the line lm(y ~ x) returns, and it is what reference = "ols" draws on nsca_plot().

Usage

nsca_reference(model, x = NULL)

Arguments

model

An object returned by nsca_analysis().

x

Optional condition names or positions. All conditions by default.

Details

It is reported apart from nsca_table() because it is a different kind of quantity. Regression describes how the expected outcome moves with the condition; the two frontiers describe which condition-outcome combinations are absent. Section 6.1 of the condition analysis in degree framework keeps the two logics side by side rather than merging them into one number, and section 4.3 notes that a frontier is fixed by the most extreme observations rather than by the central tendency. A reference line therefore has a slope and an intercept but no empty zone, no effect size, no p value, no threshold, and no part in the joint-support decision.

The line is computed on request, so it is available whether or not reference = "ols" was set; drawn records whether it also appears on the plot.

Value

A data frame with one row per condition: condition, outcome, line, line_type, observations, intercept, slope, r_squared and drawn.

See Also

nsca_analysis(), nsca_table(), nsca_terms()

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", reference = "ols")
nsca_reference(fit)

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