Skip to main content
Glama

enaho_estimar

Read-onlyIdempotent

Compute design-based estimates from ENAHO survey data with correct standard errors and confidence intervals, handling stratification, clustering, and sampling weights to avoid biased results.

Instructions

Estimacion ponderada con error estandar e IC que respetan el diseno.

Esta herramienta existe para evitar el error clasico de tesis: sacar el promedio simple de una encuesta estratificada por conglomerados y reportarlo como si describiera al pais. El factor de expansion no es opcional y el error estandar ingenuo subestima la varianza real.

Metodo: linealizacion de Taylor con estimador de conglomerado ultimo (estratos x UPM), t de Student con gl = n_conglomerados - n_estratos, e IC en escala logit para proporciones.

IMPORTANTE sobre el universo. Para indicadores de POBLACION que deban reproducir cifras oficiales (pobreza, ingreso per capita), usa un dataset a nivel HOGAR con peso_adicional="mieperho". Ponderar las filas del roster de personas solo con factor07 expande a un universo mayor -- incluye trabajadores del hogar y pensionistas-- y da una cifra parecida pero distinta de la del INEI. La herramienta lo detecta y lo advierte, pero es mejor pedirlo bien de entrada.

Cada celda trae su coeficiente de variacion y un campo confiable: por encima de CV 15 % el INEI considera la estimacion no publicable, porque el dominio tiene muestra insuficiente.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
porNoVariables de desagregacion, por ejemplo ['departamento'] o ['dominio','area']. El diseno completo se mantiene: no se filtra la muestra, se usa un indicador de dominio.
valorNoCategoria de interes cuando estadistico='proporcion'.
factorNoColumna del factor. Si se omite se detecta (factor07, factor...).
datasetYesDataset preparado con enaho_unir_modulos.
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.
estratosNoColumna de estratos (por defecto 'estrato').
variableYesVariable a estimar, por ejemplo 'inghog1d'.
estadisticoNo'proporcion' requiere una variable 0/1 o que indiques `valor` con la categoria de interes (ej. valor=1 sobre `pobreza`).media
conglomeradosNoColumna de UPM (por defecto 'conglome').
peso_adicionalNoColumna que multiplica al factor. Usa 'mieperho' para expandir un archivo a nivel HOGAR a poblacion: es el metodo con el que el INEI calcula la pobreza que publica.
nivel_confianzaNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Annotations already declare readOnly, idempotent, and non-destructive. The description adds substantial behavioral detail: the Taylor linearization method, degrees of freedom, logit-scale confidence intervals for proportions, automatic detection/warning about the universe issue, and the output fields (CV and confiable). This far exceeds annotation coverage.

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

Conciseness4/5

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

The description is well-structured with clear sections: summary, motivation, method, the 'IMPORTANTE' universe caveat, and output interpretation. Each paragraph serves a purpose, though the motivation paragraph could be tightened. The critical usage note is prominently highlighted.

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 (survey design, 11 parameters) and the presence of a rich input schema and output schema, the description covers all essentials: what it does, the method, the main usage pitfall, and how to interpret reliability. It omits nothing critical for basic usage.

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 baseline is 3. The description adds valuable semantic context for key parameters: it explains that peso_adicional='mieperho' is the correct method for official population figures, and clarifies the role of the factor expansion. This goes beyond the schema's field descriptions.

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

Purpose4/5

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

The description clearly states the tool's purpose: design-weighted estimation with standard error and confidence intervals. It explains the problem it solves (avoiding simple averages on complex survey data). However, it does not explicitly distinguish from sibling tools like enaho_tabla_cruzada or enaho_regresion, which may also perform survey-weighted analyses.

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

Usage Guidelines4/5

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

The description provides clear guidance on when to use the tool: for design-based estimates where factor expansion is mandatory. It also gives a critical usage rule for population indicators (use peso_adicional='mieperho' to reproduce official figures). It does not explicitly mention alternatives or exclusions, but the context is sufficient.

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