Linear Regression Models with Logarithmic Transformations









MATHEMATICS 0110A CHANGE OF BASE Suppose that we have

Change of Base Formula: logb a = logc a logc b. Example 1. Express log3 10 using natural logarithms. log3 10 = ln 10 ln 3. Example 2.
Change of Base


Logarithms - changing the base

For example logarithms to the base 2 are used in communications engineering. Your calculator can still be used but you need to apply a formula for changing the 
mc logs


Lesson 5-2 - Using Properties and the Change of Base Formula

Example A. Use a calculator and the Change of Base Formula to find an approximation of log 28. log 28- log 28 log 5. ≈ 2.070. Try These A.


Precalculus: 4.3 Rules of Loagrithms Concepts: rules of logarithms

Concepts: rules of logarithms change of base
. RulesofLogarithms





6.11 Notes – Change of base and log equations

Well the reason is that we cannot evaluate a logarithm like. in our heads. Change of Base Formula: loga c = Examples: 1). 4.
day notes . notes change of base keyed


Name Objective: a. Use change-of-base formula to rewrite and

In order to evaluate logarithms with other bases you need to use the change-of-base formula. Examples: Evaluate the following logarithms. a) log4 25 b) log2 12.
Properties of Logarithms


SECTION 4.4 Evaluating Logarithms and the Change-of-Base

For example with the change-of-base theorem
. evaluating logs change of base


Logarithms – University of Plymouth

16 janv. 2001 Use of the Rules of Logarithms. 7. Quiz on Logarithms. 8. Change of Bases. Solutions to Quizzes. Solutions to Problems ...
PlymouthUniversity MathsandStats logarithms





Linear Regression Models with Logarithmic Transformations

17 mars 2011 Logarithms may have other bases for instance the decimal logarithm of base 10. (The base 10 logarithm is used in the definition of the ...
logmodels


6.2 Properties of Logarithms

Your. Calculus teacher will have more to say about this when the time comes. Example 6.2.3. Use an appropriate change of base formula to convert the following 
S&Z . & .


211249 Linear Regression Models with Logarithmic Transformations Linear Regression Models with Logarithmic Transformations

Kenneth Benoit

Methodology Institute

London School of Economics

kbenoit@lse.ac.uk

March 17, 2011

1 Logarithmic transformations of variables

Considering the simple bivariate linear modelYi=+Xi+i,1there 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 XlogXY linear linear-log

^Yi=+Xi^Yi=+logXilogY log-linear log-log log ^Yi=+Xilog^Yi=+logXiTable 1: Four varieties of logarithmic transformations Remember that we are usingnaturallogarithms, where the base ise2.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=102and log10(102) =2.)

Some properties of logarithms and exponential functions that you may find useful include: 1. log( e) =1 2. log(1 ) =0 3. log( xr) =rlog(x) 4. log eA=A

With valuable input and edits from Jouni Kuha.

1The bivariate case is used here for simplicity only, as the results generalize directly to models involving more than

oneXvariable, although we would need to add the caveat that all other variables are held constant.

2Note that the term "log-linear model" is also used in other contexts, to refer to some types of models for other kinds

of response variablesY. These are different from the log-linear models discussed here. 1

5.elogA=A

6. log (AB) =logA+logB 7. log (A=B) =logAlogB

8.eAB=€eAŠB

9.eA+B=eAeB

10.eAB=eA=eB

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 thelog-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:05001000 150020002500 3000

0200400 600

ExpensesIf 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 thequadraticform involving adding the termX2to 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 betweenxandf(x). 2 2468

02040 6080100

Log(Expenses)3 Interpreting coefficients in logarithmically models with logarithmic transformations

3.1 Linear model:Yi=+Xi+i

Recall that in the linear regression model, logYi=+Xi+i, the coefficientgives us directly the change inYfor a one-unit change inX. No additional interpretation is required beyond the estimate ^of the coefficient itself.

This literal interpretation will still hold when variables have been logarithmically transformed, but

it usually makes sense to interpret the changes not in log-units but rather in percentage changes. Each logarithmically transformed model is discussed in turn below.

3.2 Linear-log model:Yi=+logXi+i

In the linear-log model, the literal interpretation of the estimated coefficient ^is that a one-unit increase in logXwill produce an expected increase inYof^units. To see what this means in terms of changes inX, we can use the result that logX+1=logX+loge=log(eX) which is obtained using properties 1 and 6 of logarithms and exponential functions listed on page

1. In other words,adding1 to logXmeansmultiplying Xitself bye2.72.

A proportional change like this can be converted to a percentage change by subtracting 1 and multiplying by 100. So another way of stating "multiplyingXby 2.72" is to say thatXincreases by

172% (since 100(2.721) =172).

So in terms of a change inX(unlogged):

3 ^is the expected change inYwhenXis multiplied bye. ^is the expected change inYwhenXincreases by 172% For other percentage changes inXwe can use the following result: The expected change in Yassociated with ap% increase inXcan be calculated as^log([100+p]=100). So to work out the expected change associated with a 10% increase inX, therefore, multiply^by log(110=100) =log(1.1) =.095. In other words, 0.095^is the expected change inYwhen

Xis multiplied by 1.1, i.e. increases by 10%.

For smallp, approximately log([100+p]=100)p=100. Forp=1, this means that^=100 can be interpreted approximately as the expected increase inYfrom a 1% increase inX

3.3 Log-linear model:logYi=+Xi+i

In the log-linear model, the literal interpretation of the estimated coefficient ^is that a one-unit increase inXwill produce an expected increase in logYof^units. In terms ofYitself, this means that the expected value ofYis multiplied bye^. So in terms of effects of changes inXonY (unlogged): Each 1-unit increase inXmultiplies the expected value ofYbye^. To compute the effects onYof another change inXthan an increase of one unit, call this changec, we need to includecin the exponent. The effect of ac-unit increase inXis to multiply the expected value ofYbyec^. So the effect for a 5-unit increase inXwould bee5^. For small values of^, approximatelye^1+^. We can use this for the following approxima- tion for a quick interpretation of the coefficients: 100^is the expected percentage change inYfor a unit increase inX. For instance for^=.06,e.061.06, so a 1-unit change inX corresponds to (approximately) an expected increase inYof 6%.

3.4 Log-log model:logYi=+logXi+i

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 inYwhenXincreases by some percentage. Such relationships, where bothYandXare log-transformed, are commonly referred to as elastic in econometrics, and the coefficient of logXis referred to as an elasticity. Linear Regression Models with Logarithmic Transformations

Kenneth Benoit

Methodology Institute

London School of Economics

kbenoit@lse.ac.uk

March 17, 2011

1 Logarithmic transformations of variables

Considering the simple bivariate linear modelYi=+Xi+i,1there 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 XlogXY linear linear-log

^Yi=+Xi^Yi=+logXilogY log-linear log-log log ^Yi=+Xilog^Yi=+logXiTable 1: Four varieties of logarithmic transformations Remember that we are usingnaturallogarithms, where the base ise2.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=102and log10(102) =2.)

Some properties of logarithms and exponential functions that you may find useful include: 1. log( e) =1 2. log(1 ) =0 3. log( xr) =rlog(x) 4. log eA=A

With valuable input and edits from Jouni Kuha.

1The bivariate case is used here for simplicity only, as the results generalize directly to models involving more than

oneXvariable, although we would need to add the caveat that all other variables are held constant.

2Note that the term "log-linear model" is also used in other contexts, to refer to some types of models for other kinds

of response variablesY. These are different from the log-linear models discussed here. 1

5.elogA=A

6. log (AB) =logA+logB 7. log (A=B) =logAlogB

8.eAB=€eAŠB

9.eA+B=eAeB

10.eAB=eA=eB

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 thelog-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:05001000 150020002500 3000

0200400 600

ExpensesIf 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 thequadraticform involving adding the termX2to 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 betweenxandf(x). 2 2468

02040 6080100

Log(Expenses)3 Interpreting coefficients in logarithmically models with logarithmic transformations

3.1 Linear model:Yi=+Xi+i

Recall that in the linear regression model, logYi=+Xi+i, the coefficientgives us directly the change inYfor a one-unit change inX. No additional interpretation is required beyond the estimate ^of the coefficient itself.

This literal interpretation will still hold when variables have been logarithmically transformed, but

it usually makes sense to interpret the changes not in log-units but rather in percentage changes. Each logarithmically transformed model is discussed in turn below.

3.2 Linear-log model:Yi=+logXi+i

In the linear-log model, the literal interpretation of the estimated coefficient ^is that a one-unit increase in logXwill produce an expected increase inYof^units. To see what this means in terms of changes inX, we can use the result that logX+1=logX+loge=log(eX) which is obtained using properties 1 and 6 of logarithms and exponential functions listed on page

1. In other words,adding1 to logXmeansmultiplying Xitself bye2.72.

A proportional change like this can be converted to a percentage change by subtracting 1 and multiplying by 100. So another way of stating "multiplyingXby 2.72" is to say thatXincreases by

172% (since 100(2.721) =172).

So in terms of a change inX(unlogged):

3 ^is the expected change inYwhenXis multiplied bye. ^is the expected change inYwhenXincreases by 172% For other percentage changes inXwe can use the following result: The expected change in Yassociated with ap% increase inXcan be calculated as^log([100+p]=100). So to work out the expected change associated with a 10% increase inX, therefore, multiply^by log(110=100) =log(1.1) =.095. In other words, 0.095^is the expected change inYwhen

Xis multiplied by 1.1, i.e. increases by 10%.

For smallp, approximately log([100+p]=100)p=100. Forp=1, this means that^=100 can be interpreted approximately as the expected increase inYfrom a 1% increase inX

3.3 Log-linear model:logYi=+Xi+i

In the log-linear model, the literal interpretation of the estimated coefficient ^is that a one-unit increase inXwill produce an expected increase in logYof^units. In terms ofYitself, this means that the expected value ofYis multiplied bye^. So in terms of effects of changes inXonY (unlogged): Each 1-unit increase inXmultiplies the expected value ofYbye^. To compute the effects onYof another change inXthan an increase of one unit, call this changec, we need to includecin the exponent. The effect of ac-unit increase inXis to multiply the expected value ofYbyec^. So the effect for a 5-unit increase inXwould bee5^. For small values of^, approximatelye^1+^. We can use this for the following approxima- tion for a quick interpretation of the coefficients: 100^is the expected percentage change inYfor a unit increase inX. For instance for^=.06,e.061.06, so a 1-unit change inX corresponds to (approximately) an expected increase inYof 6%.

3.4 Log-log model:logYi=+logXi+i

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 inYwhenXincreases by some percentage. Such relationships, where bothYandXare log-transformed, are commonly referred to as elastic in econometrics, and the coefficient of logXis referred to as an elasticity.
  1. log change of base formula examples