0% found this document useful (0 votes)
12 views28 pages

2-06 Non-Linear Models - Logged Variables and Standardized Coefficients

Uploaded by

MishalBD
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views28 pages

2-06 Non-Linear Models - Logged Variables and Standardized Coefficients

Uploaded by

MishalBD
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Week 4, Thursday

Feb 6
Topic for today
Logged variables and standardized coefficients
What we did last class
1. How do we estimate non-linear relationships between X and
Y?
2. How does the interpretation of coefficients change with non-
linear estimation?
3. How do we find ‘turning points’ in non-linear relationships?
Questions we want to answer today
1. What other ways are there to estimate non-linear
relationships?
2. How does the interpretation of coefficients change when
estimating in logs?
3. How do we compare coefficients of variables when they are
using very different scales?
Log function is useful
• The shape is useful
(diminishing returns, but
always increasing)
• Logged models allow us to
interpret results in
percentage terms

4
Thinking about units of change
Suppose we have wage data for a large number of people
across many years and we want to know how inflation
affects wages.

A standard OLS model might look like:


Wagesit = b0 + b1Inflationt + et

Does this make sense?

5
Log models and percentage change
• Logged models allow us to estimate models in which the
coefficients reflect percentage rather than absolute changes.

• The exact interpretation depends on which variables are


logged, but when we see a logged variable or variables, we
should always think percentage change.

6
Log-linear model

Log wagesit = b0 + b1Inflationt + et

Here b1 is an estimate of what percent people’s salary


changes with inflation.
• A one unit increase in inflation is associated with a b1 percent
increase in wages.

Called log-linear model because Y is logged and X is linear


(not logged)

7
Linear-log models

Life expectancyi = b0 + b1ln GDP per capitai + ei

Here b1 is an estimate of how life expectancy changes


with a percent change in GDP per capita.
• A one percent increase in GDP per capita is associated with a b1
increase in life expectancy.

Called linear-log model because Y is not logged (linear)


and X is logged

8
Linear-log model

9
Log-log models

Ln ticket salesi = b0 + b1ln pricei + ei

Here b1 is an estimate of percentage change in ticket sales


associated with percentage change in prices.
• A one percent increase in price is associated with a b1 percent
increase in ticket sales.
• From Microeconomics: elasticity is the percentage effect on Y
associated with a percent change in X

Called log-log model because both Y and X are logged

10
Natural logs
[for reference]

11
Calculus of logged models (log-linear model; only Y is logged)
[for reference only]

12
Calculus of logged models (linear-log model; only X is logged)
[for reference only]

Take derivative of Y with respect to X:

Rearrange:

13
Calculus of logged models (both Y and X are
logged)
[for reference only]

14
Hiccup 1: Scale is a bit wonky in logged models

15
16
Hiccup 2: Can’t log many variables
• A log of some number is the exponent to which we need to
raise e in order to get that number
• Log(7.389) = 2 because
• Log(0.000001) = -13.81 because
• Log(0.0) = -∞ because 0
• Log(negative number) [e.g. log(-2)] is undefined.
• Any variable that has a 0 or negative number can’t be logged.

17
Hiccup 3: Deciding among possible logged models not
easy
• Dependent variable is different across models (e.g. ln Y vs Y)
• Usually theory or graphical justification is sufficient.
• But it can require advanced tools to adjudicate among various
logged models (e.g. log-log versus linear-log models)

18
Logged life expectancy models
reg LogLifeexpectancy LogGDPPC
Number of obs = 173
R-squared = 0.5910
LogLifeexp~y | Coef. Std.Err. t P>|t|
-------------+-----------------------------------
LogGDPPC | .0770517 .00490 15.72 0.0
_cons | 3.572252 .04251 84.02 0.0

reg lifeexp2011 LogGDPPC


Number of obs = 173
R-squared = 0.6303
lifeexp2011 | Coef. Std. Err. t P>|t|
-------------+----------------------------------------
LogGDPPC | 5.145412 .3013418 17.08 0.000
_cons | 25.56839 2.613989 9.78 0.000
19
Standardized Coefficients
Suppose we want to
understand the economics of
professional baseball players’
salaries.

Which is more important,


batting average or home runs?

We create the model:

20
21
Standardized coefficients
To compare coefficients of variables measured on
different scales, we standardize variables.
• When the independent variable, Xk, and the dependent variable
are standardized, a one standard deviation increase in Xk is
associated with a standard deviation increase in the dependent
variable.

22
23
24
Example in Stata
. regress salary ba hr, beta
Source | SS df MS Number of obs = 6762
-------------+------------------------------ F( 2, 6759) = 1444.34
Model | 1.5471e+16 2 7.7356e+15 Prob > F = 0.0000
Residual | 3.6200e+16 6759 5.3558e+12 R-squared = 0.2994
-------------+------------------------------ Adj R-squared = 0.2992
Total | 5.1671e+16 6761 7.6425e+12 Root MSE = 2.3e+06

------------------------------------------------------------------------------
salary | Coef. Std. Err. t P>|t| Beta
-------------+----------------------------------------------------------------
ba | 1.24e+07 940986 13.20 0.000 .1422752
hr | 129627.4 2889.771 44.86 0.000 .4836231
_cons | -2869439 244241.1 -11.75 0.000 .

25
Create standardized variables in Stata
1) Manually
sum math
Variable | Obs Mean Std. Dev. Min Max
-------------+------------------------------------------
math | 200 52.645 9.368448 33 75

gen mathstd = (math-52.645)/9.368448

2) Use egen command


egen mathstd = std(math)

Why bother? Needed for F test on standardized


variables.
26
Recap
1. Log regressions are an alternative to polynomial regressions
to capture non-linear effects.
2. The interpretation of coefficients change to percentages
when estimating in logs.
3. We can compare coefficients of variables when they are
using very different scales by “standardizing” them.

27
What we will do next class
1. How do you estimate a relationship between X and Y when Y
is a dummy variable?
2. How does the interpretation of the coefficients change?

28

You might also like