nsca: Quick necessary and sufficient condition analysis

View source: R/analysis.R

nscaR Documentation

Quick necessary and sufficient condition analysis

Description

A thin wrapper over nsca_analysis() with a permutation test attached.

Usage

nsca(
  data,
  x,
  y,
  direction = "HH",
  ceilings = "ce_fdh",
  reference = NULL,
  test.rep = 1000
)

Arguments

data

A data frame or object coercible to a data frame.

x

Columns containing one or more conditions.

y

A single outcome column.

direction

Necessary-and-sufficient direction(s): "HH", "LH", "HL", or "LL". The first letter is the condition level and the second the outcome level.

ceilings

One or more empty-space frontier techniques, applied identically to both sides. "ols" is rejected here because it estimates central tendency rather than an empty space; pass it as reference instead.

reference

Central-tendency lines drawn beside the two frontiers for comparison, or NULL for none. "ols" is the ordinary least-squares regression of the outcome on the condition, fitted to all the data. It is an average-effect summary, enters no joint index, no threshold and no support decision, and is reported by nsca_reference().

test.rep

Number of permutation resamples for the engines' own component tests. Zero skips testing, and without it no joint-support verdict can be reached.

Value

An object of class nsca_result.

See Also

nsca_analysis()

Examples

set.seed(1)
x <- sort(runif(60))
dat <- data.frame(X = x, Y = pmin(pmax(x + rnorm(60, 0, 0.1), 0), 1))

# The default 1000 permutations take several seconds.
nsca(dat, "X", "Y")


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

Related to nsca in NSCA...