From agent-skills
Use when generating publication-quality LaTeX tables and figures from PyFixest econometric models, including regression tables, event study plots, and summary statistics for academic research papers.
npx claudepluginhub agentic-assets/agent-skillsThis skill uses the workspace's default tool permissions.
7 functions for converting PyFixest models to publication-quality LaTeX tables and figures.
assets/1---example_summary_statistics.pyassets/2---example_figure_usage.pyassets/3---example_enhanced_table_generator.pyassets/4---run_all_examples.pyassets/example_did_analysis_template.pyassets/pyfixest_latex/__init__.pyassets/pyfixest_latex/academic_figure_generator.pyassets/pyfixest_latex/academic_table_generator.pyreferences/common-patterns.mdreferences/data-requirements.mdreferences/did-template-guide.mdreferences/did-template-quick-reference.mdreferences/figures-api.mdreferences/stargazer-alternative.mdreferences/tables-api.mdreferences/troubleshooting.mdreferences/workflow-patterns.mdscripts/__pycache__/setup_module.cpython-313.pycscripts/setup_module.pySearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Share bugs, ideas, or general feedback.
7 functions for converting PyFixest models to publication-quality LaTeX tables and figures.
Tables (4): regression, dynamic/event study, robustness (grouped), summary statistics Figures (3): event study plot, treatment assignment heatmap, coefficient comparison
python <skill-path>/scripts/setup_module.py /path/to/project
assets/pyfixest_latex/ to your project rootpip install pyfixest pandas numpy scipy matplotliboutput/tables/ and output/figures/from pyfixest_latex import set_output_path, set_figure_output_path
set_output_path("Results/Tables") # or any absolute/relative path
set_figure_output_path("Results/Figures") # or any absolute/relative path
import pyfixest as pf
from pyfixest_latex import (
set_output_path, set_figure_output_path,
create_regression_table, create_event_study_plot,
create_summary_statistics_table
)
# 1. Configure output paths
set_output_path("Results/Tables")
set_figure_output_path("Results/Figures")
# 2. Fit models
m1 = pf.feols("Y ~ treat | unit + year", data, vcov={"CRV1": "unit"})
m2 = pf.feols("Y ~ treat + X1 | unit + year", data, vcov={"CRV1": "unit"})
# 3. Generate table
create_regression_table(
models=[m1, m2],
model_names=["Basic", "Controls"],
title="Treatment Effects",
label="tab:main",
variable_labels={"treat": "Treatment Effect", "X1": "Control Variable"},
depvar_labels={"Y": "Outcome Variable"},
felabels={"unit": "Unit FE", "year": "Year FE"}
)
# → Saves: Results/Tables/main_regression.tex
| Function | Purpose | Key Params |
|---|---|---|
create_regression_table() | Multi-model comparison | models, model_names, title, label |
create_dynamic_table() | Event study coefficients | models, time_var, treat_var, reference_period, treatment_period |
create_robustness_table() | Grouped specifications | model_groups, group_names |
create_summary_statistics_table() | Descriptive stats | data (DataFrame), variables, variable_labels |
| Function | Purpose | Key Params |
|---|---|---|
create_event_study_plot() | Dynamic effects plot | model, style (errorbar/filled/step), confidence_level |
create_treatment_assignment_plot() | Treatment timing heatmap | data, unit, time, treat |
create_coefficient_comparison_plot() | Forest plot across specs | models, model_names, use_ci |
| Function | Purpose |
|---|---|
set_output_path(path) | Configure table output directory |
set_figure_output_path(path) | Configure figure output directory |
list_saved_tables() | List generated .tex files |
list_saved_figures() | List generated .png/.pdf files |
Full API: See references/tables-api.md and references/figures-api.md
Complete DiD Analysis Template (849 lines):
assets/example_did_analysis_template.py - Production-ready DiD analysis with DidConfig classModular Function Examples:
assets/1---example_summary_statistics.py - Standalone summary stats demonstrationassets/2---example_figure_usage.py - Standalone figure generation examplesassets/3---example_enhanced_table_generator.py - Standalone table generation examplesassets/4---run_all_examples.py - Orchestrator to run all modular examplesWhich to use?
Use these guides to learn specific patterns and troubleshoot issues:
Starting Out?
Preparing Data?
Need Usage Examples?
DiD Template Documentation?
Customizing Functions?
Troubleshooting?
Using Statsmodels Instead of PyFixest?
type="tex" in PyFixest — the module calls pf.etable(..., type="tex") internallytreatment_period to create_dynamic_table() and create_event_study_plot() for correct relative-time labels ($t_{-2}$, $t_0$, $t_{+1}$)label parameter: {label}_regression.tex, {label}_dynamic.tex, etc.\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{graphicx}
\usepackage{makecell} % for multi-line cells with \makecell
% Tables
\input{Results/Tables/main_regression.tex}
\input{Results/Tables/event_study_dynamic.tex}
% Figures
\begin{figure}[ht!]
\centering
\includegraphics[width=0.9\textwidth]{Results/Figures/event_study.png}
\caption{Event Study: Treatment Effects Over Time}
\label{fig:event_study}
\end{figure}
All tables use this LaTeX structure:
\begin{table}[ht!]
\centering
\caption{\\Title}
\parbox{\linewidth}{\footnotesize Notes text here}
\label{tab:label}
\footnotesize
\begin{threeparttable}
\begin{tabular}{lccc}
...
\end{tabular}
\end{threeparttable}
\end{table}