Lesson 5

Log-Log Elasticities

Big question

Why is the slope in a log-log model called an elasticity?

Lesson progress

Complete checkpoints as you learn

0% complete0 checkpoint streak
Progress tracking available after sign-in. Sign in to save your work.
Big question
Concept
Activity
Quiz

Learning objectives

  • Explain log-log elasticities in plain language.
  • Use exact percent effect correctly in an interpretation.
  • Connect the lesson idea to a formula, graph, Python result, or real example.

Simple explanation

A log-log coefficient says the approximate percent change in y when x rises by 1 percent. A coefficient of 0.6 means a 1 percent increase in x is associated with about a 0.6 percent increase in y.

Key terms

Exact percent effect
A log-model conversion using the exponential function rather than the small-change shortcut.
Adjusted R-squared
A fit measure that penalizes adding regressors.
Smearing factor
A retransformation adjustment for predicting y from a log(y) regression.

Core formula

log(sales)=beta0+beta1log(price)+beta2log(ads)+ulog(sales) = beta_0 + beta_1 log(price) + beta_2 log(ads) + u

Use plain-language interpretation before algebra.

Example

M6_SALES_ADVERTISING is a synthetic teaching dataset for log-log elasticities. It is designed to practice elasticity without presenting fabricated real-world empirical findings.

Interactive visual

Move a percent-change slider and compare the approximate elasticity interpretation with the exact finite-change calculation.

Original Module 6 visual for Log-Log Elasticities.

wage_sample.csv

y variable

wage

The dependent variable. It is the outcome students want to explain.

x variable

education

The explanatory variable. It is used to describe changes in wage.

Live Python

Log-Log Elasticities Python example

Log-Log Elasticities Python example

Stdout

Run Python to see results here.

Status / stderr

Ready to run Python in your browser.

Line-by-line guide

  1. Line 1Load a Python library needed for data work or regression.
  2. Line 2Load a Python library needed for data work or regression.
  3. Line 4Load the dataset into a pandas DataFrame.
  4. Line 5Add an intercept column to the regression design matrix.
  5. Line 6Display a result so students can inspect the output.
  6. Line 7Display a result so students can inspect the output.

Python walkthrough

  1. 1Load the synthetic teaching dataset from the Module 6 public data folder.
  2. 2Create transformed variables only after checking their meaning and valid support.
  3. 3Fit a regression that matches the lesson's interpretation target.
  4. 4Print coefficient or prediction summaries that students can connect to the formula.
  5. 5Use comments and output labels so no empirical result is presented without context.

Live notebook

Run this lesson as a notebook

Open an editable notebook cell-by-cell, run Python in the browser, and download the `.ipynb` file for later.

Related dataset

M6_SALES_ADVERTISING

Estimated time

25 to 40 min

Packages

pandas, numpy

Expected output

Printed Python results that can be compared with the lesson explanation.

Learning goals

  • Load and inspect M6_SALES_ADVERTISING.
  • Run the Python cells connected to Level-Log and Log-Level Models.
  • Interpret the output using log models and percent changes.

Common errors

  • File not found: check that M6_SALES_ADVERTISING.csv is installed or use the course data folder.
  • Package import error: use the browser notebook first, then download for local Jupyter if your local packages differ.
  • Column name error: compare your variable names with the dataset variables listed for this notebook.

Dataset path helper

import pandas as pd

df = pd.read_csv("/data/module-6/M6_SALES_ADVERTISING.csv")
df.head()

Interactive activity

ElasticityScenarioLab

Interpret an elasticity

Move the percent-change control and compare approximate and exact changes.

M6_SALES_ADVERTISING

Inputs

Try it yourself

Write one plain-English sentence explaining the main idea from this lesson.

Common mistakes

Check these before you move on.

A regression coefficient describes a pattern unless the assumptions or research design support a causal interpretation.

Quick quiz

Which interpretation is most careful for Log-Log Elasticities?

Quick quiz

What is the main mistake to avoid in Log-Log Elasticities?

Quick quiz

Why is M6_STARTUP_PREDICTION a reasonable practice dataset here?

Key takeaway

Log-Log Elasticities helps students make multiple regression more flexible while keeping interpretation precise and honest.