Lec05 2-Practicalregression
Lec05 2-Practicalregression
Variables &
Functional
Form
Dr. Henry
Kankwamba
Functional
form
Logarithms
Polynomials Qualitative Variables & Functional Form
Qualitative
Variables
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
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∆
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.
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
• Thus,
Qualitative
Variables
• For men (Femalei = 0):, we can write the model as
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)
(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)
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 .
log (Wagei ) = (β0 + δ0 )−δ0 Malei +β1 Educi +β3 Experi +β4 Tenurei +εi
Functional
form
• Consider the equation:
Logarithms
Qualitative
Variables
+ β1 Educi + β3 Experi + β4 Tenurei + εi
log (Wagei ) = θ0 +γ0 Malei +β1 Educi +β3 Experi +β4 Tenurei +εi
log (Wagei ) = π0 Femalei +π1 Malei +β1 Educi +β3 Experi +β4 Te
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)
Wagei = β0 +δ0 Femalei +δ2 E2,i +δ3 E3,i +δ4 E4,i +δ5 E5,i +Other Variables