Professional Documents
Culture Documents
Yichong Zhang1
1 School of Economics
1 This data is drawn from the 1998 Current Population Survey (CPS) and includes full-time workers, age 25 to 64.
Dummies and interactions (Cont’d)
Wage = β 0 + β 1 Yrseduc + u
[ =c
Wage β0 + c
β 1 Gender + c
β 2 Yrseduc
I What does this look like graphically?
Dummies and interactions (Cont’d)
= 0 if south = 1
= 1 if midwest = 1
= 2 if west = 1
= 3 if northeast = 1
Dummy variables vs. categorical variables (Cont’d)
I OLS can also easily handle interactions between two (or more)
continuous variables.
I For example, suppose you thought that the effect on expected
earnings of an increase in years of education depended on
years of experience (Exper ).
I How could you model this?
∆TESTSCR
\ i = βb0 + βb1 (Incomei + 1) + βb2 (Incomei + 1)2
h i
− βb0 + βb1 Incomei + βb2 Incomei2
= βb1 + βb2 (2 · Incomei + 1)
∆TESTSCRi = m · β 1 + β 2 2 · m · Incomei + m2
∆TESTSCR
\ i = m · βb1 + βb2 2 · m · Incomei + m2
Interpreting nonlinear regression functions (Cont’d)
I Since we know that for a one unit increase in Income the expected
change in TestScr is
∆TESTSCRi = β 1 + β 2 (2 · Incomei + 1)
I The estimate is
∆TESTSCR
\ i = βb1 + βb2 (2 · Incomei + 1)
we can calculate the expected change of a one unit increase for any
initial value of Income.
I For example, if income increases from 10 to 11, then
∆TESTSCR
\ = βb1 + βb2 (2 · 10 + 1) = 3.85 − .042 · (21) = 2.96
but if income increases from 40 to 41, then
∆TESTSCR
\ = βb1 + βb2 (2 · 40 + 1) = 3.85 − .042 · (81) = .45
∆TESTSCR
\ ± 1.96 · SE (∆TESTSCR
\ )
∆Yb = ∆TESTSCR
\ = βb1 + βb2 (2 · Income + 1)
I So to compute SE ∆Yb we need to compute
SE βb1 + βb2 (2 · Income + 1)
I Now F = 9.68 so SE ∆Yb = √.45 = 0.14
9.68
I Therefore, a 95% confidence interval for the change in the
expected value of Y in this case is
.45 ± 1.96 · .14 = (.17, .73)
Identifying and modeling nonlinearities (Cont’d)
3 The transcendental number e (whose symbol honors the Swiss mathematician Leonhard Euler) can be defined by the limit e ≡ limn→∞ 1 + n1
n
.
Logarithms (Cont’d)
ln (xy ) = ln (x ) + ln (y )
ln (y /x ) = ln (y ) − ln (x )
ln (x y ) = y ln (x )
ln (1) = 0
I But:
ln (x + y ) 6= ln (x ) + ln (y )
ln(x − y ) 6= ln(x ) − ln(y )
Logarithms (Cont’d)
I Logarithms are often useful because they (approximately)
convert changes in variables into percentage changes:
∆x ∆x
ln (x + ∆x ) − ln (x ) ≈ (when is small)
x x
I For example,
.01
ln (1.01) − ln (1) = 0.00995 ≈ .01 =
1
ln (101) − ln (100) = 0.00995 ≈ .01
ln (1.05) − ln (1) = 0.04879 ≈ .05
but
ln (1.5) − ln (1) = 0.405 47 6= 0.5
I This will turn out to be very useful in what follows.
I There are three main ways to use logs in regressions.
I We’ll discuss each one in turn and show how to interpret their
estimation results.
Logarithms: Linear-log model
I Assume that the regression has the following shape
Y = β 0 + β 1 ln X + u
E [Y | X + ∆X ] − E [Y | X ]
= β 0 + β 1 ln (X + ∆X ) − [ β 0 + β 1 ln (X )]
= β 1 [ln (X + ∆X ) − ln (X )]
So ∆Y ≈ β 1 ∆X
X if
∆X
X is small.4
I So, in the linear-log model, a small percentage change in X
has a constant effect on the expected value of Y .
I Specifically, a 1% change in X (i.e. ∆X
X = .01) is associated
with a change in Y of .01β 1 .
ln Y = β 0 + β 1 X + u
Y = e β0 + β1 X · v =⇒ ln Y = β 0 + β 1 X + ln v
E [ln (Y ) | X + ∆X ] − E [ln (Y ) | X ] = β 1 (X + ∆X ) − β 1 X
= β 1 ∆X
ln (Y + ∆Y ) − ln (Y ) = β 1 ∆X
∆Y
but if ∆Y is small, ln (Y + ∆Y ) − ln (Y ) ≈ Y
∆Y
so Y ≈ β 1 ∆X
so here a unit change in X implies (approximately) a constant
proportional change in Y equal to β 1 .
Specifically, a change in X of one unit (∆X = 1) is associated with
a 100β 1 % change in Y .
Logarithms: Log-linear model (Cont’d)
I Let’s look at our sales example again. Suppose we regress
ln (SALES ) on ADVERT .
y 0 −y ∼ 0
y = log(y 0 ) − log(y ), only when | y −y y | is small.
y 0 −y
I y = −5%, log(y 0 ) − log(y ) = −4.9%.
y 0 −y
I = −75%, log(y 0 ) − log(y ) = −139%. In this case, the
y
percentage change for the log is not appropriate.
0
I Convert from log change to percentage change when | y −y y | is
large.
y0 y0 − y
a := log(y 0 ) − log(y ) = log( )⇒ = exp(a) − 1.
y y
Arguments for and against logs
For:
I Gives a nice percentage/elasticity interpretation.
I Can be generated by some theoretical specifications (e.g.,
Cobb-Douglas...).
I Parsimony.
Against:
I Restrictive vs. a more flexible form given by polynomials.
I May need more flexible forms to test whether restrictions
imposed by logs are valid.
When to take log