← All resources

Agent skill

SKILL.md

Use when building, reformatting, or cleaning up a regression or descriptive table for publication — journal star cutoffs (JM / MS / AER / QJE / JCR), booktabs templates, variable labels, row/column layering, significant figures, alignment, and decluttering. Sibling to visualization; never re-runs the model, never invents Notes content, never changes a number.


Format a regression or descriptive table — the figure’s sibling artifact — for publication. The discipline is narrower than for figures: tables have one job (display numbers exactly), so the rules are about formatting and presentation, never re-running the model.

For figures, see ../visualization/SKILL.md. For the validity audit that should run before any table is drafted, see report → Pre-report Validity Check.

For the design rationale behind the “Design principles” checklist below — outcome labels, comparison-driven orientation, width allocation, the two-digit rule, alignment, and decluttering — see references/design-principles.md. It collects the standard sources (Schwabish, Gelman, Ehrenberg, Keith Head, booktabs).


When to Use

Do not use this when the underlying numbers are still moving — format last, after the analysis is frozen.


Non-negotiable rules

  1. Never change a number. Coefficients, SEs, p-values, N, R² — round only to whatever the source provided unless the user explicitly asks for fewer decimals.
  2. Never re-run the regression. The table is the input; this skill formats it. If the source lacks a quantity (e.g. adjusted R²), flag it; do not compute it.
  3. Never invent the “Notes” line. Notes content must come from the source or from explicit user input.
  4. Stars must match the journal’s convention exactly (table below).

Design principles — the short list

A table is read, not glanced at: it exists to let the reader find an exact number and compare it to its neighbor. Every rule below serves one of those two jobs. Full rationale and sources in references/design-principles.md.


Journal-specific conventions

Journal Booktabs Star cutoffs Notes
Journal of Marketing Yes, three-line header * p<.10, ** p<.05, *** p<.01 Coefficients above SEs (in parentheses); 1 decimal for percentages
Marketing Science Yes Same as JM R² and adjusted R² always reported
American Economic Review Yes * p<.10, ** p<.05, *** p<.01 SEs below coefficients
Quarterly Journal of Economics Yes Same as AER Extra panel separator

Estimation observations and specification rows

Use the row label Observations, meaning estimation observations, with a count for each specification, except for standalone GMM reporting below. Do not label it N or append (unit-periods). Define the observation unit in the notes when needed, for example, “Observations are firm-months.”

For panel DiD, distinguish only these two cases:

Estimation observations need not equal the number of units multiplied by the number of weeks, including in staggered DiD. That equality holds only when the counted sample is the complete retained unit-by-week panel; staggered adoption alone does not imply inequality.

Obtain counts from the R estimator’s verified accessor or saved sample metadata, following the DiD package guidance. For panel did::att_gt() results, the analysis should supply nrow(res$DIDparams$data) as Observations and res$n as the optional unit count. The current did package’s nobs() returns units, whereas fixest returns estimation rows. Do not automatically relabel either as the other’s quantity. Any retained-sample audit belongs to the analysis workflow and must use package-produced records or inclusion indicators after the estimator’s exclusions; do not reconstruct eligibility from the raw data. Do not sum counts across reused comparisons. An overall count does not imply every event-time effect uses every record. Under this formatting skill, flag a missing or ambiguous count rather than rerunning estimation or constructing a new count.

Standalone GMM tables: when reporting GMM results alone, including Chen–Sant’Anna–Xie efficient DiD, use Units as the sample-size row and omit Observations by default. This is the user’s reporting convention. Report distinct retained estimation units from verified package metadata. For gmm::gmm(), NROW(fit$gt) supplies that count only when there is exactly one moment-matrix row per retained unit; otherwise obtain the unique-unit count from the saved estimation sample. Moment rows, clusters, and moment conditions are not automatically units. In a table comparing GMM with other estimators, keep Units and Observations distinct; never put a unit count in an Observations row or force an unavailable panel count.

Report actual fixed-effect dimensions with labels such as Firm FE and Calendar-month FE, rather than numbers of firms or periods. Include these rows only when they describe the estimator used; do not impose a TWFE specification on staggered DiD. Separate unit and period counts are optional when they materially clarify sample support. Fixed-effect labels do not replace the observation definition or count.

Put clustering level and any supplied cluster count in the notes by default, not separate table rows. Identify column-specific differences in the notes; use rows only when those differences are clearer to compare there.

The Notes block

A table’s notes display as one continuous paragraph, beginning with Notes: once. Use sentences to organize the content by type. Allow automatic line wrapping to the table width, but do not insert paragraph breaks, forced line breaks, bullets, or separate note items. In LaTeX, use one \item inside tablenotes; in HTML, use one <p>. The paragraph ends with the following information when applicable:

Place the remaining content earlier in the same paragraph, in the order below. These categories organize sentences; they are not separate displayed paragraphs or headings. Use this menu to select what readers need to interpret the display; it is not a checklist to reproduce in every note. Avoid repeating information already clear in the caption, labels, or table body:

  1. Scope — what the table reports and over what: estimator/method (OLS, 2SLS, logit, marginal effects), sample and population, time period, unit of observation, the meaning of Observations and relevant exclusions, and the dependent variable if it isn’t in the caption. Do not repeat the observation count already shown in the table.
  2. Specification — fixed-effect and control sets included, weighting (sample weights, IPW), coefficient scale/transform (logs, standardized, percentage points), winsorizing/trimming, and the baseline or DV mean that sizes the coefficients.
  3. Definitions — expand abbreviations and constructed measures; say what any reference line, cutoff, or shaded region means (ask the user; never guess — non-negotiable rule 3).
  4. Provenance & cross-refs — Source: …; “See Table 3 / column (2)”; data vintage or replication pointer.

So “add a note that the sample drops 2020” slots into Scope/Specification near the beginning. “We now cluster at the state level” replaces the existing parenthetical key before the legend. A new abbreviation joins the Definitions sentences. When editing an existing notes block, insert content by type and retain a single paragraph, with the applicable inference key and legend at the end.

Figures use the same note, written in the TeX caption/note. The visualization skill keeps text out of the image, so a figure’s “note” lives in the LaTeX float, not the PNG. Same menu as above, plus figure-specific items: what error bars or bands represent (95% CI, ±1 SE, bootstrap reps) and the SE type behind them; binning / bandwidth / kernel / smoother; what each series, color, or reference line is when not directly annotated; N and number of clusters; axis units or scale when non-obvious. See ../visualization/SKILL.md.

Concise notes without defensive prose

Apply paper-writing’s scope guidance and evidence-preserving voice: add a qualification when omitting it would change the reader’s interpretation, confidence in the result, or use of it. State the supported information directly. A note should make the display understandable on its own; fuller methodological justification and general limitations belong in methods or discussion.

Keep necessary definitions, sample restrictions, reference categories, and inference details. Remove stacked hedges, generic disclaimers, repeated limitations, and procedural narration that add no understanding. Prefer precise labels such as “Unadjusted association” when accurate over appending a general warning about causality. Retain a local caveat when this particular display would otherwise mislead; brevity is not a reason to conceal a material limitation.

Keep source checks and unresolved author questions outside the publication note. Resolve a missing detail from the available material or raise it with the author; do not fill the gap with speculative or defensive prose. For example, when supported, “Standard errors clustered at the firm level are in parentheses” needs no added account of how the wording was verified or why influence scores were not described.

Inference wording for tables and figures

State the inference method and clustering level in reader-facing language, using the source output, code, or explicit user input as evidence. Apply the concise-note rule above when deciding how much detail to include.

Workflow

Identify journal + input → Parse → Apply rules → Validate → Emit

Step 1 — Identify the target journal and input format

One question: target journal and input file (or pasted text). If both already provided, skip.

Source formats commonly seen:

Step 2 — Parse

Extract: variable names, coefficients, standard errors (or t-stats), estimation-observation counts and their definitions, R², F-stat, dependent variable label. Verify the meaning of a source field named N before labeling it Observations.

Keep each estimate attached to its source outcome, specification, sample, uncertainty, and applicable note. Use row/column identifiers in the working representation so reordering and relabeling preserve these associations.

Step 3 — Apply the rules

Two layers, in order:

Journal rules (mechanical): header rows (\toprule, column titles, \midrule); coefficient rows with SE in parentheses (or below, per journal); significance stars per the journal’s convention; summary rows (\midrule, then Observations, or Units for standalone GMM, R² when applicable); \bottomrule; notes line (\multicolumn{...}{l}{\textit{Notes:} ...}).

Design pass (presentation): identify the comparison readers need to make, then choose row/column orientation or stacked panels to support it. Relabel cryptic variable names (ask the user when a name is ambiguous — never guess what an abbreviation means); name the substantive outcome in the header and move measurement qualifications into the notes. Set a consistent decimal count per column; allocate width for complete estimates and intervals, wrapping labels and headers before adjusting padding; demote controls to a panel if the headline rows are crowded. The design pass changes labels, layout, and decimal display — never the underlying values (see Non-negotiable rule 1).

Step 4 — Validate

If a check fails, repair the formatting from the source and repeat the affected checks. If the source cannot resolve the discrepancy, report it outside the publication note and leave the output unverified. Do not emit a table as final until the checks pass; a more attractive layout cannot compensate for an incorrect association.

Step 5 — Emit (compile-ready snippet)

% Requires booktabs and threeparttable. Keep only applicable note content.
\begin{table}[ht]
\centering
\begin{threeparttable}
\caption{<from user>}
\label{tab:<from user>}
\begin{tabular}{lcc}
\toprule
 & (1) & (2) \\
\midrule
... & ... & ... \\
\midrule
Observations & ... & ... \\
$R^2$    & ... & ... \\
\bottomrule
\end{tabular}
\begin{tablenotes}[flushleft]
\small
\item \textit{Notes:} <scope, specification, definitions, source — in reading order, from source/user>. Standard errors clustered at the <level> are in parentheses. ${}^{*}\,p<0.1$, ${}^{**}\,p<0.05$, ${}^{***}\,p<0.01$.
\end{tablenotes}
\end{threeparttable}
\end{table}

Notes for extending


Report

Output uses the Quick Template — three labeled lines, Definition / Description / Takeaway. (For multi-section writeups, see report.)

Definition (measure): Tables produced (count, target journal, output paths); whether all coefficients survived validation; whether the notes line came from source or user; which design-pass changes were made (relabels, re-ordering, decimal harmonization). Analyses: Journal-specific rules applied (star cutoffs, SE placement, R² reporting); design rules applied; deviations from the source format that required user confirmation. Takeaway: Whether the table is submission-ready or has flagged validation failures (silent coefficient drop, missing R², star/p-value mismatch) requiring human sign-off.