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

Chapter 4 Functional form

The document provides an overview of various regression models including linear, logarithmic, polynomial, and interaction forms, along with the use of dummy variables in econometrics. It discusses the functional forms, effect analysis, and the benefits of using logarithmic transformations in regression analysis. Additionally, it includes R code examples for implementing these models and highlights the importance of interactions among variables and the incorporation of ordinal information.

Uploaded by

Khôi Văn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Chapter 4 Functional form

The document provides an overview of various regression models including linear, logarithmic, polynomial, and interaction forms, along with the use of dummy variables in econometrics. It discusses the functional forms, effect analysis, and the benefits of using logarithmic transformations in regression analysis. Additionally, it includes R code examples for implementing these models and highlights the importance of interactions among variables and the incorporation of ordinal information.

Uploaded by

Khôi Văn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Econometrics

Nguyen Van Quy

Data Science program - NEU

March 11, 2025


Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Functional form
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Linear Regression
• Linear regression function: linear on coefficient
• Linear regression

y = β0 + β1 x + β2 x 2 + u
y = β0 + β1 ln(x1 ) + β2 x2 + u

• Linear-transformed regression

y = β0 x β1 u

• Non-linear regression

β0 + β1 x1
y= + u, y = β0 x β1 + β2 x 2 + u
β2 + β3 x2
LS method apply for linear or linear-transformed regression model
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Effect Analysis
• Absolute change: 1 unit change in variable
• Relative change: 1% change in variable
Effect unit change in y % change in y
unit change in x absolute → absolute absolute → relative
(derivative)
% change in x relative → absolute relative → relative
(elasticity)
• Linear-linear (level-level) model

y = β0 + β1 x1 + β2 x2 + u

• Absolute effect
∂y ∂y
dy = dx1 + dx2 = β1 dx1 + β2 dx2
∂x1 ∂x2
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Linear and Logarithm

• Cobb-Douglas function: y = αx1β1 x2β2 then y /x1 = β1 and


y /x2 = β2
• Log-log regression model

ln(y ) = β0 + β1 ln(x1 ) + β2 ln(x2 ) + u

• Relative effect
dy dx1 dx2
= β1 + β2
y x1 x2
dy dx1 dx2
100(%) = β1 100(%) + β2 100(%)
y x1 x2

(% change in y ) = β1 (% change in x1 )+β2 (% change in x2 )


Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Log-log model

Cobb-Douglas production function: Output = AK β1 Lβ2 . Firm has


increasing/constant/decreasing return to scale if β1 + β2 Q 1.
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Linear-log Model

• Linear-log model: y = β0 + β1 ln(x) + u


• Difference
dx β1 dx
dy = β1 = 100(%)
x 100 x
β1
• (unit change in y ) = 100 (% change in x)
• x change 1%, y change approximately β1 /100 units
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Log-linear model
• Log-linear model: ln(y ) = β0 + β1 x + u
• Difference
dy dy
= β1 dx =⇒ 100(%) = 100β1 dx
y y
• x change 1 unit, y change approximately 100β1 %
• Exponential transform: y = e β0 +β1 x+u
• x change 1 unit, y change 100(e β1 − 1)% ≈ 100β1 % if β1 is
closed enough to 0.
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Linear and Logarithm


Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Benefit of using logs

• When y > 0, models using ln(y ) as the dependent variable


often satisfy the assumptions more closely than models using
the level of y .
• Taking the log of a variable often narrows the range.
• There are some standard rules of thumb for taking logs
• When a variable is a positive dollar amount, the log is often
take.
• Variables with integer values often appear in logarithmic form.
• Variables that are measured in years usually appear in their
original form.
• It is more difficult to predict the original variable if we use a
dependent variable in logarithmic form.
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Predict value
• We can predict ln(y ) using estimators

[) = βb0 + βb1 x1 + · · · + β
ln(y ck xk

[)
• One guess the predicted value of y is yb = e ln(y . This
systematically underestimate the expected value of y .
2
• Assumption 1-6, then E [y |x] = e σ /2 · e β0 +β1 x1 +···+βk xk
• So the corrected prediction is
2 /2 [
yb = e σb · e ln(y )

where σ
b is simply the unbiased estimator of σ.
• This prediction is not unbiased, but it is consistent.
Xn
[
• Another prediction: yb = α b = n−1
b · e ln(y ) with α exp(ei ).
i=1
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Polynomial form
• Quadratic functions are used to capture decreasing or
increasing marginal effects.
• Quadratic form model: y = β0 + β1 x + β2 x 2 + u
• (Marginal) effect: dy
dx = β1 + 2β2 x
• Turning point: x ∗ = −β1
2β2

• The quadratic is seen most often, but a cubic and even a


quartic term appear now and then. An often reasonable
functional form for a total cost function is

cost = β0 + beta1 quantity + β2 quantity 2 + β3 quantity 3 + u


Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Interaction form

Interaction form
• Model: y = β0 + β1 x + β2 z + β3 x · z + u
• Effects:
dy dy
= β1 + β3 z, = β2 + β3 x
dx dx
• Effect of x is impacted by scalar of z, and vice versa
• Example

price = β0 + β1 sqrft + β2 bdrms + β3 sqrft · bdrms + u

If β3 > 0, an additional bedroom yields a higher increase in


housing price for larger houses.
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

R code

reg.linlog <- lm(wage ~ log(exp) + log(edu) + male)


reg.loglin <- lm(log(wage)~ exp + edu + male)
reg.loglog<-lm(log(wage)~log(exp)+log(edu)+male)
reg.quad<-lm(wage ~ exp + I(exp^2))
reg.inter <-lm(wage ~ exp + edu + exp*edu)
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Simple regression with dummy

Consider simple model of hourly wage determination:

wage = β0 + δ0 female + β1 educ + u

• δ0 is the difference in hourly wage between females and males,


given the same amount of education.
• if δ0 < 0, then for the same level of other factors, women earn
less than men on average.
• We can use several dummy independent variables for multiple
categories.
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Dummy variables
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Example

• Model for wage differences among four groups: graduated


men, graduated women, undergraduate men, and
undergraduate women.
• We must select a base group; we choose undergraduate
women.
• Interpret the following result? women.

wage
[ = 0.123 + 0.411 gradmale + 0.198 undermale + 0.088 gradfem
(0.106) (0.056) (0.058) (0.052)

+ 0.079 GPA + 0.027 exper


(0.007) (0.005)
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Interactions among Dummy Variables


Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Interactions with Quantitative Variables

• Model of quantitative explanatory var.


y = [intercept] + [slope]x + u
• Factor of two categories C1 , C0
• Dummy: D = 1 in C1 ; D = 0 otherwise
• Factor and Intercept
y = β0 + δ0 D + β1 x + u
• For C0 : y = β0 + β1 x + u
• For C1 : y = (β0 + δ0 ) + β1 x + u
• If δ0 6= 0: factor affects to the slope
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Interactions with Quantitative Variables


• Factor and Slope
y = β0 + β1 x + δ1 D · x + u
• For C0 : y = β0 + β1 x + u
• For C1 : y = β0 + (β1 + δ1 )x + u
• Factor and Structure
y = β0 + δ0 D + β1 x + δ1 D · x + u
• For C0 : y = β0 + β1 x + u
• For C1 : y = (β0 + δ0 ) + (β1 + δ1 )x + u
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Interactions with Quantitative Variables


Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Covariate and ANCOVA


Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Interactions with Quantitative Variables


• Continuing with the wage example, suppose that we wish to
test whether the return to GPA is the same for men and
women
• For simplicity, we include only GPA and gender in the model.
What kind of model allows for different returns to GPA?
• Consider the model
wage = (β0 + δ0 female) + (β1 + δ1 female)GPA + u
• female = 0: the intercept for males is β0 , and the slope on
GPA for males is β1
• female = 1: the intercept for females is β0 + δ0 , and the slope
on GPA for females is β1 + δ1
• Therefore, δ0 measures the difference in intercepts between
women and men, and δ1 measures the difference in the return
to GPA between women and men.
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Interactions with Quantitative Variables

• Consider regression model describes college grade point


averages for male and female college athletes. The equation is
cogpa = β0 + β1 sat + β2 hsrank + β3 tothrs + u
• If we are interested in testing whether there is any difference
between men and women, then we must allow a model where
the intercept and all slopes can be different across the two
groups:

cogpa =β0 + δ0 female + β1 sat + δ1 female · sat + β2 hsrank


+ δ2 female · hsrank + β3 tothrs + δ3 female · tothrs + u

• The null hypothesis is H0 : δ0 = 0, δ1 = 0, δ2 = 0, δ3 = 0.


Then we use F -test.
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Incorporating Ordinal Information


• Consider a ranking of credit, CR, takes the values in
{0, 1, 2, 3, 4}, with zero being the worst credit rating and four
being the best. We want to incorporate the effect of CR on
the municipal bond interest rate (MBR).
• One possibility is to just include CR as we would include any
other explanatory variable:
MBR = β0 + β1 CR + other factors
• But we cannot answer the following question: the difference
between four and three is the same as the difference between
one and zero?
• Solution:
MBR = β0 + δ1 CR1 + δ2 CR2 + δ3 CR3 + δ4 CR4 + other factors
• where CRi is dummy variable
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Example
Linear Regression Linear and Logarithm Polynomial and Interaction Dummy Variable

Example

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy