SCAtools

Sufficient Condition Analysis (SCA) in R.

What the method is

A condition is sufficient for an outcome when having the condition guarantees the outcome. In data, a sufficiency claim makes a definite prediction: the cases that would contradict it do not occur. Plot the condition X against the outcome Y and those cases sit in one corner of the scatter plot. “High X is sufficient for high Y” predicts that the lower-right corner – high X with low Y – is empty.

Sufficient Condition Analysis estimates that empty corner. It fits the boundary of the empty space, measures how large the empty space is, tests whether it is larger than random pairing of X and Y would produce, and turns the boundary into thresholds: the level of X that guarantees each level of Y.

A sufficiency claim can run in four directions, and each predicts a different empty corner:

Direction Claim Empty corner
HH high X is sufficient for high Y lower-right
LH low X is sufficient for high Y lower-left
HL high X is sufficient for low Y upper-right
LL low X is sufficient for low Y upper-left

You state the claim; the package finds the corner.

What it is for

Installation

install.packages("SCAtools")

How to use it

The package includes four simulated datasets that show the four ways a regression effect and a sufficiency effect can combine.

library(SCAtools)

# Configuration II: a flat regression slope, but an empty lower-right corner
dat <- subset(sca_four_configurations, configuration == "II")

# 1. Fit the claim "high X is sufficient for high Y"
fit <- sca_analysis(dat, x = "X", y = "Y", direction = "HH",
                    scope = c(0, 100, 0, 100), test.rep = 1000)
fit                     # summary, with every setting the result rests on

# 2. Read the results
sca_table(fit)          # effect size, p value and support for each condition
sca_thresholds(fit)     # the X level that guarantees each Y level
sca_plot(fit)           # the scatter plot, the frontier and the empty corner

# 3. Set it beside regression
sca_compare(fit)        # here: slope near zero, large sufficiency effect

sca() runs the same analysis with a permutation test and draws the plot in one step:

sca(dat, x = "X", y = "Y", direction = "HH")

Checking the result

Function What it shows
sca_test_plot() the permutation distribution beside the observed effect size
sca_scope() the scope each effect size was divided by
sca_scope_sensitivity() how the effect size changes with the scope
sca_resample() how much the effect size varies across subsamples
sca_outliers() which observations hold up the frontier
sca_locationshift() whether the frontier is a level shift or a threshold
sca_magnitude() conventional bands for an effect size

Reading the results

Good practice

An ordinary least-squares or median regression line can be added with reference = "ols" or "qr". It is drawn for comparison and reported by sca_reference(); it is not part of the sufficiency analysis.

Learn more

Source and issue tracker: https://github.com/youngchanresearcher/SCAtools

The Traditional Chinese version of this README is installed with the package:

file.show(system.file("docs", "README_zh-TW.md", package = "SCAtools"))