*! version 1.0 22 Aug 2025

Title

nca_outliers -- Detect necessary condition analysis (NCA) outliers on a dataset.

Syntax

nca_outliers
varlist
(numeric
min=2
max=2)
[if]
[in]
[,
options]

Required
idvar(varname) an existing numeric identifier variable.

Optional
ceiling(string) name of the ceiling technique to be used. The default ceiling is ce_fdh.

corner(#) an integer indicating the corner to analyze. Default value is 1.

flipx reverse the direction of the condition variable.

flipy reverse the direction of the outcome variable.

scope(numlist) a theoretical scope in format : (x.low, x.high, y.low, y.high).

k(#) use combinations of observations. Default value is 1.

mindif(#) set the threshold for the minimum relative difference in the effect size to be considered as outlier. Default value is 0.01.

maxresults(#) maximum number of outliers to be shown. Default value is 25.

save(filename) saves the results in a data set whith the name given by filename.

Description

Detect necessary condition analysis (NCA) outliers on a dataset. Leave-k-out analysis of observations on the ceiling line or on the scope is performed to evaluate their impact on the effect size. Potential outliers can be classified as ceiling outliers or scope outliers. For each point, the absolute variation on the effect size (dif_abs in the Stata output) and the relative variation on the effect size are considered (dif_rel in the Stata output).

Options

Main

idvar(varname) an existing numeric identifier variable.

ceiling(string) name of the ceiling technique to be used. The default ceiling is ce_fdh.

corner(#) an integer indicating the corner to analyze. Default value is 1. Corner 1 is the upper-left corner and corner 2 is the upper-right corner. These two corners are used for an analysis of the necessity of the presence/high level if x (corner = 1 ) or the absence/low level if x (corner = 2) for the presence/high level of y, respectively.
Corner 3 is the lower-left corner and corner 4 is the lower-right corner. These two corners are used for an analysis of the necessity of the presence/high level of x (corner(3)) or the absence/low level if x (corner(4)) for the absence/low level of y, respectively.
By default the upper left corner is analysed for all independent variables and corner is not defined. If corner is defined, flipx and flipy are ignored.

flipx reverse the direction of the condition variable.

flipy reverse the direction of the outcome variable.

scope a theoretical scope in format : (x.low, x.high, y.low, y.high). The default is to use the empirical scope.

k(#) use combinations of observations. Default value is 1.

mindif(#) set the threshold for the minimum relative difference in the effect size to be considered as outlier. Default value is 0.01.

maxresults(#) maximum number of outliers to be shown. Default value is 25.

save(filename) saves the results in a data set whith the name given by filename.

Examples

. use ncaexample, clear

. nca_outliers individualism innovationperformance, id(country) ceiling(ce_fdh)

Authors

Daniele Spinelli

Department of Statistics and Quantitative Methods

University of Milano-Bicocca

Milan, Italy

daniele.spinelli@unimib.it

Jan Dul

Department of Technology & Operations Management

Rotterdam School of Management

Rotterdam, The Netherlands

jdul@rsm.nl

Contributors

Govert Buijs

Department of Technology & Operations Management

Rotterdam School of Management

Rotterdam, The Netherlands

buijs@rsm.nl