gm_lag
Run a spatial 2SLS or GMM-IV spatial lag model on cross-sectional data. Get coefficients, standard errors, z/p-values, fit metrics, optional Anselin-Kelejian test, and data preview.
Instructions
Run spreg.GM_Lag (spatial 2SLS / GMM-IV spatial lag model) on a cross-section.
Returns coefficients with SE/z/p, fit metrics, (optional) AK test, and a small data preview.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"shapefile_path": "<shapefile_path>",
"y_col": "<y_col>",
"x_cols": "<x_cols>"
},
"name": "gm_lag"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shapefile_path | Yes | ||
| y_col | Yes | ||
| x_cols | Yes | ||
| target_crs | No | EPSG:4326 | |
| weights_method | No | queen | |
| distance_threshold | No | ||
| w_lags | No | ||
| lag_q | No | ||
| yend_cols | No | ||
| q_cols | No | ||
| robust | No | ||
| hac_bandwidth | No | ||
| spat_diag | No | ||
| sig2n_k | No | ||
| drop_na | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||