2SLS with Spatial Test

Spatial two stage least squares (S2SLS) with results and diagnostics. More details can be found in the following reference, Luc Anselin. Spatial Econometrics: Methods and Models. Kluwer. Dordrecht, 1988.

Note: The input table should not contain missing values. You can use the Missing Value node to replace them.


Geometry column

Select the geometry column to use.

ID column

Select the column which contains for each observation in the input data a unique ID, it should be an integer column. The IDs must match with the values of the Spatial Weights node ID column. If 'none' is selected, the IDs will be automatically generated from 0 to the number of rows flowing the order of the first input table.

Dependent variable

The column containing the dependent variable to use for the calculation of Spatial 2SlS.

Independent variables

The columns containing the independent variables to use for the calculation of Spatial 2SlS.

Orders of W

Orders of W to include as instruments for the spatially lagged dependent variable. For example, w_lags=1, then instruments are WX; if w_lags=2, then WX, WWX; and so on.

Spatial Diagnostics

If selected, the node computes the Anselin-Kelejian test.


If ‘white’, then a White consistent estimator of the variance-covariance matrix is given. If ‘hac’, then a HAC consistent estimator of the variance-covariance matrix is given. Set to None for default.

Sig2n k

If True, then use n-k to estimate sigma^2. If False, use n. Default set to True.

Advanced Settings

Advanced Setting


If True, include variance-covariance matrix in summary results. Default set to False.

Input Ports


Input table for calculation of Spatial 2SlS


Spatial Weights table for calculation of Spatial 2SlS

Output Ports


Description of Spatial 2SlS, including Pseudo R-squared, Spatial Pseudo R-squared, Number of Observations, and Number of Variables


Variable and Coefficient Table of Spatial 2SlS

Popular Predecessors

  • No recommendations found

Popular Successors

  • No recommendations found


Model Summary View
Model Summary View of Spatial 2SlS


  • No workflows found



You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.