CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-spreg

Spatial econometric regression models for analyzing geographically-related data interactions.

Overall
score

87%

Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "This criteria evaluates the engineer's ability to use the spreg package for instrumental variables estimation and spatial diagnostic testing, specifically focusing on the TSLS class for two-stage least squares regression and the Anselin-Kelejian test for detecting spatial autocorrelation in IV models.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "TSLS model instantiation",
      "description": "Uses the TSLS class from spreg to create a two-stage least squares model with the correct parameters: y (dependent variable), x (exogenous variables), yend (endogenous variable), and q (instrument)",
      "max_score": 25
    },
    {
      "name": "Spatial weights parameter",
      "description": "Passes the spatial weights matrix to the TSLS model using the 'w' parameter to enable spatial diagnostics",
      "max_score": 15
    },
    {
      "name": "Endogeneity diagnostic enabled",
      "description": "Enables the Durbin-Wu-Hausman endogeneity test by setting the 'nonspat_diag' parameter to True in the TSLS model",
      "max_score": 15
    },
    {
      "name": "Anselin-Kelejian test enabled",
      "description": "Enables the Anselin-Kelejian test for spatial autocorrelation in the IV model by setting the 'spat_diag' parameter to True in the TSLS model",
      "max_score": 25
    },
    {
      "name": "Extract endogeneity results",
      "description": "Correctly extracts the endogeneity test statistic and p-value from the model results, typically from the ak_test attribute or similar diagnostic output",
      "max_score": 10
    },
    {
      "name": "Extract spatial test results",
      "description": "Correctly extracts the Anselin-Kelejian test statistic and p-value from the TSLS model results for spatial autocorrelation assessment",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-spreg

tile.json