[{"description":"Spreads a present value over a whole number of years at a cited or elicited rate: the amount a year, paid at the end of each year, whose present value it is (PV times the capital recovery factor), read by reference with the lineage of every input.\nUse when: the equivalent annual cost of a project: the present value of its costs as an amount a year, to set beside a benefit a year\nAvoid when: the benefit a year that pays for a cost: calc.breakeven says it in those words | a present value not yet computed: calc.discount\nCheck after: the grade: the weakest of the present value's inputs, the rate and the horizon\nOften followed by: calc.breakeven","name":"calc__annuity","parameters":{"additionalProperties":false,"properties":{"pv":{"description":"The present value, a total in reais (e.g. calc.discount's pv): '<call_id>:<key>'","pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},"rate":{"description":"The discount rate a year (a cited or elicited figure)","pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},"what":{"description":"What the present value is of: names the result","enum":["custo_total","custo_obra","custo_manutencao","custo_servico","custo_conformidade","beneficio","receita","renuncia"],"type":"string"},"years":{"description":"The horizon in whole years (a cited or elicited figure)","pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"}},"required":["pv","rate","years","what"],"type":"object"}},{"description":"States what a project must deliver to pay for itself when its benefits are not measured: the benefit a year equal to the equivalent annual cost, in all or per user, the benefit a year per R$ 1 million of cost, or the cost as a share of a stock such as a property base; read by reference with the lineage of every input.\nUse when: the benefits are not quantified, but the cost is: say what the project must deliver each year to break even | comparing a cost with a stock: a share of the property base a land-value gain would have to reach\nAvoid when: the equivalent annual cost itself, of a cost or a benefit: calc.annuity | a count of users that is the city's population: the tool declines it; ask for the users or cite them\nCheck after: per_unit_year: the count of users, its source and its grade | the grade: a break-even of a cost the person typed is elicited\nOften followed by: calc.fiscal_impact","name":"calc__breakeven","parameters":{"additionalProperties":false,"properties":{"cost":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"The cost in present value, a total in reais (e.g. calc.discount's pv)"},"mode":{"description":"total_year: the benefit a year that pays for the cost (cost, rate, years); per_unit_year: the same per user (with units, a count of users); per_million: the benefit a year per R$ 1 million of cost (rate, years); share_of_stock: the cost as a percentage of a stock such as a property base (cost, stock)","enum":["total_year","per_unit_year","per_million","share_of_stock"],"type":"string"},"rate":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"The discount rate a year (a cited or elicited figure)"},"stock":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"For share_of_stock: the stock in reais, e.g. the property base"},"units":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"For per_unit_year: the users or beneficiaries a year (elicited or cited; never the city's population)"},"years":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"The horizon in whole years (a cited or elicited figure)"}},"required":["mode"],"type":"object"}},{"description":"Applies one arithmetic operation to two figures already in this run, read by reference, and returns the result with its derivation.\nUse when: the answer needs arithmetic on figures already computed: cost per beneficiary, difference between two estimates, percent change, a share | never do arithmetic in the answer text \u2014 every derived number must come from this tool\nAvoid when: converting a log-point coefficient to a percent effect \u2014 use core.scale_effect | comparing two estimates statistically \u2014 a difference here carries no standard error\nCheck after: the units of a and b are compatible with the operation","name":"calc__combine","parameters":{"additionalProperties":false,"properties":{"a":{"description":"Figure reference '<call_id>:<key>' from an earlier call in this run","type":"string"},"b":{"description":"Figure reference '<call_id>:<key>'","type":"string"},"label":{"default":"","description":"What the result means, e.g. 'annual cost per person lifted out of poverty'","type":"string"},"op":{"description":"ratio a/b; difference a\u2212b; sum; product; percent_change 100\u00b7(a\u2212b)/b; share_of 100\u00b7a/b","enum":["ratio","difference","sum","product","percent_change","share_of"],"type":"string"},"unit":{"default":"","description":"Unit of the result, e.g. 'R$/person/year'","type":"string"}},"required":["op","a","b"],"type":"object"}},{"description":"Discounts an amount paid now, an amount a year and an amount at the end of the horizon to their present value at a cited or elicited rate over a whole number of years, all read by reference, with the annuity factor and the lineage of every input.\nUse when: the present value of a project's costs: the works now and the maintenance every year of the horizon | any stream the appraisal compares in today's money: a benefit a year, a revenue a year\nAvoid when: the equivalent annual cost of a present value: calc.annuity | the benefit a year that pays for a cost: calc.breakeven | a rate or a horizon the run has not cited or asked for: cite the pinned parameter or ask, never type it\nCheck after: the rate's unit: a percentage is divided by a hundred, and a rate outside \u2212100% to 100% a year declines | the grade: a present value of a cost the person typed is elicited, whatever the rate's source\nOften followed by: calc.annuity, calc.breakeven","name":"calc__discount","parameters":{"additionalProperties":false,"properties":{"annual":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"An amount per year paid at the end of each year of the horizon (R$/ano), e.g. maintenance"},"at_end":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"A total paid at the end of the last year, e.g. a renewal"},"one_off":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"A total paid at the start (year zero), e.g. the cost of the works: '<call_id>:<key>'"},"rate":{"description":"The discount rate a year (a cited or elicited figure, e.g. the pinned social discount rate)","pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},"what":{"description":"What is discounted: names the result (custo_obra, custo_total, beneficio, \u2026)","enum":["custo_total","custo_obra","custo_manutencao","custo_servico","custo_conformidade","beneficio","receita","renuncia"],"type":"string"},"years":{"description":"The horizon in whole years (a cited or elicited figure)","pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"}},"required":["rate","years","what"],"type":"object"}},{"description":"Builds the table the LRF's art. 16, I, asks of a new expense: the cost of the works spread evenly over the construction months from the start date and the maintenance from the month after, per fiscal year for the start's year and the two after it, with each year's share of an appropriation when one is given; read by reference with the lineage of every input.\nUse when: a public investment or a new service: what it costs the budget in each of the three fiscal years the LRF names | setting the cost of each year beside the function's appropriation (data.siconfi's dotacao_atualizada)\nAvoid when: the present value or the annual cost over the whole horizon: calc.discount and calc.annuity | a revenue waiver: its estimate is the LRF's art. 14, which this table does not make\nCheck after: the warnings: without the construction months the works fall in the first year | the note: when there is maintenance, the LRF's art. 17 may apply\nOften followed by: calc.discount","name":"calc__fiscal_impact","parameters":{"additionalProperties":false,"properties":{"appropriation":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"An appropriation to set each year against, e.g. data.siconfi's dotacao_atualizada"},"capex":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"The cost of the works, a total in reais: '<call_id>:<key>'"},"construction_months":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"The months the works take (an elicited or cited figure); without it the works fall in the first year"},"opex":{"anyOf":[{"pattern":"^[A-Za-z0-9_]+:[A-Za-z0-9_.]+$","type":"string"},{"type":"null"}],"default":null,"description":"The cost of maintenance and operation a year (R$/ano)"},"start":{"description":"The day the expense starts, ISO (YYYY-MM-DD): a date the reading or the person gave","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$","type":"string"},"years":{"const":3,"default":3,"description":"The fiscal years of the table: the start's and the two after (LRF art. 16, I)","type":"integer"}},"required":["start"],"type":"object"}},{"description":"Atkinson inequality index and the equally-distributed-equivalent income for a stated inequality aversion \u03b5.\nUse when: inequality with an explicit value judgement about how much the poorest count (\u03b5)\nAvoid when: a convention-bound headline inequality number \u2014 use core.gini\nCheck after: state the \u03b5 used; results move with it | zero or negative incomes break \u03b5 \u2265 1 (the tool declines and says so)","name":"core__atkinson","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"epsilon":{"default":1.0,"description":"Inequality aversion (0 none; 1 log utility; 2 strong)","minimum":0,"type":"number"},"income":{"description":"Income or consumption column","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Weight column"}},"required":["dataset","income"],"type":"object"}},{"description":"The money each household would need at the old prices to be as well off as after the policy: income after, deflated by the rise in its own cost of living, minus income before. With no price change it is the income change.\nUse when: a policy that changes both incomes and prices (an indirect-tax change, a subsidy removed), in money | how many households end up worse off once their own spending pattern is counted\nAvoid when: an income change alone with no price change \u2014 the income difference itself is the answer | large price changes with substitution a Cobb-Douglas household cannot make: the formula assumes constant budget shares\nCheck after: share_worse_off: the weighted share of rows with a negative equivalent variation | shares_over_one: rows whose budget shares add to more than 1","name":"core__equivalent_variation","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"income_after":{"description":"Income after it, same rows, period and unit","type":"string"},"income_before":{"description":"Income or consumption before the policy, per person or household","type":"string"},"price_changes":{"additionalProperties":{"type":"number"},"description":"Budget-share column \u2192 percent change in that group's price, e.g. {'share_food': 10}: the share of spending each row puts on the group. Empty when prices do not change","type":"object"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Weight column; always pass it for survey data"}},"required":["dataset","income_before","income_after"],"type":"object"}},{"description":"Weighted Foster\u2013Greer\u2013Thorbecke poverty measure at a line: headcount share (\u03b1=0), poverty gap (\u03b1=1) or severity (\u03b1=2).\nUse when: what share of people are poor at a given poverty line | how deep poverty is (gap) or how it weighs the poorest (severity)\nAvoid when: the question is about inequality across the whole distribution \u2014 use core.gini | the dataset is a survey sample and no weight column is passed \u2014 pass weights=\nCheck after: the income concept and period match the line (per capita, monthly) | weights were used for survey data (diagnostic weights_used) | weighted_poor is the number of people below the line only when the weights expand to the population\nOften followed by: core.gini","name":"core__fgt","parameters":{"additionalProperties":false,"properties":{"alpha":{"default":0,"description":"0 headcount, 1 poverty gap, 2 severity","enum":[0,1,2],"type":"integer"},"dataset":{"description":"Dataset id","type":"string"},"income":{"description":"Income or consumption column (per capita, one period, e.g. R$/month)","type":"string"},"line":{"description":"Poverty line in the same unit and period as the income column","exclusiveMinimum":0,"type":"number"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Survey or population weight column; always pass it for sample surveys"}},"required":["dataset","income","line"],"type":"object"}},{"description":"Weighted Gini coefficient of an income or consumption distribution (0 equality, 1 one person holds everything).\nUse when: summarising inequality of the whole distribution in one number\nAvoid when: comparing the top with the bottom \u2014 use core.palma | the share of people below a line \u2014 use core.fgt\nCheck after: weights were used for survey data | negative or zero incomes in the column (negative incomes are counted as zero)","name":"core__gini","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"income":{"description":"Income or consumption column (per capita, one period, e.g. R$/month)","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Survey or population weight column; always pass it for sample surveys"}},"required":["dataset","income"],"type":"object"}},{"description":"The consumption taxes each income group pays, as a share of its total income: POF 2017-2018 budget shares and consumption-to-income ratios by decile or quintile, times an effective tax rate on each consumption group, the full tax passed on to prices.\nUse when: how heavily ICMS, PIS/Cofins, IPI and ISS (or IBS/CBS rates) fall on poorer and richer households | the regressivity of consumption taxes, to set beside the progressivity of the income tax\nAvoid when: a municipality's own population: the shares are national POF 2017-2018 averages by income group | a tax change's effect on prices by household \u2014 the burden here is a group's average, not a household's\nCheck after: consumption_income_ratio in the table: above 1 in the poorest decile (spending out of savings, transfers and under-reported income), which is what makes the burden there so high | rates: the file, whether it is verified, and whether its rates are inclusive or exclusive of the tax | basis: every acquisition is IPEA's basis; monetary only leaves out own production and donations","name":"core__indirect_incidence","parameters":{"additionalProperties":false,"properties":{"basis":{"default":"all_acquisitions","description":"The consumption taxed: every acquisition (IPEA's basis), or only what was paid in money (leaves out own production, donations and barter)","enum":["all_acquisitions","monetary_only"],"type":"string"},"groups":{"default":10,"description":"Income groups: 10 deciles or 5 quintiles of per-capita household income, persons weighted","enum":[10,5],"type":"integer"},"income":{"const":"total","default":"total","description":"The income that ranks people and that the burden is a share of: the household's total income (monetary and non-monetary, POF RENDA_TOTAL), per member for the ranking","type":"string"},"rate_basis":{"default":"inclusive","description":"'inclusive': the rates are tax over tax-inclusive spending, as IPEA's effective rates are; 'exclusive': statutory rates on the pre-tax price, so a real spent carries \u03c4/(1 + \u03c4) of tax","enum":["inclusive","exclusive"],"type":"string"},"rates":{"default":"indirect_rates_2017","description":"Parameter file whose group_rates_pct gives the tax rate on each POF consumption group, in %","type":"string"},"tables":{"anyOf":[{"additionalProperties":false,"properties":{"expenditure":{"description":"Dataset id: monthly expenditure per consumption unit and product, columns uc_id, codigo, monthly_brl, monetary_brl (magi_data.pof.monthly_expenditure_by_uc)","type":"string"},"products":{"description":"Dataset id: the product classification, codigo, nivel_1..nivel_5, alim_nivel_1..alim_nivel_3 (magi_data.pof.product_table)","type":"string"},"units":{"description":"Dataset id: one row per consumption unit, columns uc_id, weight, n_members, renda_total (magi_data.pof.consumption_units)","type":"string"}},"required":["expenditure","units","products"],"type":"object"},{"type":"null"}],"default":null,"description":"POF tables as datasets of the run, in place of magi_data's POF 2017-2018 cache"}},"type":"object"}},{"description":"How unequally a tax falls compared with pre-tax income: the concentration index of the tax, people ranked by pre-tax income, minus the Gini of that income. Positive when the richer pay a larger share of the tax than they hold of income (progressive), zero when proportional, negative when regressive.\nUse when: whether a tax, or a change in taxes, falls more heavily on richer people than their share of income\nAvoid when: how much a tax changes inequality \u2014 use core.reynolds_smolensky, which depends on the tax's size too | a benefit rather than a tax: its concentration index says whom it reaches; read core.quantile_shares\nCheck after: average_tax_rate: a very progressive tax that collects little barely moves inequality | n_negative_tax: refunds or benefits entered as negative taxes make the concentration curve cross zero","name":"core__kakwani","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"income":{"description":"Pre-tax income: it ranks people and is what the tax is compared with","type":"string"},"tax":{"description":"Tax paid per person or household, in the same period and unit as the income","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Survey or population weight column; always pass it for sample surveys"}},"required":["dataset","tax","income"],"type":"object"}},{"description":"Willingness to pay of beneficiaries per real of net government cost, read from two figures of this run.\nUse when: comparing the value delivered per real spent across policies\nAvoid when: the net cost has not been computed net of fiscal externalities \u2014 say so rather than divide gross cost | the net cost is zero or negative \u2014 the tool declines and says why (an infinite MVPF, or a policy that raises revenue)\nCheck after: whether fiscal externalities are included in the net cost | both figures cover the same population and period","name":"core__mvpf","parameters":{"additionalProperties":false,"properties":{"net_fiscal_cost":{"description":"Figure reference for the net cost to government","type":"string"},"willingness_to_pay":{"description":"Figure reference '<call_id>:<key>' for beneficiaries' willingness to pay","type":"string"}},"required":["willingness_to_pay","net_fiscal_cost"],"type":"object"}},{"description":"Income share of the top 10% divided by the share of the bottom 40%.\nUse when: comparing the top with the bottom of the distribution\nAvoid when: one summary of the whole distribution \u2014 use core.gini\nCheck after: negative incomes, which lower the bottom 40% share and raise the ratio","name":"core__palma","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"income":{"description":"Income or consumption column (per capita, one period, e.g. R$/month)","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Survey or population weight column; always pass it for sample surveys"}},"required":["dataset","income"],"type":"object"}},{"description":"Share of total income held by each weighted quantile group (deciles by default), with the top and bottom groups' shares as figures.\nUse when: how income is split across deciles or quintiles\nAvoid when: one summary number \u2014 use core.gini | the top 10% against the bottom 40% in one ratio \u2014 use core.palma\nCheck after: empty_groups: with few rows or very unequal weights some groups hold no one","name":"core__quantile_shares","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"groups":{"default":10,"description":"10 for deciles, 5 for quintiles","maximum":100,"minimum":2,"type":"integer"},"income":{"description":"Income or consumption column (per capita, one period, e.g. R$/month)","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Survey or population weight column; always pass it for sample surveys"}},"required":["dataset","income"],"type":"object"}},{"description":"How much taxes and transfers reduce inequality: the Gini of income before them minus the Gini after, with the reranking they cause (people changing places) reported beside it.\nUse when: how much a tax-benefit system, or a reform of it, reduces inequality | incomes before and after the same taxes and transfers, for the same people\nAvoid when: whether a tax is progressive regardless of its size \u2014 use core.kakwani | two different populations or periods: the difference of their Ginis is not a redistributive effect\nCheck after: reranking: above zero, some people end up in a different order and the effect understates the vertical redistribution (Atkinson\u2013Plotnick)","name":"core__reynolds_smolensky","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"post":{"description":"Income after them, same people, period and unit","type":"string"},"pre":{"description":"Income before the taxes and transfers being assessed, per person","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Survey or population weight column; always pass it for sample surveys"}},"required":["dataset","pre","post"],"type":"object"}},{"description":"Converts an estimated coefficient into a percent effect (from log points), standard-deviation units, or a percent of the baseline mean, carrying its interval through the same transformation.\nUse when: a coefficient on a log outcome must be stated as a percent change (exp(b) \u2212 1, not b \u00d7 100) | an effect must be expressed in standard deviations or relative to the baseline mean\nAvoid when: arithmetic between two figures (ratios, differences) \u2014 use calc.combine\nCheck after: the SD used is the right one (total vs within-unit) | the interval keeps the coefficient's confidence level; a percent effect from log points carries no standard error","name":"core__scale_effect","parameters":{"additionalProperties":false,"properties":{"baseline":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"description":"Baseline mean of the outcome (for percent_of_baseline)"},"coefficient":{"description":"Figure reference '<call_id>:<key>' of the estimated effect","type":"string"},"sd":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Outcome standard deviation (for sd_units)"},"transform":{"description":"log_points_to_percent: 100\u00b7(exp(b)\u22121); sd_units: b/sd; percent_of_baseline: 100\u00b7b/baseline","enum":["log_points_to_percent","sd_units","percent_of_baseline"],"type":"string"}},"required":["coefficient","transform"],"type":"object"}},{"description":"Theil T entropy index of inequality, decomposable across groups.\nUse when: an inequality index that decomposes into within- and between-group parts\nAvoid when: a single headline number for a general reader \u2014 core.gini is the convention\nCheck after: rows with zero or negative income are left out (ln 0 is undefined): see n_excluded_nonpositive","name":"core__theil","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"income":{"description":"Income or consumption column (per capita, one period, e.g. R$/month)","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Survey or population weight column; always pass it for sample surveys"}},"required":["dataset","income"],"type":"object"}},{"description":"The change in social welfare from one income distribution to another, in money: the change in the equally-distributed-equivalent income of a CRRA social welfare function with inequality aversion \u03b5. Gains to the poor count more the higher \u03b5.\nUse when: whether a policy raises welfare once who gains is weighed, not only how much in total | comparing reforms with the same cost that reach different people\nAvoid when: the mean income change \u2014 \u03b5 = 0 gives it, but say so rather than call it welfare | incomes with zeros at \u03b5 \u2265 1: the CRRA utility of zero is undefined (the tool declines)\nCheck after: state the \u03b5 used; the ranking of reforms can change with it | ede_before and ede_after beside the change","name":"core__welfare_change","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"epsilon":{"default":1.0,"description":"Inequality aversion of the CRRA utility (0 none; 1 log; 2 strong)","minimum":0,"type":"number"},"income_after":{"description":"Income after it, same people, period and unit","type":"string"},"income_before":{"description":"Income or consumption before the policy, per person","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Weight column; always pass it for survey data"}},"required":["dataset","income_before","income_after"],"type":"object"}},{"description":"Makes a figure of a number stated in the run's bill text or on an official page or PDF, only after the code finds the quote verbatim in the source and the number inside it, whole; the value is transcribed, multiplied only by a scale word the source writes after it (mil, milh\u00f5es, bilh\u00f5es).\nUse when: the bill states an amount, a number of places, a deadline in months or a budget that the analysis needs as a number | an official page (a ministry, IBGE, a municipality or a legislature) states a number the analysis needs: a unit cost, a coverage, a published total\nAvoid when: a census count of a municipality's people or households \u2014 data.sidra reads it from IBGE | a number nobody published: an assumed take-up, price or cost is never cited, it is declined | a number from a news article, a blog or a search result snippet: cite the official page that states it\nCheck after: the derivation's url, page and trecho: the sentence the figure stands on | the warnings: a number in ambiguous notation states how it was read, a scale word what it multiplied\nOften followed by: calc.combine","name":"data__cite","parameters":{"additionalProperties":false,"properties":{"label":{"description":"What the number is, in a few words of Portuguese and no number, in digits or in words","minLength":1,"type":"string"},"number":{"description":"The number's digits exactly as the quote writes them, e.g. '1.234,5', '600' or '12%'; a scale word after them in the source ('2,5 milh\u00f5es') is applied by the code","minLength":1,"type":"string"},"quote":{"description":"The sentence that states the number, copied verbatim from the source (at least 40 characters); only whitespace, quote marks and dashes may differ","minLength":40,"type":"string"},"source":{"description":"'bill' for the bill text of this run, or the http(s) URL of the official page or PDF the quote is in","type":"string"},"unit":{"description":"The unit, in words, e.g. 'R$/m\u00eas', 'vagas', '%': no number, in digits or in words; when the source writes a scale word after the number, the unit of one ('R$/ano', not 'R$ milh\u00f5es/ano')","minLength":1,"type":"string"}},"required":["source","quote","number","unit","label"],"type":"object"}},{"description":"Lists a dataset's columns with type, missing values, distinct values and, for numeric columns, mean, SD, min and max.\nUse when: first step on any dataset: find the outcome, treatment, unit, time, running variable, instrument, weight and cluster columns before choosing a design | checking whether a column is binary, categorical or continuous, or has missing values\nAvoid when: the question is about a weighted population statistic \u2014 use core.fgt or core.gini with the weight column\nCheck after: columns with many missing values | a treatment that is not 0/1 | sentinel codes such as 99 or 999","name":"data__describe","parameters":{"additionalProperties":false,"properties":{"columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Columns to describe; all when omitted"},"dataset":{"description":"Dataset id","type":"string"}},"required":["dataset"],"type":"object"}},{"description":"Reads what a municipality declared to the Tesouro Nacional's SICONFI: a closed fiscal year's spending by function or subfunction (liquidada and empenhada) and revenue by line (net of deductions), from the DCA, and this year's budget of a function (dota\u00e7\u00e3o atualizada, inicial and saldo) from the RREO; code picks the latest year or bimester published and every figure is labelled with its fiscal year, in nominal reais.\nUse when: the budget context of a policy: what the municipality spends in the policy's function (Urbanismo, Educa\u00e7\u00e3o, Sa\u00fade) or subfunction, and how much of this year's appropriation is left | the revenue a municipal tax raises today (IPTU, ISS, ITBI, taxas, contribui\u00e7\u00e3o de melhoria), before a change to it is appraised\nAvoid when: the budget of one secretariat or agency: SICONFI classifies spending by function, not by body; cite the LOA line with data.cite | a census count of people or households: data.sidra | a figure of a state or of the Union: this tool reads municipalities only\nCheck after: the fiscal year in each label: the DCA is of a closed year, the RREO of this year to a bimester | the warnings: a year not yet published, a revenue line with no deduction published | that the values are nominal: compare years only after correcting for inflation\nOften followed by: calc.combine","name":"data__siconfi","parameters":{"additionalProperties":false,"properties":{"function":{"anyOf":[{"enum":["01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28"],"type":"string"},{"type":"null"}],"default":null,"description":"For despesa_funcao and dotacao_funcao: the function's two-digit code (Portaria MOG n\u00ba 42/1999), e.g. '15' Urbanismo, '12' Educa\u00e7\u00e3o, '10' Sa\u00fade"},"jurisdiction":{"description":"The 7-digit IBGE code of the municipality","pattern":"^[0-9]{1,7}$","type":"string"},"period":{"default":"latest","description":"latest: the last fiscal year (DCA) or bimester (RREO) published; history: every one of the DCA's last three fiscal years that is published (not for dotacao_funcao)","enum":["latest","history"],"type":"string"},"revenue_line":{"anyOf":[{"enum":["iptu","iss","itbi","taxas","contribuicao_melhoria","total"],"type":"string"},{"type":"null"}],"default":null,"description":"For receita_linha: iptu, iss, itbi, taxas, contribuicao_melhoria or total"},"series":{"description":"despesa_funcao / despesa_subfuncao / despesa_total: spending of a closed fiscal year by function, by subfunction, or in all (DCA Anexo I-E; liquidada and empenhada); receita_linha / receita_total: revenue realised, net of deductions, of one line or in all (DCA Anexo I-C); dotacao_funcao: this year's budget of a function to the last bimester published (RREO Anexo 2; dota\u00e7\u00e3o atualizada, inicial and saldo)","enum":["despesa_funcao","despesa_subfuncao","despesa_total","receita_linha","receita_total","dotacao_funcao"],"type":"string"},"subfunction":{"anyOf":[{"enum":["06.181","06.182","08.243","08.244","10.301","10.302","12.361","12.365","13.392","15.451","15.452","15.453","16.482","17.512","18.541","26.782","27.812"],"type":"string"},{"type":"null"}],"default":null,"description":"For despesa_subfuncao: the function and subfunction, e.g. '15.451' (Infraestrutura Urbana)"}},"required":["series","jurisdiction"],"type":"object"}},{"description":"Fetches one of a fixed list of Censo 2022 series for a municipality from IBGE (SIDRA agregados) and returns its aggregates as figures: the population and its age groups, households, persons by household income per capita in minimum wages, adults by education, colour or race, and sewage disposal; each figure is transcribed, or a sum of published categories the code made and names.\nUse when: a number about a municipality's people or households is needed to size a policy the engine cannot price: how many children aged 0 to 3, how many persons live on up to half a minimum wage per capita | an official count to multiply by a unit cost from the bill with calc.combine\nAvoid when: the persons frame the engine simulates \u2014 data.population builds it | a number stated in the bill or on an official page \u2014 data.cite locates it in the text | a series not on the list: say so instead of estimating it\nCheck after: the label: the municipality, the census year and the table each figure was read from | cache_hit and fetched_at: when IBGE served the response\nOften followed by: calc.combine","name":"data__sidra","parameters":{"additionalProperties":false,"properties":{"jurisdiction":{"description":"The 7-digit IBGE code of the municipality","pattern":"^[0-9]{7}$","type":"string"},"series":{"description":"The whitelisted Censo 2022 series \u2014 population_total_2022: resident population; population_0_3_2022: children aged 0 to 3; population_0_5_2022: children aged 0 to 5; population_6_14_2022: children and adolescents aged 6 to 14; population_65plus_2022: persons aged 65 or more; households_2022: occupied permanent private households and the persons living in them; persons_by_income_class_2022: persons in occupied private households by household income per capita, in minimum wages (totals per class, and up to 1/4 and up to 1/2 of a minimum wage); adults_by_education_2022: persons aged 18 or more by level of education; population_by_race_2022: resident population by colour or race; sewage_2022: share of occupied permanent private households by type of sewage disposal","enum":["population_total_2022","population_0_3_2022","population_0_5_2022","population_6_14_2022","population_65plus_2022","households_2022","persons_by_income_class_2022","adults_by_education_2022","population_by_race_2022","sewage_2022"],"type":"string"}},"required":["series","jurisdiction"],"type":"object"}},{"description":"DerSimonian\u2013Laird random-effects mean of estimates of the same effect in the same unit, with \u03c4\u00b2, I\u00b2 and the number of independent studies.\nUse when: several studies estimate the same effect in the same unit and the question asks what the literature finds overall\nAvoid when: estimates of different outcomes or in different units \u2014 do not pool | several estimates from one study or one sample \u2014 pool one per study; they are not independent (the tool declines)\nCheck after: k: with one study the pool is that study and \u03c4\u00b2 is not identified | i2 above 75%: report the spread, not only the mean | with fewer than five studies the DerSimonian\u2013Laird interval tends to be too narrow\nOften followed by: core.scale_effect","name":"evidence__pool_dl","parameters":{"additionalProperties":false,"properties":{"estimates":{"items":{"additionalProperties":false,"properties":{"ci_high":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null},"ci_level":{"default":0.95,"description":"Level of the published interval","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"ci_low":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null},"estimate":{"type":"number"},"id":{"description":"Estimate id","type":"string"},"se":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Standard error; derived from the interval when omitted"},"study_id":{"description":"Study id; one estimate per study enters the pool","type":"string"}},"required":["id","study_id","estimate"],"type":"object"},"minItems":1,"type":"array"},"level":{"default":0.95,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"unit":{"description":"The common unit of every estimate (do not pool across units)","type":"string"}},"required":["estimates","unit"],"type":"object"}},{"description":"Difference in means between randomly assigned treatment and control groups, estimated by OLS with optional baseline covariates, with robust or cluster-robust errors.\nUse when: treatment was assigned at random (an experiment or a lottery) and everyone assigned was treated | assignment was by clusters (schools, villages, municipalities): pass cluster=\nAvoid when: assigned units did not all take up the treatment and the question is the effect of take-up \u2014 use infer.wald_late | fewer than about 30 units or 10 clusters \u2014 add infer.fisher_exact or infer.randomization_inference for the p-value\nCheck after: n_clusters when assignment was clustered | baseline covariates look balanced between arms\nOften followed by: infer.randomization_inference","name":"infer__ate","parameters":{"additionalProperties":false,"properties":{"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column when assignment was by group"},"covariates":{"description":"Baseline covariates for precision","items":{"type":"string"},"type":"array"},"dataset":{"description":"Dataset id","type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"treatment":{"description":"0/1 treatment-assignment column","type":"string"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","treatment"],"type":"object"}},{"description":"McCrary test for a jump in the density of the running variable at the cutoff, which would signal sorting or manipulation; an exact count test near the cutoff when the McCrary statistic is undefined.\nUse when: before trusting any regression-discontinuity estimate | checking whether units bunch just above or below an eligibility threshold\nAvoid when: the running variable takes few distinct values \u2014 the test has little power; say so\nCheck after: p_value below 0.05 signals sorting at the cutoff: the RD estimate is not credible as it stands | method 'binomial': the density on one side fell to about zero, so McCrary's \u03b8 was undefined and the p-value compares the counts just below and just above the cutoff","name":"infer__density_test","parameters":{"additionalProperties":false,"properties":{"bandwidth":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Smoothing bandwidth; automatic when omitted"},"bin_size":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Histogram bin width; automatic when omitted"},"cutoff":{"default":0.0,"type":"number"},"dataset":{"description":"Dataset id","type":"string"},"running":{"description":"Running variable column","type":"string"}},"required":["dataset","running"],"type":"object"}},{"description":"Classic difference-in-differences: the treated \u00d7 post interaction with robust or clustered errors, plus the four group-period means.\nUse when: exactly two groups (treated and comparison) observed before and after one policy date, e.g. a law in one state compared with a neighbour\nAvoid when: several adoption dates across units \u2014 use infer.did_staggered | treatment was randomized \u2014 use infer.ate\nCheck after: with two periods parallel trends cannot be tested \u2014 say so | cluster at the level at which treatment varies | design: a balanced unit panel is estimated in first differences","name":"infer__did_2x2","parameters":{"additionalProperties":false,"properties":{"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column (the level at which treatment varies)"},"controls":{"items":{"type":"string"},"type":"array"},"dataset":{"description":"Dataset id","type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"post":{"description":"0/1 column: observation is after the policy","type":"string"},"treated":{"description":"0/1 column: unit belongs to the treated group","type":"string"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","treated","post"],"type":"object"}},{"description":"Heterogeneity-robust difference-in-differences for staggered adoption: group-time ATTs against never-treated (or not-yet-treated) units, aggregated to an overall ATT and an event-time profile, with a unit bootstrap.\nUse when: municipalities, schools or firms adopt a policy in different periods | effects may differ across adoption cohorts or grow with time since adoption\nAvoid when: all treated units adopt at once and there are two periods \u2014 infer.did_2x2 is enough | there are no never-treated or not-yet-treated units \u2014 there is no valid comparison; say so\nCheck after: pretrend_mean: placebo ATTs before adoption should be near zero | n_never_treated: few comparison units make the estimate fragile | cohort ATTs that differ widely (att_gt, by_cohort): the overall average hides heterogeneity","name":"infer__did_staggered","parameters":{"additionalProperties":false,"properties":{"control_group":{"default":"never_treated","enum":["never_treated","not_yet_treated"],"type":"string"},"dataset":{"description":"Dataset id","type":"string"},"first_treat":{"description":"Column with the first treated period of each unit; 0 or missing for never-treated units","type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"n_boot":{"default":199,"description":"Unit bootstrap replications for standard errors","maximum":5000,"minimum":0,"type":"integer"},"seed":{"default":0,"type":"integer"},"time":{"description":"Integer period column","type":"string"},"unit":{"description":"Unit id column","type":"string"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","unit","time","first_treat"],"type":"object"}},{"description":"Regression of the outcome on leads and lags of adoption with unit and time effects, with a joint test that pre-adoption coefficients are zero.\nUse when: checking parallel pre-trends and the time profile around adoption with a common comparison group\nAvoid when: adoption is staggered and effects differ by cohort \u2014 read the event-time profile from infer.did_staggered\nCheck after: pretrends_p: a low p-value means pre-trends are not parallel","name":"infer__event_study","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"first_treat":{"description":"First treated period; 0 or missing for never treated","type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"time":{"description":"Integer period column","type":"string"},"unit":{"description":"Unit id column","type":"string"},"window_max":{"default":6,"description":"Latest relative period (binned above)","type":"integer"},"window_min":{"default":-6,"description":"Earliest relative period (binned below)","type":"integer"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","unit","time","first_treat"],"type":"object"}},{"description":"Within regression on panel data: coefficients identified from changes inside each unit, optionally with time effects, errors clustered by unit; reports the pooled slope beside the within slope.\nUse when: panel data (the same units observed repeatedly) where unobserved time-invariant traits of the units may be correlated with the regressor | a pooled regression and a within regression may disagree (Simpson's paradox)\nAvoid when: units switch into a treatment at different times and effects may vary \u2014 use infer.did_staggered | one observation per unit \u2014 use infer.ols\nCheck after: the pooled_vs_within table and sign_flip: opposite signs mean between-unit confounding | within_sd of the regressor: little within-unit variation means an imprecise estimate; scale effects by it, not by the total SD | n_clusters: few units make clustered errors unreliable","name":"infer__fe","parameters":{"additionalProperties":false,"properties":{"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column; defaults to the unit"},"dataset":{"description":"Dataset id","type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"time":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Time column; adds time fixed effects when given"},"unit":{"description":"Unit id column (municipality, household, firm)","type":"string"},"x":{"description":"Time-varying regressors of interest","items":{"type":"string"},"minItems":1,"type":"array"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","x","unit"],"type":"object"}},{"description":"Exact p-value of the sharp null by enumerating every assignment with the observed number treated.\nUse when: a very small completely randomized experiment (for example 8 or 20 units)\nAvoid when: stratified or clustered assignment \u2014 use infer.randomization_inference with strata= or cluster=\nCheck after: whether the p-value is exact or a Monte Carlo fallback (diagnostic 'exact')","name":"infer__fisher_exact","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"max_enumeration":{"default":2000000,"description":"Above this many assignments, fall back to Monte Carlo","type":"integer"},"seed":{"default":0,"type":"integer"},"statistic":{"default":"abs_diff_means","enum":["abs_diff_means","diff_means"],"type":"string"},"treatment":{"description":"0/1 treatment-assignment column","type":"string"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","treatment"],"type":"object"}},{"description":"Two-stage least squares: the effect of an endogenous regressor identified by excluded instruments, with the first stage, its F statistic and, when overidentified, a Sargan test.\nUse when: the regressor of interest is self-selected or correlated with unobservables, and some variable shifts it without affecting the outcome directly (a lottery offer, distance, historical settler mortality, rainfall, twins or same-sex siblings) | a randomized encouragement with imperfect take-up and several instruments or controls\nAvoid when: one binary instrument and one binary treatment \u2014 infer.wald_late states ITT, compliance and LATE directly | no credible instrument exists \u2014 say so instead of inventing one\nCheck after: first_stage_F for each endogenous regressor: below 10 means a weak instrument and an unreliable estimate | overid_p when there are more instruments than endogenous regressors (a low p casts doubt on exclusion) | the first-stage sign makes economic sense\nOften followed by: infer.ols, core.scale_effect","name":"infer__iv_2sls","parameters":{"additionalProperties":false,"properties":{"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column"},"dataset":{"description":"Dataset id","type":"string"},"endog":{"description":"Endogenous regressor(s) whose effect is wanted","items":{"type":"string"},"minItems":1,"type":"array"},"exog":{"description":"Included exogenous controls","items":{"type":"string"},"type":"array"},"instruments":{"description":"Excluded instrument(s)","items":{"type":"string"},"minItems":1,"type":"array"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"se":{"default":"HC1","description":"Variance when not clustered","enum":["classical","HC1"],"type":"string"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional pandas query selecting rows, e.g. 'baseco == 1'"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","endog","instruments"],"type":"object"}},{"description":"Wald test of linear restrictions on OLS coefficients, such as equality of two coefficients or a joint zero: an F statistic, or a Wald chi-square when errors are clustered.\nUse when: testing whether two coefficients are equal or satisfy a linear restriction | testing whether a group of coefficients is jointly zero\nAvoid when: testing pre-trends of an event study \u2014 infer.event_study reports its own joint test\nCheck after: the diagnostic 'statistic': F against F(m, n \u2212 k), or a Wald chi-square against \u03c7\u00b2(m) when clustered | df_denominator (residual degrees of freedom) is not tiny","name":"infer__linear_hypothesis","parameters":{"additionalProperties":false,"properties":{"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column"},"dataset":{"description":"Dataset id","type":"string"},"hypothesis":{"description":"Linear restriction(s) on the coefficients, e.g. 'ttl_exp = 2*yrs_school' or 'a = 0, b = 0'","type":"string"},"se":{"default":"HC1","enum":["classical","HC1","HC2","HC3"],"type":"string"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional pandas query selecting rows, e.g. 'baseco == 1'"},"x":{"description":"All regressors of the unrestricted model","items":{"type":"string"},"minItems":1,"type":"array"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","x","hypothesis"],"type":"object"}},{"description":"Smallest effect a two-arm study of a given size can detect at the chosen significance and power, allowing for clustering.\nUse when: planning an evaluation with a fixed sample: what effect could it detect?\nAvoid when: the question is how many units are needed for a target effect \u2014 use infer.sample_size\nCheck after: the icc and cluster_size used when assignment is by cluster","name":"infer__mde","parameters":{"additionalProperties":false,"properties":{"alpha":{"default":0.05,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"cluster_size":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Units per cluster, for clustered designs"},"icc":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Intra-cluster correlation, for clustered designs"},"n":{"description":"Total units (or clusters \u00d7 cluster_size when clustered)","exclusiveMinimum":1,"type":"integer"},"power":{"default":0.8,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"sd":{"default":1.0,"description":"Outcome standard deviation (1 gives the MDE in SD units)","exclusiveMinimum":0,"type":"number"},"share_treated":{"default":0.5,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"}},"required":["n"],"type":"object"}},{"description":"Difference in means for a completely randomized experiment with the conservative Neyman variance s\u2081\u00b2/n\u2081 + s\u2080\u00b2/n\u2080.\nUse when: a completely randomized experiment with individual assignment and the design-based variance is wanted\nAvoid when: assignment by clusters \u2014 use infer.ate with cluster=\nCheck after: group sizes n_treated and n_control","name":"infer__neyman","parameters":{"additionalProperties":false,"properties":{"dataset":{"description":"Dataset id","type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"treatment":{"description":"0/1 treatment-assignment column","type":"string"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","treatment"],"type":"object"}},{"description":"Least-squares regression of an outcome on regressors with classical, heteroskedasticity-robust or cluster-robust standard errors; one coefficient figure per regressor of interest.\nUse when: treatment was randomly assigned and the question is its effect (pass cluster= when assignment was by school, village or municipality) | the question asks for an association or a comparison adjusted for observed controls | reproducing a published regression table\nAvoid when: the regressor is chosen by the units or correlated with unobservables and an instrument exists \u2014 use infer.iv_2sls | treatment switches at a cutoff of a running variable \u2014 use infer.rdd | units adopt a policy in different periods \u2014 use infer.did_staggered | repeated observations of the same units with time-invariant unobserved traits \u2014 use infer.fe | fixed effects with thousands of levels (one per municipality in a long panel) \u2014 use infer.fe, which absorbs them\nCheck after: n_clusters: with fewer than about 40 clusters cluster-robust errors are unreliable (consider infer.randomization_inference) | the standard-error type matches how treatment was assigned or how the sample was drawn | warnings naming columns dropped as collinear or rows dropped for missing values\nOften followed by: infer.linear_hypothesis, core.scale_effect","name":"infer__ols","parameters":{"additionalProperties":false,"properties":{"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column; required when treatment or sampling happened at a group level"},"controls":{"description":"Other regressors (not reported as figures)","items":{"type":"string"},"type":"array"},"dataset":{"description":"Dataset id","type":"string"},"fe":{"description":"Categorical columns absorbed as fixed effects","items":{"type":"string"},"type":"array"},"intercept":{"default":true,"description":"Include a constant; False for regression through the origin","type":"boolean"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"se":{"default":"HC1","description":"Variance when not clustered","enum":["classical","HC1","HC2","HC3"],"type":"string"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional pandas query selecting rows, e.g. 'baseco == 1'"},"weights":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Weight column (weighted least squares)"},"x":{"description":"Regressors of interest; one coefficient figure each","items":{"type":"string"},"minItems":1,"type":"array"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","x"],"type":"object"}},{"description":"Probability that a two-arm study of a given size detects a given effect.\nUse when: whether a planned or completed study was large enough to detect an effect of a given size\nAvoid when: the question asks for a sample size \u2014 use infer.sample_size","name":"infer__power","parameters":{"additionalProperties":false,"properties":{"alpha":{"default":0.05,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"cluster_size":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"default":null},"effect":{"description":"Effect in outcome units","type":"number"},"icc":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"default":null},"n":{"exclusiveMinimum":1,"type":"integer"},"sd":{"default":1.0,"exclusiveMinimum":0,"type":"number"},"share_treated":{"default":0.5,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"}},"required":["n","effect"],"type":"object"}},{"description":"Re-draws the assignment under the actual design (simple, stratified or clustered) and compares the observed difference in means with its distribution under the sharp null of no effect.\nUse when: small samples or few clusters, where asymptotic standard errors are unreliable | a p-value for the sharp null that respects how assignment was actually done\nAvoid when: the sample is small enough to enumerate every assignment \u2014 infer.fisher_exact gives the exact p-value\nCheck after: n_perm is large enough for the precision the p-value is reported with (p_value_mc_se)","name":"infer__randomization_inference","parameters":{"additionalProperties":false,"properties":{"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column when assignment was by cluster"},"dataset":{"description":"Dataset id","type":"string"},"n_perm":{"default":2000,"description":"Re-randomizations","maximum":100000,"minimum":100,"type":"integer"},"seed":{"default":0,"type":"integer"},"strata":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Stratum column when assignment was stratified"},"treatment":{"description":"0/1 treatment-assignment column","type":"string"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","treatment"],"type":"object"}},{"description":"Sharp regression-discontinuity effect at a cutoff from local linear (or quadratic) fits on each side within a bandwidth (Imbens\u2013Kalyanaraman by default, triangular kernel), with estimates at half and double the bandwidth.\nUse when: eligibility or treatment switches at a known threshold of a running variable: population, test score, income, vote margin, age, distance to a border | the question is the effect for units near the threshold\nAvoid when: units can manipulate the running variable around the cutoff \u2014 run infer.density_test first and report it | the treatment probability jumps but not from 0 to 1 (fuzzy design): this version estimates the jump in the outcome only; report it as intention to treat\nCheck after: infer.density_test at the same cutoff (no bunching) | the sensitivity table: the estimate should be stable at half and double the bandwidth | n_left and n_right inside the bandwidth\nOften followed by: infer.density_test","name":"infer__rdd","parameters":{"additionalProperties":false,"properties":{"bandwidth":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Bandwidth; Imbens\u2013Kalyanaraman optimal when omitted"},"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column"},"cutoff":{"default":0.0,"description":"Threshold of the running variable at which treatment switches","type":"number"},"dataset":{"description":"Dataset id","type":"string"},"kernel":{"default":"triangular","enum":["triangular","uniform"],"type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"polynomial":{"default":1,"description":"Local polynomial order on each side","enum":[1,2],"type":"integer"},"running":{"description":"Running variable column","type":"string"},"subset":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional pandas query selecting rows, e.g. 'baseco == 1'"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","running"],"type":"object"}},{"description":"Number of units a two-arm study needs to detect a target effect at the chosen significance and power, allowing for clustering.\nUse when: how many households, students or municipalities are needed to detect an effect of a given size\nAvoid when: the sample size is fixed and the question is the detectable effect \u2014 use infer.mde\nCheck after: the design effect implied by icc and cluster_size","name":"infer__sample_size","parameters":{"additionalProperties":false,"properties":{"alpha":{"default":0.05,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"cluster_size":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}],"default":null},"effect":{"description":"Target effect in outcome units","exclusiveMinimum":0,"type":"number"},"icc":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"default":null},"power":{"default":0.8,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"sd":{"default":1.0,"description":"Outcome standard deviation","exclusiveMinimum":0,"type":"number"},"share_treated":{"default":0.5,"exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"}},"required":["effect"],"type":"object"}},{"description":"Regression of an outcome on a treatment indicator with unit and time fixed effects, errors clustered by unit.\nUse when: treated units all adopt at the same time and a panel regression benchmark is wanted | reproducing a published TWFE estimate\nAvoid when: staggered adoption with effects that vary across cohorts or over time \u2014 TWFE can be badly biased or flip sign; use infer.did_staggered\nCheck after: staggered: when adoption dates differ across units, compare with infer.did_staggered","name":"infer__twfe","parameters":{"additionalProperties":false,"properties":{"covariates":{"items":{"type":"string"},"type":"array"},"dataset":{"description":"Dataset id","type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"time":{"description":"Period column","type":"string"},"treat":{"description":"0/1 column: unit is treated in this period","type":"string"},"unit":{"description":"Unit id column","type":"string"},"y":{"description":"Outcome column","type":"string"}},"required":["dataset","y","treat","unit","time"],"type":"object"}},{"description":"Intention-to-treat effect of a binary offer, the compliance difference (first stage) and their ratio, the local average treatment effect on compliers, with its standard error.\nUse when: a randomized offer or encouragement with imperfect take-up, and the question is the effect of actually receiving the treatment | one-sided non-compliance (control units could not take up)\nAvoid when: compliance is perfect \u2014 use infer.ate | several or continuous instruments, or controls \u2014 use infer.iv_2sls\nCheck after: first_stage near zero (first_stage_F below 10) means a weak instrument | itt and first_stage from the same rows (same_sample) | one_sided: with no take-up outside the offer the LATE is the effect on the treated","name":"infer__wald_late","parameters":{"additionalProperties":false,"properties":{"cluster":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Cluster column"},"d":{"description":"Binary treatment actually received (0/1)","type":"string"},"dataset":{"description":"Dataset id","type":"string"},"level":{"default":0.95,"description":"Confidence level of the reported intervals","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"same_sample":{"default":true,"description":"Estimate ITT and first stage on the same rows","type":"boolean"},"y":{"description":"Outcome column","type":"string"},"z":{"description":"Binary instrument: the randomized offer or encouragement (0/1)","type":"string"}},"required":["dataset","y","z","d"],"type":"object"}},{"description":"Submit the final answer and end the analysis. The answer is checked: every number must come from a tool result of this run or from the question, and every figure reference must exist.","name":"submit_answer","parameters":{"additionalProperties":false,"properties":{"answer":{"description":"The answer for the analyst, in the language of the question. Every number must come from a tool result of this run or from the question.","type":"string"},"caveats":{"description":"Diagnostics or assumptions that limit the conclusion; empty if none.","items":{"type":"string"},"type":"array"},"figure_refs":{"description":"Every figure the answer quotes, as '<call_id>:<key>'.","items":{"type":"string"},"type":"array"}},"required":["answer","figure_refs","caveats"],"type":"object"}}]