1/34

EC114 Introduction to Quantitative Economics
13. Non-Linear Models
Marcus Chambers
Department of Economics
University of Essex
31 January/01 February 2011
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
2/34
Outline
1
Transformations of Variables
2
Double Logarithm Functions
3
Other Transformations
Reference: R. L. Thomas, Using Statistics in Economics,
McGraw-Hill, 2005, sections 10.1–10.4.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Transformations of Variables 3/34
So far we have assumed that the relationship between our
two variables, X and Y, was linear.
In this case the population regression equation is of the
form
E(Y) = α + βX
rather than, for example,
E(Y) = α + βX
2
.
As a consequence the sample regression equation we
ﬁtted to a scatter of points was always a straight line:
ˆ
Y = a + bX
rather than, for example,
ˆ
Y = a + bX
2
.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Transformations of Variables 4/34
However many economic relationships are non-linear to a
lesser or greater extent, and we need to be able to take
this into account.
A very simple way of ﬁtting a curve to a scatter of points is
to apply the so-called transformation technique.
Consider the equation:
Y
∗
= α + βX
∗
,
where X
∗
= X
∗
(X) and Y
∗
= Y
∗
(Y) are simple functions (or
transformations) of the variables X and Y, respectively.
The choice of transformation depends on the nature of the
data under consideration and can partly be determined by
a scatter diagram plotting Y against X.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Transformations of Variables 5/34
Note that the equation Y
∗
= α + βX
∗
is linear in the
transformed variables Y
∗
and X
∗
(but not Y and X).
Hence we can apply regression techniques to the following
population regression equation:
E(Y
∗
) = α + βX
∗
.
The corresponding sample regression equation is therefore
ˆ
Y
∗
= a + bX
∗
where a and b are the OLS estimators of α and β.
The formulae determining a and b (and also R
2
) remain
unchanged but are now expressed in terms of Y
∗
and X
∗
rather than Y and X.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Transformations of Variables 6/34
The relevant formulae are therefore:
b =

The scatter diagram suggests it would be unwise to ﬁt a
straight line to the data.
Some sort of curve would provide a better ﬁt.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Transformations of Variables 11/34
However, suppose we run a linear regression of Y on X; we
obtain
ˆ
Y = 92.9 −0.881X, R
2
= 0.61.
The regression line slopes downwards (the slope is
−0.881) and 61% of the variation in Y can be attributed to
X.
The out-of-sample prediction, obtained when X = 90, is
ˆ
Y = 92.9 −0.881(90) = 13.6.
Looking at the scatter diagram, it suggests that the
demand for carrots is likely to be considerably higher than
13.6 kg when the price is 90p.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Transformations of Variables 12/34
Turning to the price elasticity, this is given by
η =
dY
dX
X
Y
;
(note that Thomas inserts a minus in front of the
right-hand-side).
We estimate dY/dX by b and calculate the elasticity
evaluated at the sample means of X and Y,
¯
X = 46.9 and
¯
Y = 51.6.
The estimated elasticity is thus
η = (−0.881)(46.9/51.6) = −0.801,
meaning that a 1% rise in price leads to a fall of 0.8% in
the demand for carrots (so carrots are price inelastic).
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Transformations of Variables 13/34
Neither the out-of-sample prediction nor the elasticity
estimate are likely to be very accurate in view of the linear
model being a poor representation of the data.
It is likely that better estimates can be obtained from a
non-linear model that provides a better ﬁt to the data.
There are many relationships that give rise to curves of
varying degrees of non-linearity, and we will consider some
important examples.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 14/34
Consider the nonlinear function:
Y = AX
β
, A > 0, A and β constant.
The diagram on the next slide presents the possible
shapes for this function for different values of the
parameter β, these being:
(a) β > 1;
(b) 0 < β < 1; and
(c) β < 0.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 15/34

Notice how the value of β affects the shape of the curve.
It would appear that the function in part (c) might be a
suitable candidate for our data.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 16/34
If we are going to use a function of the form
Y = AX
β
then how do we estimate A and β? Is it possible to use
OLS?
Obviously OLS cannot be applied directly to this function
because it is not linear in the variables.
However, the function has the convenient property that it
can be made linear by taking (natural) logarithms.
We shall need the following rules:
ln(uv) = ln(u) + ln(v) and ln(p
q
) = q ln(p),
which we apply with u = A, v = X
β
, p = X and q = β.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 17/34
Taking logarithms therefore yields
ln(Y) = ln(A) + β ln(X)
which can be written in the form
ln(Y) = α + β ln(X)
where α = ln(A).
Hence ln(Y) is a linear function of ln(X) or
Y
∗
= α + βX
∗
where Y
∗
= ln(Y) and X
∗
= ln(X).
Can we use this equation as a basis for estimating α and β
by OLS?
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 18/34
As it stands, the equation Y
∗
= α + βX
∗
is deterministic
i.e. non-random, but we can use it to deﬁne the population
regression equation in the form
E(Y
∗
) = α + βX
∗
.
Furthermore, introducing a random disturbance
∗
, Y
∗
satisﬁes
Y
∗
= α + βX
∗
+
∗
.
We can apply OLS to this equation and estimate α and β
by a and b giving the sample regression equation
ˆ
Y
∗
= a + bX
∗
.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 19/34
The usual calculations for computing the OLS estimates
are therefore performed on the transformed variables
Y
∗
= ln(Y) and X
∗
= ln(X).
Recall that
a =
¯
Y
∗
−b
¯
X
∗
and b =

The curve appears to ﬁt the data much better than any
straight line could.
The next diagram plots the sample linear regression line in
terms of X
∗
and Y
∗
:
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 24/34

The straight line appears to ﬁt the transformed data much
better than any curve could.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 25/34
The coefﬁcient of determination is equal to
R
2
=
b
2

x
∗2
i

y
∗2
i
=
(−0.744)
2
2.875
2.239
= 0.71
meaning that 71% of the variation in Y
∗
= ln(Y) can be
attributed to X
∗
= ln(X).
Note that the R
2
is in terms of the transformed variables.
It cannot, therefore, be compared with the R
2
of 0.61 for
the regression in the untransformed variables.
This is because one measures the percentage of variation
in Y
∗
attributable to X
∗
while the other measures the
percentage of variation in Y attributable to X, which are
different quantities.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Double Logarithm Functions 26/34
As for the price elasticity, recall that
η =
dY
dX
X
Y
.
Differentiating Y = AX
β
with respect to X gives
dY
dX
= βAX
β−1
and so
η = βAX
β−1
X
AX
β
= β.
Hence our estimate of the price elasticity of demand for
carrots is given by b = −0.744 which is our estimate of β.
Note that the elasticity does not depend on the value of X
or Y; hence the elasticity is the same for all values of X and
Y.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Other Transformations 27/34
A number of other types of transformation are also
commonly employed in regression analysis.
We shall take a look at the properties of three such
transformations:
(a) semi-logarithmic;
(b) exponential; and
(c) reciprocal.
The semi-logarithmic function has the form
Y = α + β ln(X)
and is depicted for β > 0 and β < 0 on the next slide:
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Other Transformations 28/34

The function is linear in Y and ln(X) and so in this case
Y
∗
= Y and X
∗
= ln(X).
The elasticity of Y with respect to X can be shown to be
η =
β
Y
.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Other Transformations 29/34
The exponential function is of the form
Y = Ae
βX
, A > 0.
It can be made linear by taking (natural) logarithms of both
sides:
ln(Y) = ln(A) + βX
and so Y
∗
= ln(Y) and X
∗
= X.
The elasticity of Y with respect to X can be shown to be
η = βX.
The shape of the function for β > 0 and β < 0 is as follows:
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Other Transformations 30/34

Note that the intercept on the Y-axis is equal to A and the
slope is positive if β > 0 and negative of β < 0.
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Other Transformations 31/34
Finally, the reciprocal function is given by
Y = α + β

1
X

and is linear in Y and 1/X, so that Y
∗
= Y and X
∗
= 1/X.
The elasticity of Y with respect to X can be shown to be
η = −
β
XY
.
The shape of the function for β > 0 and β < 0 is as follows:
EC114 Introduction to Quantitative Economics 13. Non-Linear Models
Other Transformations 32/34