Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics and Econometrics book
Econometrics guide, Unit 2, step 8 of 20Previous stepNext step

Step 8: Functional Form: Logs and Quadratics

Course matchIntroductory econometrics: logs, quadratics, interactions and prediction · Wooldridge Ch. 6 · Stock & Watson Ch. 8
In 30 seconds
  • “Linear regression” means linear in the parameters. Logs, squares and products of variables are just new regressors, so OLS can fit curves.
  • Log-level: one more unit of \( x \) changes \( y \) by about \( 100\beta \)%, exactly \( 100(e^{\beta}-1) \)%. Log-log: \( \beta \) is an elasticity. Level-log: a 1% rise in \( x \) changes \( y \) by \( \beta/100 \) units.
  • In a quadratic \( \beta_1x + \beta_2x^2 \), the marginal effect is \( \beta_1 + 2\beta_2x \) and the turning point is \( -\beta_1/(2\beta_2) \). With an interaction \( \beta_3x_1x_2 \), the effect of \( x_1 \) is \( \beta_1 + \beta_3x_2 \).
  • Never compare \( R^2 \) between a model for \( y \) and a model for \( \log y \). To predict \( y \) from a log model, multiply \( e^{\widehat{\log y}} \) by \( e^{\hat\sigma^2/2} \) or a smearing factor.
  • Exam point: use the exact formula \( 100(e^{\beta}-1) \) for dummies and whenever \( |\beta| \) is above about 0.1.
Video lesson coming soonA short animated lesson for this step will appear here.
What you will learn
  • How to interpret a slope in level-level, log-level, level-log and log-log models, approximately and exactly.
  • How to read an elasticity from a log-log model, and why it is not automatically a causal elasticity.
  • When to take logs of a variable, and when not to.
  • How to fit a quadratic, find the marginal effect at any point and locate the turning point.
  • How to read interaction terms, why centring helps, and how to predict \( y \) from a model for \( \log y \).

Linear in the parameters, not the variables

Real economic relationships are rarely straight lines. An extra $10,000 of income matters far more to a poor household than to a rich one. Wages rise quickly early in a career and then level off. If you force every relationship into \( y = \beta_0 + \beta_1x + u \), you get the shape wrong and the numbers wrong.

The good news is that OLS is far more flexible than it looks. All of these are linear regressions, because each \( \beta \) multiplies something you can compute from the data:

\[ \log(\text{wage}) = \beta_0 + \beta_1\,\text{educ} + u, \qquad y = \beta_0 + \beta_1x + \beta_2x^2 + u, \qquad y = \beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2 + u. \]

You create a new column (a log, a square, a product) and run OLS as usual. Unbiasedness, standard errors, \( t \) tests and \( F \) tests from Step 6 and Step 7 all carry over. By contrast, \( y = \beta_0 + \beta_1x^{\beta_2} + u \) is not linear in parameters and needs non-linear least squares. What changes with transformations is interpretation, and that is what this step is about.

Key termA model is linear in parameters if \( y \) (or a known transformation of it, such as \( \log y \)) equals a sum of terms, each an unknown parameter times a known function of the data, plus an error. Any such model can be estimated by OLS, however curved the relationship between \( y \) and the original variables.
Econometrics Made Simple textbook coverChapter 8 of Econometrics Made Simple covers this in full: logs, elasticities, quadratics, interactions, centring and prediction from log models, all worked on real-style datasets with code.Get the textbook · $15

Logs: four ways to write a model

Throughout, log means the natural logarithm. A small change in \( \log y \) is approximately the proportional change in \( y \): \( 100\,\Delta\log y \approx \%\Delta y \). If \( y \) rises from 100 to 105, the log rises by 0.0488, close to 5%. The approximation gets worse as the change grows: from 100 to 150 the log change is 0.405, not 0.5.

FormModelMeaning of \( \beta_1 \)
Level-level\( y \) on \( x \)One more unit of \( x \) changes \( y \) by \( \beta_1 \) units.
Log-level\( \log y \) on \( x \)One more unit of \( x \) changes \( y \) by about \( 100\beta_1 \)%; exactly \( 100(e^{\beta_1}-1) \)%.
Level-log\( y \) on \( \log x \)A 1% rise in \( x \) changes \( y \) by about \( \beta_1/100 \) units.
Log-log\( \log y \) on \( \log x \)A 1% rise in \( x \) changes \( y \) by about \( \beta_1 \)%: an elasticity.
Worked example

Chapter 8 of Econometrics Made Simple fits all four forms to the 500 sales in houses.csv (price in $000, floor area in sq ft). The slopes are 0.14076 (level-level), 0.00037 (log-level), 251.06 (level-log) and 0.693 (log-log). Interpret each.

Step 1Level-level. One more square foot adds \( 0.14076 \times \$1{,}000 = \$140.76 \); 100 square feet add about $14,076.
Step 2Log-level. One more square foot adds about 0.037%. Scale it: 100 extra square feet add about 3.7%.
Step 3Level-log. A 1% larger house costs \( 251.06/100 = 2.51 \) thousand dollars more. A 10% larger house: exactly \( 251.06 \times \log(1.1) = 23.93 \), about $23,930.
Step 4Log-log. A 1% larger house sells for about 0.69% more. For 10% larger: exactly \( 100(1.1^{0.693}-1) = 6.83\% \).

The elasticity is below 1: price rises less than in proportion to size, so larger houses are cheaper per square foot.

Exact versus approximate percentages

In a log-level model, if \( x \) rises by one unit, \( \log y \) rises by exactly \( \beta_1 \), so \( y \) is multiplied by \( e^{\beta_1} \):

\[ \%\Delta y = 100\,(e^{\beta_1\Delta x} – 1) \quad\text{(exact)}, \qquad \%\Delta y \approx 100\,\beta_1\Delta x \quad\text{(approximate)}. \]

For small coefficients the gap is tiny: \( \beta_1 = 0.05 \) gives 5% approximately and 5.13% exactly. For larger ones it matters: \( \beta_1 = 0.5 \) means 64.87%, not 50%, and \( \beta_1 = -0.5 \) means −39.35%, not −50%. Use the exact formula for dummy variables, which can only jump from 0 to 1, and whenever \( |\beta_1\Delta x| \) exceeds about 0.1. Our post How to Interpret Log Coefficients in Regression: The Four Rules drills this with more examples.

Worked example

A fuller house model gives \( \widehat{\log(\text{price})} = 0.769 + 0.698\log(\text{sqft}) – 0.0051\,\text{age} + 0.0978\,\text{pool} \). Interpret the pool and age coefficients, and the effect of a house being 20 years older.

Step 1Pool. Approximately 9.78%; exactly \( 100(e^{0.0978}-1) = 10.27\% \). Holding size and age fixed, a pool adds about 10.3% to the price.
Step 2Age. One more year of age lowers the price by about 0.51%, holding size and pool fixed.
Step 3Twenty years. The log change is \( 20 \times (-0.00511) = -0.1022 \). Exactly, \( 100(e^{-0.1022}-1) = -9.72\% \), against the approximate −10.22%.

Elasticities and log-log models

An elasticity is the percentage change in \( y \) for a 1% change in \( x \): \( \varepsilon = (\Delta y/\Delta x)(x/y) \). In a log-log model it is simply \( \beta_1 \), at every value of \( x \), with its own standard error. That is why log-log models are the workhorse for demand curves, production functions and cost functions.

In a level model the elasticity changes along the line, so it is usually evaluated at the means. For the houses, \( \hat\varepsilon = 0.14076 \times 1803.71/369.11 = 0.688 \), very close to the log-log 0.693. The two forms agree in the middle of the data and differ at the edges.

Worked example

The log-log house model has \( \hat\beta_1 = 0.69291 \) with \( \operatorname{se} = 0.02805 \). Test whether the elasticity equals 1, and say what happens to price per square foot as size rises.

Step 1\( t = (0.69291 – 1)/0.02805 = -10.95 \), with 498 df. Reject \( H_0\colon \beta_1 = 1 \) easily.
Step 2\( \log(y/x) = \log y – \log x \), so its slope on \( \log x \) is \( 0.693 – 1 = -0.307 \).

Price per square foot falls by about 0.31% for each 1% increase in size. Big houses are cheaper per square foot.

Common mistakeCalling the slope of \( \log Q \) on \( \log P \) “the price elasticity of demand”. With market data, each price–quantity pair is where a demand curve met a supply curve, so price is correlated with the demand error. In the book’s simulated coffee market the true demand elasticity is −0.6, but the naive log-log regression gives −0.172. The log form is fine; the problem is simultaneity, which Step 13 solves with instruments.

When to take logs

Usually log: money amounts and other large positive quantities (wages, income, prices, sales, GDP, population); variables whose spread grows with their level; variables you want an elasticity for. Usually do not log: variables in years (education, experience, age); rates and percentages (unemployment, inflation), whose coefficients are read in percentage points; variables that can be zero or negative; and dummies.

Skewness is a quick guide. Hourly wages in wages.csv have a skewness of 2.40, a long right tail. The log wage has skewness 0.16, close to symmetric. Logs also tame extreme values and often make the errors closer to homoskedastic, which helps with the problem of Step 11.

Econometrics Made Simple Practice Questions coverLog interpretations and turning points are exam favourites. The Practice Questions book has over 1,150 questions, every one with a worked answer.Get 1,150+ questions · $9

Quadratics: effects that change with \( x \)

Workers’ pay rises steeply in the first years of a career, then flattens. A quadratic captures this:

\[ \log(\text{wage}) = \beta_0 + \beta_1\,\text{educ} + \beta_2\,\text{exper} + \beta_3\,\text{exper}^2 + u, \qquad \frac{\Delta\log(\text{wage})}{\Delta\,\text{exper}} \approx \beta_2 + 2\beta_3\,\text{exper}, \qquad \text{exper}^* = -\frac{\beta_2}{2\beta_3}. \]

If \( \beta_2 > 0 \) and \( \beta_3 < 0 \), the profile is an upside-down U. On the 1,000 workers in wages.csv the fitted equation is

\[ \widehat{\log(\text{wage})} = 1.2532 + 0.1036\,\text{educ} + 0.037606\,\text{exper} – 0.000594\,\text{exper}^2, \qquad R^2 = 0.2069. \]

Both experience terms are highly significant (\( t = 6.78 \) and \( t = -4.81 \)). The squared coefficient looks tiny, but it multiplies numbers in the hundreds. Rounding it to −0.0006 would move the turning point from 31.6 to 31.3 years, which is why it is reported to six decimal places.

Worked example

Using the fitted equation, find the marginal effect of experience at 5, 15 and 30 years, and the turning point.

Step 1At 5 years: \( 0.037606 + 2(-0.000594)(5) = 0.0317 \), about 3.2% for the next year.
Step 2At 15 years: 0.0198, about 2.0%. At 30 years: 0.0020, about 0.2%.
Step 3Turning point: \( -0.037606/(2 \times -0.0005941) = 31.6 \) years.
Step 4Check the data: only 9.4% of workers have more than 31.6 years of experience.

The safe conclusion is that wages level off after about 30 years, not that they fall sharply. A quadratic is symmetric about its turning point by construction, whether or not the data say so. From zero experience to the peak, predicted log wages rise by 0.595, a rise of \( 100(e^{0.595}-1) = 81\% \) in the wage.

Log wage and experience: quadratic versus straight line log(hourly wage)
quadratic fitstraight-line fitaverage log wage, 2-year bands
051015202530354045502.22.42.62.83.03.2years of experienceturning point: 31.6 years
Figure 1. Fitted log wage at the mean education of 11.64 years, from the quadratic model (R² = 0.2069) and from a model with experience entered only linearly (slope 0.012). Grey dots are the raw average log wage in each two-year band of experience with at least 10 workers. Only 9.4% of workers lie beyond the turning point. Data: wages.csv, Econometrics Made Simple, Chapter 8.
Common mistakeReading \( \hat\beta_2 = 0.0376 \) as “the effect of one more year of experience”. In a quadratic there is no single effect; the linear coefficient is the effect only at exper = 0. And never drop the linear term while keeping the square: a model with only \( x^2 \) forces the turning point to be at \( x = 0 \).

To test for curvature, use the \( t \) statistic on the squared term (here −4.81, so linearity is firmly rejected). To test whether experience matters at all, test both terms jointly with an \( F \) test, as in Step 7.

Interaction terms

Is a year of schooling worth more to an experienced worker? An interaction term, the product \( x_1x_2 \), lets the effect of one variable depend on the other:

\[ y = \beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2 + u, \qquad \frac{\Delta y}{\Delta x_1} = \beta_1 + \beta_3x_2. \]

So \( \beta_3 \) is how much the effect of \( x_1 \) changes when \( x_2 \) rises by one unit, and \( \beta_1 \) alone is the effect of \( x_1 \) when \( x_2 = 0 \), which may never occur in the data.

Worked example

The book estimates \( \widehat{\log(\text{wage})} = 1.5949 + 0.0925\,\text{educ} + 0.0044\,\text{exper} + 0.00065\,\text{educ}\times\text{exper} \). Find the return to education at 5, 17.67 (the mean) and 30 years of experience. What does 0.0044 mean?

Step 1Return to education: \( 0.0925 + 0.00065\,\text{exper} \): about 9.6% at 5 years, 10.4% at 17.67 years and 11.2% at 30 years.
Step 2But the interaction has \( t = 0.80 \), \( p = 0.426 \): no clear evidence that the return varies with experience.
Step 30.0044 (\( p = 0.648 \)) is the effect of experience for a worker with zero schooling. Nobody in the sample has fewer than 8 years, so this test is uninteresting.

The cure is to centre the variables before forming the product: subtract each mean, so zero means “average”. The interaction, fitted values and \( R^2 \) (0.189 in both versions) do not change. Now the education coefficient, 0.10409, is the return at average experience, and the experience coefficient, 0.01201, is highly significant: at average education an extra year of experience adds about 1.2%.

Exam tipWith an interaction in the model, (1) write the marginal effect \( \beta_1 + \beta_3x_2 \), (2) evaluate it at one or two named values of \( x_2 \), and (3) say that \( \beta_1 \) alone is the effect when \( x_2 = 0 \). Keep both main effects in the model whenever you include their product.

Comparing fit and predicting with a log dependent variable

The level-level house model has \( R^2 = 0.552 \) and the log-log model 0.551. That does not mean the level model fits better. One explains the variation in price, the other the variation in log price: different quantities. \( R^2 \), adjusted \( R^2 \), the standard error of the regression, AIC and BIC can be compared only between models with the same dependent variable on the same observations. The log-level (0.524) and log-log (0.551) models can be compared, and the log of size fits better.

To predict \( y \) itself from a model for \( \log y \), exponentiating the predicted log is not enough. Because \( E(e^u) > 1 \) even when \( E(u) = 0 \), the naive prediction estimates roughly the median of \( y \), not its mean.

\[ \hat y = \hat\alpha\,\exp\big(\widehat{\log y}\big), \qquad \hat\alpha = \exp(\hat\sigma^2/2) \ \text{(normal)} \quad\text{or}\quad \hat\alpha = \frac{1}{n}\sum_{i=1}^n e^{\hat u_i} \ \text{(smearing)}. \]
Worked example

A log-wage model with education, a quadratic in experience and a female dummy has \( \hat\sigma = 0.4513 \). For a man with 12 years of school and 10 of experience the predicted log wage is 2.8968. Predict his hourly wage.

Step 1Naive: \( e^{2.8968} = \$18.12 \).
Step 2Correction factor: \( \exp(0.4513^2/2) = 1.1072 \). The smearing factor is 1.1074, almost the same.
Step 3Corrected: \( 18.12 \times 1.107 = \$20.06 \) per hour.

Across the sample, the mean naive prediction is $18.44 against an actual mean of $20.48; after smearing it is $20.42. Naive predictions are about 11% too low.

Common mistakeReporting \( e^{\widehat{\log y}} \) as “the predicted value of \( y \)”. It underestimates the mean, often by 10% or more when \( \hat\sigma \) is 0.4 to 0.5, as in most wage data. The correction matters little when \( \hat\sigma \) is small: in the house model with size, age and pool, \( \hat\sigma = 0.200 \) and the factor is only 1.020.

Practise: 6 questions

Try each one on paper first, then check the worked answer.

EasyQ1. In a regression of log earnings on years of job training (and controls), the training coefficient is 0.035. Give the approximate and exact percentage effect of one more year of training. Show worked answer
Approximate: \( 100 \times 0.035 = 3.5\% \).
Exact: \( 100(e^{0.035}-1) = 3.56\% \).
The coefficient is small, so the two are almost the same; both hold the controls fixed.
EasyQ2. A log-log demand equation gives a price coefficient of −1.2. By how much does quantity demanded change after a 5% price rise, approximately and exactly? Is demand elastic? Show worked answer
Approximate: \( -1.2 \times 5 = -6\% \).
Exact: \( 100(1.05^{-1.2}-1) = -5.69\% \).
\( |\varepsilon| = 1.2 > 1 \), so demand is elastic (if the coefficient can be read causally).
MediumQ3. Crop yield (tonnes per hectare) on nitrogen fertiliser \( N \) (kg per hectare) gives \( \widehat{\text{yield}} = 2.1 + 0.048N – 0.00016N^2 \). Find the marginal effect at \( N = 100 \), the yield-maximising \( N \) and the maximum predicted yield. Show worked answer
Marginal effect: \( 0.048 – 2(0.00016)N \). At \( N = 100 \): \( 0.048 – 0.032 = 0.016 \) tonnes per extra kg.
Turning point: \( N^* = 0.048/(2 \times 0.00016) = 150 \) kg/ha. Since the squared coefficient is negative, it is a maximum.
Yield at 150: \( 2.1 + 7.2 – 3.6 = 5.7 \) tonnes/ha.
MediumQ4. A log house-price model has a coefficient of 0.18 on a garage dummy and −0.35 on a flood-zone dummy. Give the exact percentage effects and explain why the approximation is poor here. Show worked answer
Garage: \( 100(e^{0.18}-1) = 19.72\% \) higher.
Flood zone: \( 100(e^{-0.35}-1) = -29.53\% \), not −35%.
Dummies jump from 0 to 1, so there is no small change to appeal to, and both coefficients exceed 0.1 in absolute value, where the approximation \( 100\beta \) breaks down.
MediumQ5. A wage model includes \( 0.08\,\text{educ} + 0.01\,\text{exper} + 0.002\,\text{educ}\times\text{exper} \) (log wage). Find the return to education at 10 and at 25 years of experience. What does 0.08 measure? Show worked answer
Return to education: \( 0.08 + 0.002\,\text{exper} \).
At 10 years: \( 0.08 + 0.02 = 0.10 \), about 10%.
At 25 years: \( 0.08 + 0.05 = 0.13 \), about 13%.
0.08 is the return to education for a worker with zero experience, which may be outside the data. Centring experience would make it the return at average experience.
ExamQ6. A model for log monthly sales ($000) has \( \hat\sigma = 0.6 \) and \( R^2 = 0.41 \). (a) For one shop the predicted log sales are 2.5. Find the naive and the normal-corrected prediction of sales. [3] (b) A colleague’s model for sales in levels has \( R^2 = 0.38 \) and she says your model fits better. Comment. [2] (c) In a level-log model of sales on log(local income), the coefficient is 85. Find the exact effect of a 10% rise in income. [2] Show worked answer
(a) Naive: \( e^{2.5} = 12.18 \), about $12,180. [B1]
Correction factor: \( \exp(0.6^2/2) = e^{0.18} = 1.197 \). [M1]
Corrected: \( 12.18 \times 1.197 = 14.59 \), about $14,590. [A1]
(b) The \( R^2 \)s cannot be compared: one is for log sales, the other for sales. [B1] Compare on the same scale, e.g. the squared correlation between actual sales and the log model’s predictions of sales. [B1]
(c) \( \Delta y = 85 \times \log(1.1) \) [M1] \( = 8.10 \), about $8,100 more in monthly sales. [A1]
Total: 7 marks.

Check yourself

1. In a log-log model the slope is 0.693. This means

In a log-log model the slope is an elasticity: percentage change in \( y \) per 1% change in \( x \).

2. \( \hat y = 10 + 4x – 0.1x^2 \). Where is the turning point?

\( x^* = -\beta_1/(2\beta_2) = -4/(2 \times -0.1) = 20 \), a maximum because the squared coefficient is negative.

3. Which pair of models can have their \( R^2 \) compared?

\( R^2 \) can be compared only when the dependent variable is the same; both models in the second option explain \( \log y \).

Your score: 0 out of 3

The short version

  • OLS needs linearity in the parameters, not the variables. Logs, squares and products are just new regressors.
  • Log-level: \( 100\beta \)% approximately, \( 100(e^{\beta}-1) \)% exactly, which you must use for dummies and when \( |\beta| > 0.1 \). Log-log: \( \beta \) is an elasticity (0.693 for house price on floor area).
  • An elasticity from market data is not automatically causal: the naive coffee demand elasticity is −0.172 against a true −0.6.
  • Log positive, skewed money variables; not years, rates, or variables with zeros.
  • Quadratic: marginal effect \( \beta_1 + 2\beta_2x \), turning point \( -\beta_1/(2\beta_2) \). Wages peak at about 31.6 years, with only 9.4% of workers beyond.
  • Interaction: the effect of \( x_1 \) is \( \beta_1 + \beta_3x_2 \); centring makes the main effects the effects at the mean.
  • Never compare \( R^2 \) across \( y \) and \( \log y \). Correct log predictions with \( e^{\hat\sigma^2/2} \) or smearing (1.107 in the wage model).
  • Chapter 8 of Econometrics Made Simple covers all of this in full, plus standardised coefficients, with code and a full set of exercises with answers.
Econometrics Made Simple Complete Bundle coverLogs, elasticities and quadratics, with the full chapter and hundreds of graded questions. Get the textbook and the practice book together for $19 (was $24).Both books · $19

Studying more than one subject? The Complete Book Bundle includes every Economics, Statistics, Mathematics and Econometrics book we publish.

Want more questions like these, with worked answers?
The practice book has over 1,150 more, graded from easy to exam level.
Next: step 9 of 20Dummy Variables and the Chow Test