This data science platform offers a modern introduction to econometrics by combining cloud-based Python notebooks with AI learning tools from NotebookLM.
Designed as an interactive companion to Colin Cameron's textbook, Analysis of Economics Data: An Introduction to Econometrics, metricsAI transforms static chapters into dynamic learning experiences. Students can access AI summaries, Python code, and practical examples directly in their browsers via Google Colab. There is zero setup or installation required, and the notebooks feature built-in AI tools for code generation, explanation, and transformation.
Click any badge below to open and run immediately in your browser. Every chapter includes AI video lectures, AI slides, author slides, quizzes, AI tutors, and audio lectures available on the project website.
| Chapter | Title | Colab Notebook | Additional Resources |
|---|---|---|---|
| 1 | Analysis of Economics Data | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 2 | Univariate Data Summary | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 3 | The Sample Mean | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 4 | Statistical Inference for the Mean | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio |
| Chapter | Title | Colab Notebook | Additional Resources |
|---|---|---|---|
| 5 | Bivariate Data Summary | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 6 | The Least Squares Estimator | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 7 | Statistical Inference for Bivariate Regression | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 8 | Case Studies for Bivariate Regression | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 9 | Models with Natural Logarithms | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio |
| Chapter | Title | Colab Notebook | Additional Resources |
|---|---|---|---|
| 10 | Data Summary for Multiple Regression | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 11 | Statistical Inference for Multiple Regression | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 12 | Further Topics in Multiple Regression | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 13 | Case Studies for Multiple Regression | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio |
| Chapter | Title | Colab Notebook | Additional Resources |
|---|---|---|---|
| 14 | Regression with Indicator Variables | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 15 | Regression with Transformed Variables | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 16 | Checking the Model and Data | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio | |
| 17 | Panel Data, Time Series Data, Causation | π¬ AI Video β’ β¨ AI Slides β’ π Author Slides β’ π Quiz β’ π€ AI Tutor β’ π§ Audio |
- Click any "Open in Colab" badge above
- Sign in with your Google account (free)
- Click "Run All" in the Runtime menu (or run cells individually)
- Explore and modify - change parameters, try different models, experiment with the data
- Save your work - File β Save a copy in Drive to keep your modifications
No installation, no downloads, no setup required!
For local development (not required for Colab usage):
# Clone and set up virtual environment
git clone https://github.com/quarcs-lab/metricsai.git
cd metricsai
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Install Playwright browser (for PDF generation only)
playwright install chromiumNEW: Selected chapters now feature AI-generated video lectures available directly on the project website!
- In-Page Video Player: Watch videos without leaving the website using an elegant modal overlay
- Large, Comfortable Viewing: Videos display at optimal size (up to 1152px wide) with responsive 16:9 aspect ratio
- Auto-Play: Videos start automatically when the modal opens
- Multiple Close Options: Close videos via X button, Escape key, or clicking outside the video
- Smart Controls: Video automatically stops playing when modal is closed, preventing background playback
- Click the π¬ AI video link in any chapter's resources
- Video opens in a modal overlay on the current page
- Watch the AI-powered lecture explaining key concepts
- Close when done - video stops automatically
Current Coverage: All 17 chapters
The AI videos complement the audio lectures and slides, providing visual explanations of econometric concepts through AI-generated presentations.
All 17 chapters have been transformed into professional, book-style educational chapters following modern pedagogical best practices. Each chapter includes:
- Visual Summary - Chapter opening image with descriptive caption providing immediate context
- "What You'll Learn" - Clear learning objectives in "How to..." format setting expectations upfront
- Contextual Introductions - 3-4 sentence paragraphs before every code section explaining:
- What the code will do
- Why this analysis matters
- What method or approach is being used
- Concept Boxes - π‘ Key statistical and econometric concepts highlighted with:
- Clear definitions
- Intuitive explanations
- Practical examples
- Conversational Conclusions - Engaging chapter summaries with:
- "What You've Learned" covering programming, statistics, economics, and methodology
- "Looking Ahead" connecting to future chapters
- Standardized References - Consistent citations to Cameron (2022) with data URLs
- Professional Formatting - Clean titles and consistent structure throughout
- 100% coverage: All 17 chapters enhanced
- ~105 context sections across all chapters (avg 6.2 per chapter)
- ~51 concept boxes across all chapters (avg 3.0 per chapter)
- Consistent structure: Same pedagogical pattern throughout
- Publication ready: Professional formatting suitable for textbook use
Each chapter includes hands-on case studies that bridge textbook theory with real economic research. Students apply econometric tools to authentic datasets with progressive tasks (guided β semi-guided β independent).
1. Economic Convergence Clubs (Mendez, 2020)
- 108 countries, 1990β2014, panel data on GDP, productivity, capital, human capital, TFP
- Used in CH01, CH02, CH04, CH07βCH12, CH14βCH17
2. Can Satellites See Development? (DS4Bolivia)
- 339 Bolivian municipalities, satellite nighttime lights + 64 embedding features, SDG indices
- Used in CH01, CH02, CH04, CH05, CH07, CH10βCH12, CH14βCH17
All data loads directly from GitHub (no downloads required). See individual chapter notebooks for case study details.
All 18 chapters are published as an interactive online book using Quarto.
- Status: β Complete - 18 chapters in 4 parts
- URL: quarcs-lab.github.io/metricsai/book/_book/
- Location:
book/directory - Features:
- Searchable full-text across all chapters
- Google Translate integration on every page
- Responsive design for desktop and mobile
- Four-part structure: Statistical Foundations, Bivariate Regression, Multiple Regression, Advanced Topics
The HTML book complements the interactive notebooks, ideal for:
- Reading without needing Google Colab
- Searching across all chapters
- Quick reference and navigation
- Students who prefer a traditional book layout
All notebooks are maintained in two synchronized formats using Jupytext:
.ipynbβ Standard Jupyter notebook (runs in Colab, contains outputs).mdβ MyST Markdown source (text-based, ideal for version control)
Edit either format β Jupytext synchronizes them automatically. Configuration is embedded in each notebook's metadata (no separate config files needed).
- Better diffs β Text-based
.mdfiles produce clean, readable git diffs - Easy editing β Edit notebooks in any text editor or IDE
- Reduced conflicts β Merge conflicts are simpler to resolve in plain text
- Full compatibility β
.ipynbfiles work in Colab/Jupyter without Jupytext installed
# Sync a single notebook after editing the .md file
jupytext --sync notebooks_colab/ch05_*.md
# Sync all notebooks
jupytext --sync notebooks_colab/*.ipynbIndividual Jupyter notebooks can be automatically exported to professional-quality PDF files using Playwright. The system preserves all content including markdown text, code, mathematical equations, tables, and figures with precise formatting control.
Generate a single chapter PDF:
# Step 1: Convert notebook to HTML
cd notebooks_colab && jupyter nbconvert --to html ch05_*.ipynb && cd ..
# Step 2: Inject CSS and generate PDF
python3 scripts/inject_print_css.py notebooks_colab/ch05_*.html notebooks_colab/ch05_*_printable.html && \
python3 scripts/generate_pdf_playwright.py ch05
# Step 3: View result
open notebooks_colab/ch05_*.pdfGenerate all chapters at once:
# Convert all notebooks to HTML
cd notebooks_colab && for nb in ch*.ipynb; do jupyter nbconvert --to html "$nb"; done && cd ..
# Generate all PDFs with Playwright
python3 scripts/generate_pdf_playwright.py --all
# Verify output
ls -lh notebooks_colab/*.pdfAll 18 chapter PDFs generated (as of 2026-02-08):
- β ch00βch17 complete (0.9β2.0 MB each, 15β72 pages each)
- β
Compiled book:
notebooks_colab/metricsAI_complete_book.pdf(62.3 MB, 900 pages)
- Justified text alignment - Professional book-style typography
- Full-width visual summaries - Chapter opening images span full page width (7 inches)
- Optimized regression tables - 7.5pt font size prevents text overflow and wrapping
- Uniform margins - 0.75 inches on all sides
- No headers/footers - Clean pages with maximum content space
- Clickable hyperlinks - URLs remain interactive without printing as text
- Brand-consistent design - Color hierarchy using project palette (Cyan, Purple, Pink, Navy)
- Modern typography - Inter font for body text (11pt), JetBrains Mono for code (9pt input, 7.5pt output)
- Professional appearance - Publication-quality, print-ready output
-
scripts/generate_pdf_playwright.py(248 lines) - Primary PDF generator using Playwright- Precise control over margins, fonts, and page layout
- Letter format (8.5" Γ 11") portrait orientation
- Handles font loading and CSS rendering
-
scripts/inject_print_css.py- CSS injection tool- Injects custom styles into HTML files
- Creates "_printable.html" versions
-
scripts/notebook_pdf_styles.css(426 lines) - Master stylesheet- All typography, colors, spacing, and layout rules
- Justified text with
@media printrules - Optimized font sizes for output blocks
Installation:
# Install Playwright
pip install playwright
# Install Playwright browsers
playwright install chromiumFor comprehensive workflow documentation, troubleshooting, and technical details, see:
log/20260129_PDF_GENERATION_WORKFLOW.md
This 600+ line document includes:
- Step-by-step workflow for single and batch processing
- Complete formatting specifications
- Troubleshooting guide with 7 common issues
- Technical details with exact CSS line numbers
- File structure and dependencies
- Future update instructions
The automated Playwright approach provides:
- Precise control - Exact margins, no unwanted headers/footers
- Consistent output - Reproducible results across all chapters
- Better CSS rendering - Full support for modern CSS features
- Font loading - Proper Google Fonts integration
- Automation - Process all 18 chapters with one command
- Production ready - Professional formatting suitable for distribution
- Student distribution - Share notebooks without requiring Python/Colab
- Print for offline study - Professional book-style formatting on paper
- Course materials - Include in syllabus or reading packs
- Archival - Preserve executed output with all figures
- Professional reports - Publication-quality documentation
Carlos Mendez - Python implementation and educational notebook development
A. Colin Cameron - Original textbook, data, Stata/R code, slides.
This project builds on Professor Cameron's excellent textbook and openly shared code examples and data, translating them into cloud-ready Python implementations for modern econometrics education.
