Docsity

Econometrics Cheat Sheet, Cheat Sheet of Econometrics and Mathematical Economics

Toggle sidebar
bg1
Econometrics Cheat Sheet
University of Oklahoma
Data & Causality
Basics about data types and causality.
Types of data
Experimental Data from randomized experiment
Observational Data collected passively
Cross-sectional Multiple units, one point in time
Time series Single unit, multiple points in time
Longitudinal (or Panel)Multiple units followed over multiple
time periods
Experimental data
•Correlation =⇒Causality
•Very rare in Social Sciences
Statistics basics
We examine a random sample of data to learn about the
population
Random sample Representative of population
Parameter (θ) Some number describing population
Estimator of θRule assigning value of θto sample
e.g. Sample average, Y=1
NPN
i=1 Yi
Estimate of θWhat the estimator spits out
for a particular sample (ˆ
θ)
Sampling distribution Distribution of estimates
across all possible samples
Bias of estimator W E (W)−θ
Efficiency Wefficient if V ar(W)< V ar(f
W)
Consistency Wconsistent if ˆ
θ→θas N→ ∞
Hypothesis testing
The way we answer yes/no questions about our population
using a sample of data. e.g. “Does increasing public school
spending increase student achievement?”
null hypothesis (H0) Typically, H0:θ= 0
alt. hypothesis (Ha) Typically, H0:θ6= 0
significance level (α) Tolerance for making Type I error;
(e.g. 10%, 5%, or 1%)
test statistic (T) Some function of the sample of data
critical value (c) Value of Tsuch that reject H0if |T|> c;
cdepends on α;
cdepends on if 1- or 2-sided test
p-value Largest αat which fail to reject H0;
reject H0if p < α
Simple Regression Model
Regression is useful because we can estimate a ceteris paribus
relationship between some variable xand our outcome y
y=β0+β1x+u
We want to estimate ˆ
β1, which gives us the effect of xon y.
OLS formulas
To estimate ˆ
β0and ˆ
β1, we make two assumptions:
1. E(u) = 0
2. E(u|x) = E(u) for all x
When these hold, we get the following formulas:
ˆ
β0=y−ˆ
β1x
ˆ
β1=d
Cov (y, x)
d
V ar (x)
fitted values (ˆyi) ˆyi=ˆ
β0+ˆ
β1xi
residuals (ˆui) ˆui=yi−ˆyi
Total Sum of Squares SS T =PN
i=1(yi−y)2
Expl. Sum of Squ ares SSE =PN
i=1( ˆyi−y)2
Resid. Sum of Squares S SR =PN
i=1 ˆu2
i
R-squared (R2)R2=SSE
SST ;
“frac. of var. in yexplained by x”
Algebraic properties of OLS estimates
PN
i=1 ˆui= 0 (mean & sum of residuals is zero)
PN
i=1 xiˆui= 0 (zero covariance bet. xand resids.)
The OLS line (SRF) always passes through (x, y)
SSE +SSR =SST
0≤R2≤1
Interpretation and functional form
Our model is restricted to be linear in parameters
But not linear in x
Other functional forms can give more realistic model
Model DV RHS Interpretation of β1
Level-level y x ∆y=β1∆x
Level-log ylog(x) ∆y≈(β1/100) [1%∆x]
Log-level log(y)x%∆y≈(100β1) ∆x
Log-log log(y) log(x) %∆y≈β1%∆x
Quadratic y x +x2∆y= (β1+ 2β2x) ∆x
Note: DV = dep endent variable; RHS = right hand side
Multiple Regression Model
Multiple regression is more useful than simple regression
because we can more plausibly estimate ceteris paribus
relationships (i.e. E(u|x) = E(u) is more plausible)
y=β0+β1x1+· ·· +βkxk+u
ˆ
β1, . . . , ˆ
βk:partial effect of each of the x’s on y
ˆ
β0=y−ˆ
β1x1− · ·· − ˆ
βkxk
ˆ
βj=d
Cov (y, residualized xj)
d
V ar (residualized xj)
where “residualized xj” means the residuals from OLS
regression of xjon all other x’s (i.e. x1,...,xj−1,xj+1 ,...xk)
Gauss-Markov Assumptions
1. yis a linear function of the β’s
2. yand x’s are randomly sampled from population
3. No perfect multicollinearity
4. E(u|x1, . . . , xk) = E(u) = 0 (Unconfoundedness)
5. V ar (u|x1,...,xk) = V ar (u) = σ2(Homoskedasticity)
When (1)-(4) hold: OLS is unbiased; i.e. E(ˆ
βj) = βj
When (1)-(5) hold: OLS is Best Linear Unbiased Estimator
Variance of u(a.k.a. “error variance”)
ˆσ2=SSR
N−K−1
=1
N−K−1
N
X
i=1
ˆu2
i
Variance and Standard Error of ˆ
βj
V ar(ˆ
βj) = σ2
SSTj(1 −R2
j),j= 1,2, ..., k
where
SSTj= (N−1)V ar (xj) =
N
X
i=1
(xij −xj)
R2
j=R2from a regression of xjon all other x’s
Standard deviation: √V ar
Standard error: pd
V ar
se(ˆ
βj) = sˆσ2
SSTj(1 −R2
j), j = 1, . . . , k
Classical Linear Model (CLM)
Add a 6th assumption to Gauss-Markov:
6. uis distributed N0, σ2
Need this to know what the distribution of ˆ
βjis
Otherwise, need asymptotics to do hypothesis testing of β’s
Testing Hypotheses about the β’s
Under A (1)–(6),1can test hypotheses about the β’s
1Or, A (1)–(5) combined with asymptotic properties
pf3

Partial preview of the text

Download Econometrics Cheat Sheet and more Cheat Sheet Econometrics and Mathematical Economics in PDF only on Docsity!

Econometrics

Cheat

Sheet

University

of

Oklahoma

Data & Causality Basics about data types and causality. Types of data Experimental

Data from randomized experiment

Observational

Data collected passively

Cross-sectional

Multiple units, one point in time

Time series

Single unit, multiple points in time

Longitudinal (or Panel)Multiple

units

followed

over

multiple

time periods

Experimental data

Correlation

Causality

Very rare in Social Sciences

Statistics basics We examine a

random sample

of data to learn about the

populationRandom sample

Representative of population

Parameter (

θ

Some number describing population

Estimator of

θ

Rule assigning value of

θ

to sample

e.g. Sample average,

Y

1

N

Ni

=

Y

i

Estimate of

θ

What the estimator spits outfor a particular sample (

ˆθ

Sampling distribution

Distribution of estimatesacross all possible samples

Bias of estimator

W

E

W

θ

Efficiency

W

efficient if

V ar

W

< V ar

W

Consistency

W

consistent if

θ

θ

as

N

Hypothesis testing The way we answer yes/no questions about our populationusing a sample of data. e.g. “Does increasing public schoolspending increase student achievement?”null hypothesis (

H

0

Typically,

H

0

θ

alt. hypothesis (

H

a

Typically,

H

0

θ

significance level (

α

Tolerance for making Type I error;(e.g. 10%, 5%, or 1%)

test statistic (

T

Some function of the sample of data

critical value (

c

Value of

T

such that reject

H

0

if

T

c

c

depends on

α

c

depends on if 1- or 2-sided test

p

-value

Largest

α

at which fail to reject

H

0

reject

H

0

if

p < α

Simple Regression Model Regression is useful because we can estimate a

ceteris paribus

relationship between some variable

x

and our outcome

y

y

β

0

β

1

x

u

We want to estimate

β

1

, which gives us the effect of

x

on

y

OLS formulas To estimate

β

0

and

β

1

, we make two assumptions:

E

u

E

u

x

E

u

) for all

x

When these hold, we get the following formulas:

β

0

y

β

1

x

β

1

Cov

y, x

V ar

x

fitted values (ˆ

y

i

y

i

β

0

β

1

x

i

residuals (ˆ

u

i

u

i

y

i

y

i

Total Sum of Squares

SST

Ni

=

y

i

y

2

Expl. Sum of Squares

SSE

Ni

=

y

i

y

2

Resid. Sum of Squares

SSR

Ni

=

u

2 i

R

-squared (

R

2

R

2

SSE

SST

“frac. of var. in

y

explained by

x

Algebraic properties of OLS estimates

Ni

=

u

i

= 0 (mean & sum of residuals is zero)

Ni

=

x

i

ˆu

i

= 0 (zero covariance bet.

x

and resids.)

The OLS line (SRF) always passes through (

x, y

SSE

SSR

SST

R

2

Interpretation and functional form

Our model is restricted to be

linear in parameters

But not linear in

x

Other functional forms can give more realistic model

Model

DV

RHS

Interpretation of

β

1

Level-level

y

x

y

β

1

x

Level-log

y

log(

x

y

β

1

100) [1%∆

x

]

Log-level

log(

y

x

y

β

1

x

Log-log

log(

y

log(

x

y

β

1

x

Quadratic

y

x

x

2

y

β

1

β

2

x

x

Note: DV

=

dependent variable; RHS

=

right hand side

Multiple Regression Model Multiple regression is more useful than simple regressionbecause we can more plausibly estimate

ceteris paribus

relationships (i.e.

E

u

x

E

u

) is more plausible)

y

β

0

β

1

x

1

β

k

x

k

u

β

1

β

k

partial effect

of each of the

x

’s on

y

β

0

y

β

1

x

1

β

k

x

k

β

j

Cov

y,

residualized

x

j

V ar

(residualized

x

j

where “residualized

x

j

” means the residuals from OLS

regression of

x

j

on all other

x

’s (i.e.

x

1

,... , x

j

−

1

, x

j

,... x

k

Gauss-Markov Assumptions

y

is a linear function of the

β

’s

y

and

x

’s are randomly sampled from population

No perfect multicollinearity

E

u

x

1

,... , x

k

E

u

) = 0 (Unconfoundedness)

V ar

u

x

1

,... , x

k

V ar

u

σ

2

(Homoskedasticity)

When (1)-(4) hold:

OLS is unbiased; i.e.

E

β

j

β

j

When (1)-(5) hold:

OLS is Best Linear Unbiased Estimator

Variance of

u

(a.k.a. “error variance”)

ˆσ

2

SSR

N

K

N

K

N

∑ i

=

ˆu

2 i

Variance and Standard Error of

j

V ar

β

j

σ

2

SST

j

R

2 j

j

, ..., k

where

SST

j

N

V ar

x

j

N

∑ i

=

x

ij

x

j

R

2 j

R

2

from a regression of

x

j

on all other

x

’s

Standard deviation:

V ar

Standard error:

V ar

se

β

j

ˆσ

2

SST

j

R

2 j

, j

,... , k

Classical Linear Model (CLM) Add a 6th assumption to Gauss-Markov:

u

is distributed

N

, σ

2

Need this to know what the

distribution

of

β

j

is

Otherwise, need

asymptotics

to do hypothesis testing of

β

’s

Testing Hypotheses about the

’s

Under A (1)–(6),

1

can test hypotheses about the

β

’s

1

Or, A (1)–(5) combined with asymptotic properties

t

-test for simple hypotheses

To test a simple hypothesis like

H

0

β

j

H

a

β

j

use a

t

-test:

t

β

j

se

β

j

where 0 is the null hypothesized value.Reject

H

0

if

p < α

or if

t

c

(See: Hypothesis testing)

F

-test for joint hypotheses

Can’t use a

t

-test for joint hypotheses, e.g.:

H

0

β

3

β

4

β

5

H

a

β

3

= 0 OR

β

4

= 0 OR

β

5

Instead, use

F

statistic:

F

SSR

r

SSR

ur

df

r

df

ur

SSR

ur

/df

ur

SSR

r

SSR

ur

/q

SSR

ur

N

k

where

SSR

r

SSR

of restricted model (if

H

0

true)

SSR

ur

SSR

of unrestricted model (if

H

0

false)

q

= # of equalities in

H

0

N

k

1 = Deg. Freedom of unrestricted model

Reject

H

0

if

p < α

or if

F > c

(See: Hypothesis testing)

Note:

F >

0, always

Qualitative data

Can use qualitative data in our model

Must create a

dummy variable

e.g. “Yes” represented by 1 and “No” by 0

dummy variable trap:

Perfect collinearity that happens

when too many dummy variables are included in the model

y

β

0

β

1

happy

β

2

not

happy

u

The above equation suffers from the dummy variable trapbecause units can only be “happy” or “not happy,” soincluding both would result in perfect collinearity with theintercept Interpretation of dummy variables Interpretation of dummy variable coefficients is always relativeto the excluded category (e.g.

not

happy

y

β

0

β

1

happy

β

2

age

u

β

1

avg.

y

for those who are happy

compared to

those who

are unhappy, holding fixed age

Interaction terms interaction term:

When two

x

’s are multiplied together

y

β

0

β

1

happy

β

2

age

β

3

happy

×

age

u

β

3

difference in

age

slope

for those who are happy

compared to

those who are unhappy

Linear Probability Model (LPM) When

y

is a dummy variable, e.g.

happy

β

0

β

1

age

β

2

income

u

β

’s are interpreted as

change in probability

∆ Pr(

y

β

1

x

By definition, homoskedasticity is violated in the LPM Time Series (TS) data

Observe one unit over many time periods

e.g. US quarterly GDP, 3-month T-bill rate, etc.

New G-M assumption: no serial correlation in

u

t

Remove random sampling assumption (makes no sense)

Two focuses of TS data

Causality (e.g.

taxes

?

GDP growth)

Forecasting (e.g. AAPL stock price next quarter?)

Requirements for TS data To properly use TS data for causal inf / forecasting,need data free of the following elements:Trends:

y

always

or

every period

Seasonality:

y

always

or

at regular intervals

Non-stationarity:

y

has a unit root; i.e. not stable

Otherwise,

R

2

and

β

j

’s are misleading

AR

and Unit Root Processes

AR

(1) model (Auto Regressive of order 1):

y

t

ρy

t

−

1

u

t

Stable if

ρ

1; Unit Root if

ρ

“Non-stationary,” “Unit Root,” “Integrated” are allsynonymous Correcting for Non-stationarity Easiest way is to take a first difference:First difference:

Use ∆

y

y

t

y

t

−

1

instead of

y

t

Test for unit root:

Augmented Dickey-Fuller (ADF) test

H

0

of ADF test:

y

has a unit root

TS Forecasting A good forecast minimizes

forecasting error

f

t

min

f

t

E

e

2 t

I

t

E

[

y

t

f

t

2

I

t

]

where

I

t

is the

information set

RMSE measures forecast performance (on future data):

Root Mean Squared Error =

m

m

−

1

∑ h

=

ˆe

2 T

h

Model with lowest RMSE is best forecast

Can choose

f

t

in many ways

Basic way: ˆ

y

T

from linear model

ARIMA, ARMA-GARCH are cutting-edge models

Granger causality z

Granger causes

y

if, after controlling for past values of

y

past values of

z

help forecast

y

t

CLM violations Heteroskedasticity

Test: Breusch-Pagan or White tests (

H

0

: homosk.)

If

H

0

rejected, SEs, t-, and F-stats are invalid

Instead use heterosk.-robust SEs and t- and F-stats

Serial correlation

Test: Breusch-Godfrey test (

H

0

: no serial corr.)

If

H

0

rejected, SEs, t-, and F-stats are invalid

Instead use HAC SEs and t- and F-stats

HAC: “Heterosk. and Autocorrelation Consistent”

Measurement error

Measurement error in

x

can be a violation of A

Attenuation bias:

β

j

biased towards 0

Omitted Variable Bias When an important

x

is excluded:

omitted variable bias

Bias depends on two forces:

Partial effect of

x

2

on

y

(i.e.

β

2

Correlation between

x

2

and

x

1

Which direction does the bias go?

Corr

x

1

, x

2

Corr

x

1

, x

2

β

2

Positive Bias

Negative Bias

β

2

Negative Bias

Positive Bias

Note: “Positive bias” means

β

1

is too big;

“Negative bias” means

β

1

is too small