




Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!





1 Logarithmic transformations of variables
Considering the simple bivariate linear model Yi = α + β Xi + εi ,^1 there are four possible com- binations of transformations involving logarithms: the linear case with no transformations, the linear-log model, the log-linear model^2 , and the log-log model.
X Y X log X Y linear linear-log Y^ ˆ i = α + β Xi Y ˆ i = α + β log Xi log Y log-linear log-log log Y ˆ i = α + β Xi log Y ˆ i = α + β log Xi
Table 1: Four varieties of logarithmic transformations
Remember that we are using natural logarithms, where the base is e ≈ 2.71828. Logarithms may have other bases, for instance the decimal logarithm of base 10. (The base 10 logarithm is used in the definition of the Richter scale, for instance, measuring the intensity of earthquakes as Richter = log(intensity). This is why an earthquake of magnitude 9 is 100 times more powerful than an earthquake of magnitude 7: because 10^9 / 107 = 102 and log 10 ( 102 ) = 2.)
Some properties of logarithms and exponential functions that you may find useful include:
eA
ä B
2 Why use logarithmic transformations of variables
Logarithmically transforming variables in a regression model is a very common way to handle sit- uations where a non-linear relationship exists between the independent and dependent variables.^3 Using the logarithm of one or more variables instead of the un-logged form makes the effective relationship non-linear, while still preserving the linear model.
Logarithmic transformations are also a convenient means of transforming a highly skewed variable into one that is more approximately normal. (In fact, there is a distribution called the log-normal distribution defined as a distribution whose logarithm is normally distributed – but whose untrans- formed scale is skewed.)
For instance, if we plot the histogram of expenses (from the MI452 course pack example), we see a significant right skew in this data, meaning the mass of cases are bunched at lower values:
0 500 1000 1500 2000 2500 3000
0
200
400
600
Expenses
If we plot the histogram of the logarithm of expenses, however, we see a distribution that looks much more like a normal distribution: (^3) The other transformation we have learned is the quadratic form involving adding the term X (^2) to the model. This produces curvature that unlike the logarithmic transformation that can reverse the direction of the relationship, some- thing that the logarithmic transformation cannot do. The logarithmic transformation is what as known as a monotone transformation: it preserves the ordering between x and f ( x ).
In the log-linear model, the literal interpretation of the estimated coefficient β ˆ is that a one-unit increase in X will produce an expected increase in log Y of β ˆ units. In terms of Y itself, this means that the expected value of Y is multiplied by e β ˆ^. So in terms of effects of changes in X on Y (unlogged):
In instances where both the dependent variable and independent variable(s) are log-transformed variables, the interpretation is a combination of the linear-log and log-linear cases above. In other words, the interpretation is given as an expected percentage change in Y when X increases by some percentage. Such relationships, where both Y and X are log-transformed, are commonly referred to as elastic in econometrics, and the coefficient of log X is referred to as an elasticity.
So in terms of effects of changes in X on Y (both unlogged):
Linear-log. Consider the regression of % urban population (1995) on per capita GNP:
% urban 95 (World Bank)
(^77) United Nations per capita GDP 42416
8
100
% urban 95 (World Bank)
lPcGDP 4.34381 10.
8
100
The distribution of per capita GDP is badly skewed, creating a non-linear relationship between X and Y. To control the skew and counter problems in heteroskedasticity, we transform GNP/capita by taking its logarithm. This produces the following plot:
% urban 95 (World Bank)
(^77) United Nations per capita GDP 42416
8
100
% urban 95 (World Bank)
lPcGDP 4.34381 10.
8
100
and the regression with the following results:
(^8) % urban 95 (World Bank) 100
. regress lPcGDP95 urb Source | SS df MS Number of obs = 132 ---------+------------------------------ F( 1, 130) = 158. Model | 196.362646 1 196.362646 Prob > F = 0. Residual | 160.818406 130 1.23706466 R-squared = 0. ---------+------------------------------ Adj R-squared = 0. Total | 357.181052 131 2.72657291 Root MSE = 1.
lPcGDP95 | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+-------------------------------------------------------------------- urb95 | .052709 .0041836 12.599 0.000 .0444322. _cons | 4.630287 .2420303 19.131 0.000 4.151459 5.
! Every one point increase in the percentage urban multiplies per capita income by e 0.052709 = 1.054. In other words, it increases per capita income by 5.4%.
To interpret the coefficient of .052709 on the urb95 variable, we can make the following state- ments:
Directly from the coefficient, transformed Y : Each one unit increase urb95 in increases lPcGDP by .052709. (Once again, this is not particularly useful as we still have trouble thinking in terms of the natural logarithm of GDP/capita.) Directly from the coefficient, un transformed Y : Each one unit increase of urb95 increases the untransformed GDP/capita by a multiple of e 0.52709^ = 1.054 – or a 5.4% increase. (This is very close to the 5.3% increase that we get using our quick approximate rule described above for interpreting the .053 as yielding a 5.3% increase for a one-unit change in X .)
Log-log. Here we consider a regression of the logarithm of the infant mortality rate on the log of GDP/capita. The plot and the regression results look like this:
lIMR
lPcGDP 3.58352 10.
lIMR
3.58352 (^) lPcGDP95 10.
Logged independent and dependent variables
! Let's look at infant mortality and per capita income:
. regress lIMR lPcGDP Source | SS df MS Number of obs = 194 ---------+------------------------------ F( 1, 192) = 404. Model | 131.035233 1 131.035233 Prob > F = 0. Residual | 62.1945021 192 .323929698 R-squared = 0. ---------+------------------------------ Adj R-squared = 0. Total | 193.229735 193 1.00119034 Root MSE =.
lIMR | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+-------------------------------------------------------------------- lPcGDP95 | -.4984531 .0247831 -20.113 0.000 -.5473352 -. _cons | 7.088676 .1908519 37.142 0.000 6.71224 7.
! Thus multiplying per capita income by 2.718 multiplies the infant mortality rate by e -0.4984531 = 0. ! A 10% increase in per capita income multiplies the infant mortality rate e -0.4984531*ln(1.1) = 0.954. ! In other words, a 10% increase in per capita income reduces the infant mortality rate by 4.6%.
To interpret the coefficient of -.4984531 on the lPcGDP95 variable, we can make the following statements:
Directly from the coefficient, transformed Y : Each one unit increase lPcGDP95 in increases lIMR by -.4984531. (Since we cannot think directly in natural log units, then once again, this is not particularly useful.)
Multiplicative changes in both X and Y : Multiplying X (GNP/cap) by e ≈ 2.72 multiplies Y by e −.4984531^ = 0.607, i.e. reduces the expected IMR by about 39.3%.
A 1% increase in X : A 1% increase in GNP/cap multiplies IMR by e −.4984531∗log(1.01)^ = .0.9950525. So a 1% increase in GNP/cap reduces IMR by 0.5%.
A 10% increase in X : A 10% increase in GNP/cap multiplies IMR by e −.4984531∗log(1.1)^ ≈ .954. So a 10% increase in GNP/cap reduces IMR by 4.6%.