0% found this document useful (0 votes)
45 views

Lec05 2-Practicalregression

This document discusses qualitative variables and functional forms in regression analysis. It covers functional forms such as logarithms and polynomials. It also discusses qualitative variables, which have categorical but not ordered categories. It explains how to handle qualitative variables in regressions through the use of dummy variables, which allow intercept shifts to capture differences between categories while keeping a common slope.

Uploaded by

Ambie Mchere
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Lec05 2-Practicalregression

This document discusses qualitative variables and functional forms in regression analysis. It covers functional forms such as logarithms and polynomials. It also discusses qualitative variables, which have categorical but not ordered categories. It explains how to handle qualitative variables in regressions through the use of dummy variables, which allow intercept shifts to capture differences between categories while keeping a common slope.

Uploaded by

Ambie Mchere
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Qualitative

Variables &
Functional
Form
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials Qualitative Variables & Functional Form
Qualitative
Variables

Dr. Henry Kankwamba

Econometrics AAE 316

October 10, 2022


Qualitative
Variables &
Functional
Form
Dr. Henry
Kankwamba

Functional
form
Logarithms
1 Functional form
Polynomials

Qualitative
Logarithms
Variables
Polynomials

2 Qualitative Variables
Qualitative
Variables &
Functional
Form
References
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials

Qualitative
Variables

• Wooldridge chapters 6 & 7


• Stock and Watson chapter 8
Qualitative
Variables &
Functional
Form
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials

Qualitative
Section 1
Variables

Functional form
Qualitative
Variables &
Functional
Form
Functional form
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials • We can use functions of variables in regression models
Qualitative
Variables
• Example: wages, years of education, & experience
(a) (a) (a)
a Wagei = β0 + β1 Educi + β2 Experi + εi
(b) (b) (b)
b log Wagei = β0 + β1 Educi + β2 Experi + εi
(c) (c) (c) (c)
c log Wagei = β0 + β1 Educi + β2 Experi + β3 (Experi )2 εi
• All three models can be estimated by OLS
• What is the interpretation of β (a) vs β (b) vs β (c) ?
• How to choose which model to estimate?
Qualitative
Variables &
Functional
Form
Logarithms
Dr. Henry
Kankwamba

Functional
form
Logarithms • We often estimate regressions using logarithms of
Polynomials

Qualitative
some variables instead of the level
Variables • Example: wages and years of education
• Level: Wagei = β0lev + β1lev Educi + εi
• Logarithm: log(Wagei ) = β0log + β1log Educi + εilog
• Interpretation of slope
• Each additional year of education is associated with an
increase in wages of β lev dollars
• Each additional year of education is associated with an
increase in log wages of β log
Qualitative
Variables &
Functional
Form
Change in logarithm
Dr. Henry
Kankwamba
approximates percent change
Functional
form
Logarithms • If log w changes by ∆, then change the percent change
in w is
Polynomials

Qualitative
Variables
wnew − wold e (log w )+∆ − e log w
100 =100
wold e log w
e log w
=100 log w (e ∆ − 1)
e 
=100 ∆ + ∆2 /2 + ∆3 /3! + ∆4 /4! + · · · Ta
≈100∆

• So 100β1log is the percentage change in wages


associated with an additional year of education
Qualitative
Variables &
Functional
Form
Change in logarithm
Dr. Henry
Kankwamba
approximates percent change
Functional
form
Logarithms
Polynomials
• In,
Qualitative
Variables log:log log:log log:log
log(Wagei ) = β0 + β1 log(Educi ) + εi

• β1log:log is the change in log wage associated with a


change in log years of education
• A 1% change in Educ increases log(Educ) by 0.01, so
log:log
log(Wage) increases by 0.01β1 , or Wage increases
log:log
by β1 %
• β1log:log is the elasticity of wages with respect to
education
Qualitative
Variables &
Functional
Form
Logs vs levels
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials

Qualitative
• When to use logarithms instead of levels?
Variables
• No universal rules
• Logarithms useful when:
• Percent changes are desirable
• Variable in levels is positive and right skewed e.g.
income, population, wealth
• Logarithm cannot be used with variables that are ≤ 0
Qualitative
Variables &
Functional
Form
Polynomials
Dr. Henry
Kankwamba
• Example: wages, years of education, & experience
Functional (b) (b) (b)
form b log Wagei = β0 + β1 Educi + β2 Experi + εi
(c) (c) (c) (c)
Logarithms
Polynomials
c log Wagei = β0 + β1 Educi + β2 Experi + β3 (Experi )2 εi
Qualitative • Interpretation:
Variables
• β2(b) is the increase in log Wage associated with an
additional year of experience
• β2(c) is the increase in log Wage associated with an
additional year of experience holding Exper 2 fixed –
does not make sense
• β2(c) + 2β3(c) Exper is the average derivative of log Wage
with respect to experience
• When to use polynomials?
• Benefit: allows richer non-linear relationship
• Costs: more difficult to report, more parameters to
estimate
Qualitative
Variables &
Functional
Form
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials
Section 2
Qualitative
Variables

Qualitative Variables
Qualitative
Variables &
Functional
Form
Qualitative Variables
Dr. Henry
Kankwamba • Categorical variable is one that has one or more
categories, but there is no natural ordering to the
Functional
form categories
Logarithms
Polynomials
• Examples: Gender, race, marital status, geographic
Qualitative location.
Variables
• The following two variables are equivalent:


1 if observation i corresponds to a woman,
Genderi =
2 if observation i corresponds to a man.


1 if observation i corresponds to a man,
Genderi =
2 if observation i corresponds to a woman.

• Qualitative variables cannot be simply included in


regression, because their units are arbitrary
Qualitative
Variables &
Functional
Form
Dummy variables
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials • A dummy variable is a binary zero-one variable which
Qualitative takes on the value one if some condition is satisfied
Variables
and zero if that condition fails
• Female
 i =
1 if observation i corresponds to a woman,
0 if observation i corresponds to a man.
Malei =
• 
1 if observation i corresponds to a man,
0 if observation i corresponds to a woman.
• Note that Femalei + Malei = 1 for all observations i
Qualitative
Variables &
Functional
Form
A single dummy independent
Dr. Henry
Kankwamba
variable
• Consider the following regression:
Functional
form
Logarithms
Wagei = β0 +δ0 Femalei +β1 Educi +β3 Experi +β4 Tenurei +εi ,
Polynomials

Qualitative assume E[εi |Female, Educ, Exper , Tenure] = 0.


Variables • If observation i corresponds to a woman, Femalei = 1,
and

E[Wagei |Femalei = 1, Educi , Experi , Tenurei ] =


= β0 + δ0 + β1 Educi + β3 Experi + β4 Tenurei .

• If observation i corresponds to a man, Femalei = 0, and

E[Wagei |Femalei = 0, Educi , Experi , Tenurei ] =


= β0 + β1 Educi + β3 Experi + β4 Tenurei .

• Thus,

δ0 =E[Wagei |Femalei = 1, Educi , Experi , Tenurei ]−


− E[Wagei |Femalei = 0, Educi , Experi , Tenurei ]
Qualitative
Variables &
Functional
Form
An intercept shift
Dr. Henry
Kankwamba
• The model:
Functional
form
Logarithms Wagei = β0 +δ0 Femalei +β1 Educi +β3 Experi +β4 Tenurei +εi
Polynomials

Qualitative
Variables
• For men (Femalei = 0):, we can write the model as

WageiM = β0 + β1 Educi + β3 Experi + β4 Tenurei + εi .

• For women (Femalei = 1):, we can write the model as

WageiF = (β0 + δ0 ) + β1 Educi + β3 Experi + β4 Tenurei + εi .

• In this case, men are called the reference (or base)


group
• δ0 measures the difference relative to the reference
group.
Qualitative
Variables &
Functional
Form
An intercept shift
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials

Qualitative
Variables
Qualitative
Variables &
Functional
Form
Example
Dr. Henry
Kankwamba

Functional
form
• Estimated equation:
Logarithms
Polynomials
\ i = − 1.57 − 1.81 Femalei + 0.572 Educi +
Wage
Qualitative
Variables (0.72) (0.26) (0.049)
+ 0.025 Experi + 0.141 Tenurei
(0.012) (0.021)

• The dependent variable is the wage per hour


• δ̂0 = −1.81 implies that a women earns $1.81 less per
hour than a man with the same level of education,
experience, and tenure. (These are 1976 wages.)
• The difference is also statistically significant.
Qualitative
Variables &
Functional
Form
Logarithmic dependent variable
Dr. Henry • The model:
Kankwamba

Functional log (Wage) = β0 +δ0 Female+β1 Educ+β3 Exper +β4 Tenure+ε.


form
Logarithms
Polynomials
• In this case,
Qualitative    
Variables δ0 = log Wage F − log Wage M
 
Wage F
= log
Wage M
!
Wage M + Wage F − Wage M
= log
Wage M
 
Wage F − Wage M
= log 1 +
Wage M
Wage − Wage M
F
≈ .
Wage M
• When the dependent variable is in the log form, δ0 has
a percentage interpretation
Qualitative
Variables &
Functional
Form
Example
Dr. Henry
Kankwamba

Functional • Estimated equation:


form
Logarithms

(Wagei ) =
log\ 0.417 − 0.297 Femalei + 0.080 Edu
Polynomials

Qualitative
Variables (0.099) (0.036) (0.007)
+ 0.029 Experi − 0.00058 Experi2 +
(0.005) (0.00010)
+ 0.032 Tenurei − 0.00059 Tenurei2 .
(0.007) (0.00023)

• δ̂0 = −0.297 implies that a woman in 1976 earned


29.7% less than a man with the same level of education,
experience and tenure.
Qualitative
Variables &
Functional
Form
Changing the reference group
Dr. Henry • Instead of
Kankwamba

Functional log (Wagei ) = β0 +δ0 Femalei +β1 Educi +β3 Experi +β4 Tenurei +εi
form
Logarithms
Polynomials
consider:
Qualitative
Variables log (Wagei ) = θ0 +γ0 Malei +θ1 Educi +θ3 Experi +θ4 Tenurei +εi .

• Since Malei = 1 − Femalei ,

log (Wagei ) = θ0 + γ0 Malei + θ1 Educi + θ3 Experi + θ4 Tenurei + εi


= θ0 + γ0 (1 − Femalei ) + θ1 Educi + θ3 Experi + θ4 Tenur
= (θ0 + γ0 ) − γ0 Femalei + θ1 Educi + θ3 Experi + θ4 Tenu

• We conclude that δ0 = −γ0 , β0 = θ0 − δ0 , β1 = θ1 , and


etc.

log (Wagei ) = (β0 + δ0 )−δ0 Malei +β1 Educi +β3 Experi +β4 Tenurei +εi

• Changing the reference group has no effect on the


conclusions
Qualitative
Variables &
Functional
Form
The dummy variable trap
Dr. Henry
Kankwamba

Functional
form
• Consider the equation:
Logarithms

log (Wagei ) =β0 + δ0 Femalei + γ0 Malei +


Polynomials

Qualitative
Variables
+ β1 Educi + β3 Experi + β4 Tenurei + εi

• The intercept is like a regressor that takes the value


one for all observations
• Since Femalei + Malei − 1 = 0 for all observations i, we
have perfect multicollinearity, and such an equation
cannot be estimated.
• Cannot include an intercept and dummies for all
groups!
Qualitative
Variables &
Functional
Form
The dummy variable trap
Dr. Henry
Kankwamba
• One of the dummies has to be omitted and the
Functional
form corresponding group becomes the reference group:
Logarithms
Polynomials
• Men are the reference group:
Qualitative
Variables log (Wagei ) = β0 +δ0 Femalei +β1 Educi +β3 Experi +β4 Tenurei +

• Women are the reference group:

log (Wagei ) = θ0 +γ0 Malei +β1 Educi +β3 Experi +β4 Tenurei +εi

• Alternatively, one can include both dummies without


the intercept:

log (Wagei ) = π0 Femalei +π1 Malei +β1 Educi +β3 Experi +β4 Te

but this is less common


Qualitative
Variables &
Functional
Form
A slope shift and interactions
Dr. Henry • Can allow the returns to education to be different for
Kankwamba
men and women:
Functional
form
Logarithms
log (Wagei ) =β0 + δ0 Femalei + β1 Educi + δ1 (Femalei · Educi ) +
Polynomials
+ β3 Experi + β4 Tenurei + εi .
Qualitative
Variables
• The variable (Femalei · Educi ) is called an interaction
• The equation for men (Femalei = 0):
 
log WageiM = β0 +β1 Educi +β3 Experi +β4 Tenurei +εi .

• The equation for women (Femalei = 1):


 
log WageiF = (β0 + δ0 ) + (β1 + δ1 ) Educi +
+ β3 Experi + β4 Tenurei + εi .

• δ1 is the difference in return to education between


women and men (the reference group) after controlling
for experience and tenure
Qualitative
Variables &
Functional
Form
A slope shift
Dr. Henry
Kankwamba

Functional
form
Logarithms
Polynomials

Qualitative
Variables
Qualitative
Variables &
Functional
Form
Example
Dr. Henry
Kankwamba
• Estimated equation:
Functional
form
Logarithms (Wagei ) =
log\ 0.389 − 0.227 Femalei +
Polynomials

Qualitative
(0.119) (0.168)
Variables
+ 0.082 Educi − 0.0056 Femalei · Educ
(0.008) (0.0131)
+ 0.029 Experi − 0.00058 Experi2 +
(0.005) (0.00011)
+ 0.032 Tenurei − 0.00059 Tenurei2 .
(0.007) (0.00024)

• δ̂1 = −0.0056 suggests that the return to education for


women is 0.56% less than for men, however it is not
statistically significant
Qualitative
Variables &
Functional
Form
Multiple categories
Dr. Henry
Kankwamba
• In the previous examples, Educ was a quantitative
Functional
form
variable: years of education
Logarithms
Polynomials
• Suppose now that instead the education variable is
Qualitative ordinal :
Variables


 1 if high-school dropout,


 2 if high-school graduate,
Education = 3 if some college,



 4 if college graduate,

5 if advanced degree.

• Only the order is important, and there is no meaning


to the particular values
• Adding such a variable to the regression will give a
difficult to interpret result
Qualitative
Variables &
Functional
Form
Multiple categories

Dr. Henry  1 if high-school dropout,
Kankwamba 


 2 if high-school graduate,
Educationi = 3 if some college,
Functional 


 4 if college graduate,
form 
5 if advanced degree.
Logarithms
Polynomials
• Define 5 new dummy variables:
Qualitative  
Variables 1 if high-school dropout, 1 if high-school graduate,
E1,i = E2,i =
0 otherwise. 0 otherwise.
 
1 if some college, 1 if college graduate,
E3,i = E4,i =
0 otherwise. 0 otherwise.

1 if advanced degree,
E5,i =
0 otherwise.

• To avoid multicollinearity, one of the dummies has to


be omitted:

Wagei = β0 +δ0 Femalei +δ2 E2,i +δ3 E3,i +δ4 E4,i +δ5 E5,i +Other Variables

• Group 1 (high-school dropout) becomes the reference


group.
• δ2 measures the wage difference between high-school
graduates and high-school dropouts
• δ3 measures the wage difference between individuals
with some college education and high-school dropouts
• δ3 − δ2 is the wage difference between some college
and high-school graduates

You might also like