{"schemaVersion":1,"resourceType":"connector","slug":"statsmodels","name":"statsmodels","catalog":"statsmodels","description":"Regression fits and hypothesis tests over SQL relations","language":"Python","categories":["analytics"],"repository":"https://github.com/Query-farm/vgi-statsmodels","license":"MIT","generatedAt":"2026-12-01T18:22:16+00:00","runtime":{"engineVersion":"2.0.1","protocolVersion":"3.4"},"release":{"tag":"v0.5.0","publishedAt":"2026-11-25T18:32:37Z","url":"https://github.com/Query-farm/vgi-statsmodels/releases/tag/v0.5.0"},"links":{"html":"https://query.farm/products/orchard/connectors/statsmodels/","llms":"https://query.farm/products/orchard/connectors/statsmodels/llms.txt","markdown":"https://query.farm/products/orchard/connectors/statsmodels/index.md","json":"https://query.farm/products/orchard/api/v1/connectors/statsmodels.json","objects":"https://query.farm/products/orchard/api/v1/connectors/statsmodels/objects.json","search":"https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=statsmodels&q={query}"},"authentication":{"mode":"none_declared","guidance":"No service credentials are declared by this connector. Individual datasets, input files or deployments may have their own prerequisites.","interpretation":"Secret parameter required flags describe the upstream declaration; they do not override the service-level mode above. Keep secrets in environment variables or the deployment secret store. SQL values in angle brackets are placeholders, not automatic environment lookups. Native DuckDB and Haybarn 2.0.1 do not provide a SQL getenv() function, even when worker-supplied snippets mention it. Read environment variables in your application and pass credential values through client parameter bindings (for example, Python con.execute(\"CREATE SECRET stripe (TYPE stripe, api_key ?)\", [os.environ[\"STRIPE_API_KEY\"]]) after attaching the connector. Omit unused optional parameters and keep real values out of saved SQL and logs.","secrets":[]},"deployment":{"local":{"methods":[{"id":"uvx","label":"uvx","icon":"simple-icons:python","steps":[{"title":"Attach with uvx","description":"Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.","lang":"sql","code":"ATTACH 'statsmodels' AS statsmodels (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-statsmodels@v0.5.0 vgi-statsmodels'\n);"}]},{"id":"docker","label":"Docker","icon":"simple-icons:docker","steps":[{"title":"Attach the signed image","description":"Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.","lang":"sql","code":"ATTACH 'statsmodels' AS statsmodels (\n  TYPE vgi,\n  LOCATION 'oci://ghcr.io/query-farm/vgi-statsmodels:0.5.0'\n);"}]}],"pinnedMethods":[{"id":"uvx","label":"uvx","icon":"simple-icons:python","steps":[{"title":"Attach with uvx","description":"Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.","lang":"sql","code":"ATTACH 'statsmodels' AS statsmodels (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-statsmodels@v0.5.0 vgi-statsmodels'\n);"}]},{"id":"docker","label":"Docker","icon":"simple-icons:docker","steps":[{"title":"Attach the signed image","description":"Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.","lang":"sql","code":"ATTACH 'statsmodels' AS statsmodels (\n  TYPE vgi,\n  LOCATION 'oci://ghcr.io/query-farm/vgi-statsmodels:0.5.0'\n);"}]}]},"selfHost":{"instructions":"https://github.com/Query-farm/vgi-statsmodels","connectionGuide":"https://query.farm/vgi/connect-to-a-worker/","guidance":"Deploy using the connector repository instructions and use its supported HTTP or SSH transport. Replace example URLs with your actual deployment; configure its authentication."},"queryFarm":{"available":true,"console":"https://auth.queryfarm.cloud/console/new?worker=statsmodels","organizationMonthlyMinimumUsd":10,"pricing":"https://query.farm/products/orchard/hosted/"},"publicDemo":null},"setup":{"extensions":{"duckdb":"SET allow_extension_repositories = 'allowed';\n\nCREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm\n    WITH PREFIX 'https://duckdb-extensions.query.farm';\n\nINSTALL vgi FROM query_farm;\nLOAD vgi FROM query_farm;","haybarn":"INSTALL vgi FROM community;\nLOAD vgi;"},"attachSql":"ATTACH 'statsmodels' AS statsmodels (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-statsmodels@v0.5.0 vgi-statsmodels'\n);","attachOptions":[],"note":"Install and load VGI, attach the connector using the catalog alias shown here, then create required secrets. Replace placeholders and omit unused optional secret parameters. Satisfy file, network and credential prerequisites before executing a query."},"example":{"title":"Fit a regression and inspect its coefficients","sql":"SELECT term, round(coef, 3) AS coef, round(p_value, 6) AS p_value FROM statsmodels.main.ols((SELECT * FROM (VALUES (1,5.1),(2,7.9),(3,11.2),(4,13.8)) AS t(x, y)), formula := 'y ~ x') ORDER BY term","requiresCredentials":null,"note":null,"objects":[{"name":"statsmodels.main.ols","kind":"table_in_out_function","links":{"html":"https://query.farm/products/orchard/connectors/statsmodels/#obj-main-ols","markdown":"https://query.farm/products/orchard/connectors/statsmodels/objects/table_in_out_function.bWFpbg.b2xz.md","json":"https://query.farm/products/orchard/api/v1/connectors/statsmodels/objects/table_in_out_function.bWFpbg.b2xz.json"}}],"evidence":{"status":"captured_result","capturedAt":"2026-12-01T06:21:29+00:00","engineVersion":"2.0.1","protocolVersion":"3.4.0","releaseTag":"v0.5.0","sample":{"columns":["term","coef","p_value"],"types":["VARCHAR","DOUBLE","DOUBLE"],"rows":[["Intercept",2.15,0.013045],["x",2.94,0.000947]],"more":false}},"artifact":null},"objects":{"total":7,"index":"https://query.farm/products/orchard/api/v1/connectors/statsmodels/objects.json","search":"https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=statsmodels&q={query}"},"agentTasks":["Using the statsmodels worker, fit an ordinary least squares regression of y on x for these observations with columns (x, y): (1,5.1),(2,7.9),(3,11.2),(4,13.8),(5,17.1),(6,19.9),(7,23.2),(8,25.8). Return one row per model term (the intercept and x) with its estimated coefficient rounded to 2 decimal places.","For the same 8 observations with columns (x, y): (1,5.1),(2,7.9),(3,11.2),(4,13.8),(5,17.1),(6,19.9),(7,23.2),(8,25.8), how well does an OLS model of y on x fit the data? Report the R-squared goodness-of-fit statistic, rounded to 3 decimal places.","Fit a logistic regression of the binary outcome y on x for these rows with columns (x, y): (1,0),(2,0),(3,0),(4,1),(5,0),(6,1),(7,0),(8,1),(9,1),(10,1),(11,1),(12,1). Report the estimated log-odds coefficient on x, rounded to 2 decimal places.","These rows are counts y rising with x, columns (x, y): (1,1),(2,2),(3,2),(4,4),(5,5),(6,7),(7,9),(8,12). Fit a Poisson generalized linear model of y on x and report the coefficient on x (on the log link scale), rounded to 2 decimal places.","Two groups 'a' and 'b' have these measurements, columns (v, g): (10,'a'),(11,'a'),(9,'a'),(12,'a'),(10,'a'),(20,'b'),(22,'b'),(19,'b'),(21,'b'),(20,'b'). Run a two-sample t-test to compare the mean of v across the two groups and report the two-sided p-value, rounded to 6 decimal places.","Run the Augmented Dickey-Fuller unit-root test on this time series. The rows have columns (t, v) and must be tested in ascending t order: (0,10.0),(1,13.82),(2,16.66),(3,14.87),(4,14.38),(5,12.71),(6,7.79),(7,6.64),(8,7.02),(9,6.14),(10,9.6),(11,13.56),(12,13.97),(13,15.99),(14,16.27),(15,12.06),(16,10.13),(17,8.5),(18,5.1),(19,6.4),(20,9.32),(21,10.17),(22,13.96),(23,16.72),(24,14.83),(25,14.25),(26,12.54),(27,7.64),(28,6.56),(29,7.04). Report how many lags the test chose (used_lag) and how many observations it used (n_obs).","These delivery rows have columns (km, minutes, region): (16.3,42.5,'n'),(16.4,41.4,'n'),(10.8,30.8,'n'),(6.4,22.2,'n'),(2.0,13.1,'n'),(8.3,27.3,'n'),(8.8,27.5,'n'),(1.9,13.1,'n'),(1.9,18.3,'s'),(20.0,55.0,'s'),(13.4,38.8,'s'),(5.5,24.7,'s'),(9.3,31.4,'s'),(19.5,52.8,'s'),(18.1,48.7,'s'),(17.0,48.0,'s'). Is one region slower than distance alone explains? Fit an OLS regression of minutes on km only (no region term), compute each row's residual (minutes minus the fitted value), then run the worker's two-sample t-test comparing those residuals between region 'n' and region 's'. Return a single value: the absolute value of the t-statistic, rounded to 2 decimal places.","The statsmodels worker publishes a discovery table of the error families its generalized linear model (glm) supports. Consult it: which single family name should you use to model non-negative integer count outcomes? Return just that family name."],"provenance":{"generatedAt":"2026-12-01T18:22:16+00:00","repository":"https://github.com/Query-farm/vgi-statsmodels","harvest":{"status":"ok","method":"subprocess","error":null,"vgi_version":"9773130dde"},"catalogVerification":{"verified":true,"status":"passed","total":2,"passed":2,"failed":0,"needs_credentials":0,"location":"uvx --from git+https://github.com/Query-farm/vgi-statsmodels@v0.5.0 vgi-statsmodels","transport":"subprocess","environment":{"vgi_extension_version":"9773130dde","haybarn_version":"2.0.1rc3","engine_version":"v2.0.1","python":"3.12.4","platform":"darwin_arm64","protocol_version":"3.4.0"},"checked_at":"2026-12-01T06:21:02+00:00"},"interpretation":"Catalog verification records the harvest environment. It is not proof that every query or current live API call succeeds. Only an example with captured_result has a saved result for that exact SQL."},"interpretation":["Missing, null, or undeclared metadata means unknown; do not invent defaults, credential scope, platform support or endpoint URLs.","Search is keyword retrieval, not proof of a capability. Read the exact object declaration before generating SQL.","A table and a table function can have the same name. Preserve parentheses and use the matching overload and schema.","Service credentials, external data availability and deployment authentication are separate requirements."]}