Skip to main content
Glama

enaho_regresion

Read-onlyIdempotent

Run survey-weighted linear/logistic regression with design-corrected standard errors to obtain valid population estimates from complex survey data.

Instructions

Regresion ponderada con errores estandar corregidos por el diseno.

Es el equivalente de svy: regress y svy: logit de Stata, y es lo que hay que usar en vez de correr statsmodels sobre el parquet: sin el factor los coeficientes describen a la muestra y no al pais, y sin el conglomerado los errores estandar se quedan tipicamente entre un 30 y un 60 % por debajo del real, lo que vuelve significativo lo que no lo es.

Devuelve coeficientes con error estandar, t, p-valor e IC; los grados de libertad son los del DISENO (conglomerados - estratos), no n - k. Para el logit los coeficientes van en escala log-odds: exponencialos para leerlos como razon de momios.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
factorNoFactor explicito.
datasetYesNombre corto del dataset preparado.
familiaNo'lineal' (minimos cuadrados) o 'logit' (dependiente 0/1).lineal
encuestaNoEncuesta del INEI sobre la que operar. Por defecto 'enaho'. Valores: enaho, enaho-panel, endes, enapres, enut, enares, ena, epen-departamentos, epen-ciudades, epen-lima, epe-lima, enapref, enco, cenagro, mapa-pobreza. Cada encuesta tiene sus propias llaves de union y su propio factor de expansion; no se pueden mezclar entre si.
estratosNoVariable de estratos.
categoricasNoSubconjunto de `explicativas` que debe expandirse a indicadoras. La primera categoria queda como referencia y el nombre del coeficiente la declara ('area=rural').
dependienteYesVariable a explicar. Continua para familia='lineal' (inghog1d, gashog2d), indicadora 0/1 para 'logit'.
explicativasYesVariables explicativas. La constante se anade sola.
conglomeradosNoVariable de UPM.
peso_adicionalNo'mieperho' para que cada hogar pese por sus miembros.
nivel_confianzaNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses output details: coefficients, standard errors, t, p-value, confidence intervals, design-based degrees of freedom, and log-odds scale for logit. This is substantial behavioral context that annotations do not provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured into three focused paragraphs: definition, usage rationale, and output behavior. Every sentence earns its place without redundancy, making it concise yet information-dense for a complex statistical tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, the description plus schema and annotations provide a complete picture. It covers input requirements, statistical behavior, output interpretation, and common pitfalls. The output schema further completes the picture, so no critical aspect is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 91%, so the baseline is 3. The description adds meaning by explaining why factor and cluster matter, including the empirical consequence of omitting them (30-60% underestimated standard errors). Other parameters are already well-covered by the schema, so the description doesn't need to elaborate on all of them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as survey-weighted regression with design-corrected standard errors, explicitly naming Stata's svy: regress and svy: logit equivalents. It distinguishes itself from running statsmodels on parquet, leaving no ambiguity about its function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly instructs to use this tool instead of statsmodels on parquet and explains why (factor for population inference, cluster for correct standard errors). This gives clear when-to-use guidance and names an alternative, even though it doesn't enumerate all sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AnderMC66/enaho-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server