Skip to main content

Log transformation

Log transformation replaces a variable with its natural logarithm before including it in a regression.

Also known aslogarithm

ByHoang TruongUpdated

See it move

Loading infographic...

The infographic is a formula card showing that replacing a variable x with its natural logarithm ln x converts a curved scatter into a straight OLS line. Three functional-form interpretations are presented: in a level–level model, a one-unit rise in x changes y by β₁ units; in a log–level model, a one-unit rise produces a 100β₁ per cent change in y (a semi-elasticity); and in a log–log model, a one per cent rise in x produces a β₁ per cent change in y, reading the elasticity directly from the slope. A caution note adds that ln(x) is undefined for x ≤ 0, so ln(x + 1) is used when x can equal zero.

Where it fits
SubjectData Analysis & StatisticsAdvancedTopicMultiple Regression & InterpretationAdvanced

The formula

LaTeX
ln(Y)=β0+β1X+ε\ln(Y) = \beta_0 + \beta_1 X + \varepsilon

Variables

Dependent variable
Explanatory variable
Intercept
Slope coefficient
Error term

Log-level model: a 1-unit increase in X is associated with approximately β₁ × 100 % change in Y.

LaTeX
ln(Y)=β0+β1ln(X)+ε\ln(Y) = \beta_0 + \beta_1 \ln(X) + \varepsilon

Variables

Elasticity — % change in Y per 1% change in X

Log-log model: β₁ is the elasticity — a 1% increase in X is associated with β₁% change in Y.

LaTeX
Y=β0+β1ln(X)+εY = \beta_0 + \beta_1 \ln(X) + \varepsilon

Variables

Change in Y associated with a 1% increase in X, divided by 100

Level-log model: a 1% increase in X is associated with β₁ ÷ 100 unit change in Y.