+ All Categories
Home > Documents > Data organization

Data organization

Date post: 25-Feb-2016
Category:
Upload: moesha
View: 25 times
Download: 0 times
Share this document with a friend
Description:
Data organization. Regression Models Time series Cross-sectional Panel Multi-dimensional panel. Errors in Uni -dimensional Data In standard time series or cross-sectional data sets, we must adjust for non-independent errors. Serial correlation Errors correlated across time - PowerPoint PPT Presentation
26
Data organization Year Sales 2005 $10,200 2006 $10,900 2007 $11,000 2008 $8,500 2009 $10,400 Tim e Series Location Sales Virginia $10,400 Florida $10,300 Colorado $8,300 Maine $10,200 C ross-Sectional Year Location Sales 2005 Virginia $9,000 2005 Florida $9,500 2005 Colorado $9,200 2005 Maine $8,800 2006 Virginia $9,200 2006 Florida $10,500 2006 Colorado $10,700 2006 Maine $9,300 2007 Virginia $8,700 2007 Florida $8,900 2007 Colorado $11,000 2007 Maine $9,700 2008 Virginia $8,000 2008 Florida $8,400 2008 Colorado $9,300 2008 Maine $9,000 2009 Virginia $8,000 2009 Florida $9,700 2009 Colorado $8,500 2009 Maine $9,100 Panel Year Location H oliday Sales 2005 Virginia Christmas $9,200 2005 Virginia July 4 $8,400 2005 Virginia LaborD ay $8,900 2005 Florida Christmas $9,100 2005 Florida July 4 $8,400 2005 Florida LaborD ay $10,500 2005 Colorado Christmas $10,300 2005 Colorado July 4 $9,400 2005 Colorado LaborD ay $10,900 2005 Maine Christmas $8,900 2005 Maine July 4 $9,100 2005 Maine LaborD ay $8,700 2006 Virginia Christmas $8,200 2006 Virginia July 4 $8,900 2006 Virginia LaborD ay $8,900 2006 Florida Christmas $10,300 2006 Florida July 4 $11,000 2006 Florida LaborD ay $8,500 2006 Colorado Christmas $8,100 2006 Colorado July 4 $9,200 2006 Colorado LaborD ay $10,200 2006 Maine Christmas $10,200 2006 Maine July 4 $8,100 2006 Maine LaborD ay $8,600 2007 Virginia Christmas $9,600 2007 Virginia July 4 $10,400 2007 Virginia LaborD ay $10,800 2007 Florida Christmas $10,300 2007 Florida July 4 $9,100 2007 Florida LaborD ay $10,900 2007 Colorado Christmas $10,800 2007 Colorado July 4 $9,600 2007 Colorado LaborD ay $10,200 2007 Maine Christmas $10,400 2007 Maine July 4 $9,600 2007 Maine LaborD ay $11,000 2008 Virginia Christmas $8,200 2008 Virginia July 4 $9,800 2008 Virginia LaborD ay $8,900 2008 Florida Christmas $9,200 2008 Florida July 4 $10,400 2008 Florida LaborD ay $9,000 2008 Colorado Christmas $10,700 2008 Colorado July 4 $9,600 2008 Colorado LaborD ay $8,600 2008 Maine Christmas $8,100 2008 Maine July 4 $8,600 2008 Maine LaborD ay $8,000 2009 Virginia Christmas $9,800 2009 Virginia July 4 $8,800 2009 Virginia LaborD ay $10,400 2009 Florida Christmas $10,700 2009 Florida July 4 $8,300 2009 Florida LaborD ay $9,600 2009 Colorado Christmas $9,100 2009 Colorado July 4 $8,300 2009 Colorado LaborD ay $9,600 2009 Maine Christmas $10,200 2009 Maine July 4 $9,600 2009 Maine LaborD ay $8,200 M ulti-DimensionalPanel
Transcript
Page 1: Data organization

Data organization

Year Sales2005 $10,2002006 $10,9002007 $11,0002008 $8,5002009 $10,400

Time Series

Location SalesVirginia $10,400Florida $10,300

Colorado $8,300Maine $10,200

Cross-Sectional

Year Location Sales2005 Virginia $9,0002005 Florida $9,5002005 Colorado $9,2002005 Maine $8,8002006 Virginia $9,2002006 Florida $10,5002006 Colorado $10,7002006 Maine $9,3002007 Virginia $8,7002007 Florida $8,9002007 Colorado $11,0002007 Maine $9,7002008 Virginia $8,0002008 Florida $8,4002008 Colorado $9,3002008 Maine $9,0002009 Virginia $8,0002009 Florida $9,7002009 Colorado $8,5002009 Maine $9,100

Panel

Year Location Holiday Sales2005 Virginia Christmas $9,2002005 Virginia July 4 $8,4002005 Virginia Labor Day $8,9002005 Florida Christmas $9,1002005 Florida July 4 $8,4002005 Florida Labor Day $10,5002005 Colorado Christmas $10,3002005 Colorado July 4 $9,4002005 Colorado Labor Day $10,9002005 Maine Christmas $8,9002005 Maine July 4 $9,1002005 Maine Labor Day $8,7002006 Virginia Christmas $8,2002006 Virginia July 4 $8,9002006 Virginia Labor Day $8,9002006 Florida Christmas $10,3002006 Florida July 4 $11,0002006 Florida Labor Day $8,5002006 Colorado Christmas $8,1002006 Colorado July 4 $9,2002006 Colorado Labor Day $10,2002006 Maine Christmas $10,2002006 Maine July 4 $8,1002006 Maine Labor Day $8,6002007 Virginia Christmas $9,6002007 Virginia July 4 $10,4002007 Virginia Labor Day $10,8002007 Florida Christmas $10,3002007 Florida July 4 $9,1002007 Florida Labor Day $10,9002007 Colorado Christmas $10,8002007 Colorado July 4 $9,6002007 Colorado Labor Day $10,2002007 Maine Christmas $10,4002007 Maine July 4 $9,6002007 Maine Labor Day $11,0002008 Virginia Christmas $8,2002008 Virginia July 4 $9,8002008 Virginia Labor Day $8,9002008 Florida Christmas $9,2002008 Florida July 4 $10,4002008 Florida Labor Day $9,0002008 Colorado Christmas $10,7002008 Colorado July 4 $9,6002008 Colorado Labor Day $8,6002008 Maine Christmas $8,1002008 Maine July 4 $8,6002008 Maine Labor Day $8,0002009 Virginia Christmas $9,8002009 Virginia July 4 $8,8002009 Virginia Labor Day $10,4002009 Florida Christmas $10,7002009 Florida July 4 $8,3002009 Florida Labor Day $9,6002009 Colorado Christmas $9,1002009 Colorado July 4 $8,3002009 Colorado Labor Day $9,6002009 Maine Christmas $10,2002009 Maine July 4 $9,6002009 Maine Labor Day $8,200

Multi-Dimensional Panel

Page 2: Data organization

Regression Models

• Time series

• Cross-sectional

• Panel

• Multi-dimensional panel

t t ty x u

i i iy x u

, , ,i t i t i ty x u

, , , , , ,i s t i s t i s ty x u

Page 3: Data organization

Errors in Uni-dimensional Data

In standard time series or cross-sectional data sets, we must adjust for non-independent errors.

Serial correlationErrors correlated across time

Spatial correlationErrors correlated across cross-sections

HeteroskedasticityError variance changes over time or cross-sections

Page 4: Data organization

Errors in Panel Data

Heterogeneous serial correlationErrors correlated across time and differently for different cross-sections.

Heterogeneous spatial correlationErrors correlated across cross-sections but differently for different time periods.

Heterogeneous heteroskedasticityError variance changes over time, but does so differently for different cross-sections.

Serial-spatial correlationPast errors from one cross-section are correlated with future errors from a different cross-section.

Page 5: Data organization

Generalized Least Squares

1 1 2 1 3

1 2 2 2 3

1 3 2 3 3

var cov , cov ,cov , var cov ,cov , cov , var

t t t t t

t t t t t

t t t t t

u u u u uu u u u uu u u u u

The error covariance matrix shows the covariances of error terms across different observations.

11 1

For the regression model

ˆ ' '

t t ty x u

X X X Y

Page 6: Data organization

cov ,

0 t s

u t su u

t s

Ordinary Least Squares Assumptions

0 00 00 0

uuu

11 1

For the regression model

ˆ ' '

t t ty x u

X X X Y

Page 7: Data organization

Ordinary Least Squares (Heteroskedasticity)

cov ,

0 t

t s

u t su u

t s

1

2

3

0 00 00 0

t

t

t

uu

u

11 1

For the regression model

ˆ ' '

t t ty x u

X X X Y

Page 8: Data organization

Ordinary Least Squares (Serial Correlation)

| |cov , t st su u u

2

2

u u uu u uu u u

11 1

For the regression model

ˆ ' '

t t ty x u

X X X Y

Page 9: Data organization

Two-Dimensional Panel Data: OLS Assumptions

, , ,

11 1

For the regression model

ˆ ' '

i t i t i t i ty x v u

X X X Y

cov ,

0 otherwisei j

v i jv v

cov ,

0 otherwiset st s

, ,

and cov ,

0 otherwisei t j s

u i j t su u

Page 10: Data organization

0 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 0

0 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 0

0 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 0

Two-Dimensional Panel Data: OLS Assumptions

, , ,

, , i t i t i t i t

i t i t

y x v u

x

Page 11: Data organization

2

2

2

2

2

0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 0

0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 0

0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 0

2

Two-Dimensional Panel Data: OLS (homogeneous serial correlation)

, , ,

, , i t i t i t i t

i t i t

y x v u

x

Page 12: Data organization

21 1 1

1 1 12

1 1 1

22 2 2

2 2 22

2 2 2

0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 0

0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 0

0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 0

23 3 3

3 3 32

3 3 3

Two-Dimensional Panel Data: OLS (heterogeneous serial correlation)

, , ,

, , i t i t i t i t

i t i t

y x v u

x

Page 13: Data organization

2 2 21 1 1 1,2 1,2 1,2 1,3 1,3 1,3

1 1 1 1,2 1,2 1,2 1,3 1,3 1,32 2 2

1 1 1 1,2 1,2 1,2 1,3 1,3 1,3

21,2 1,2 1,2

1,2 1

2 22 2 2 2,3 2,3 2,3

,2 1,2 2 2 2 2,3 2,3 2,32 2 2

1,2 1,2 1,2 2 2 2 2,3 2,3 2,3

21,3 1,3 1,3

1,3 1,3 1,32

1,3 1,3 1,3

2 22,3 2,3 2,3 3 3 3

2,3 2,3 2,3 3 3 32 2

2,3 2,3 2,3 3 3 3

Two-Dimensional Panel Data: OLS (serial-spatial correlation)

, , ,

, , i t i t i t i t

i t i t

y x v u

x

Page 14: Data organization

OLS vs. Panel Estimation

2Estimation Procedure Estimate Standard Error Regression ROLS 0.482 0.017 0.37

Cross-Sectional Effects 0.499 0.014 0.46Time Effects 0.486 0.013 0.48Both Effects 0.505 0.009 0.67

, , ,

2 2 2 2, ,~ 0, , ~ 0, , ~ 0, , ~ 0,

35, 400.5

i t i t i t i t

i v t i t i u i t t u

y x v u

v IIN IIN u IIN u IIN

N T

Page 15: Data organization

Fixed versus Random Effects

Under the random effects assumption, and are treated as stochastic.

Under the fixed effects assumption, they are treated as fixed in repeated samples.

iv t

, , ,i t i t i t i ty x v u

Page 16: Data organization

Random vs. Fixed Effects

Random Effects AssumptionPro: Estimators are more efficientCon:Estimators are inconsistent if any of the three errors are not

IIN(0,σ2) across all dimensions.

Fixed Effects AssumptionPro: Estimators are consistent regardless of and .Con:Estimators are less efficient.

iv t

, , ,i t i t i t i ty x v u

See Hausman test for endogeneity.

Page 17: Data organization

Random vs. Fixed Cross-Sectional Effects

2Estimation Procedure Estimate Standard Error Regression ROLS 0.595 0.004 0.63

Random Effects 0.588 0.004 0.59Fixed Effects 0.518 0.009 0.65

, , ,

2 2 2, ,~ 0, , ~ 0, , ~ 0,

35, 400.5

i t i t i t i t

t i t i u i t t u

y x v u

IIN u IIN u IIN

N T

Test statistic = 22

Page 18: Data organization

Alternatives to Panel Techniques

1, 1 1 1, 1,

2, 2 2 2, 2,

For cross-section 1

For cross-section 2

etc.

t t t

t t t

y x u

y x u

Separate Regressions

DrawbacksLess efficient estimators due to lost information about cross-sectional error covariance.Remove the ability to restrict parameter values across cross-sections.

Page 19: Data organization

Alternatives to Panel Techniques

, , ,

Run standard OLS on

i t i t i ty x u

Pooled Regression

DrawbacksLess efficient estimators due to lost information about cross-sectional error covariance.Restricts parameter values to be equal across cross-sections.

Page 20: Data organization

Alternatives to Panel Techniques

, , ,

Run standard OLS on

i t i i t i ty x u

Pooled Regression with Cross-Sectional Dummies

DrawbacksThis is the fixed effects panel technique.If the cross-sectional dummies are IIN, then parameter estimates are less efficient than under the random effects panel technique.

Page 21: Data organization

Procedures to use with panel data

Generalized least squares (GLS)Generalized method of moments (GMM)

OLS with “automated” corrections for serial correlation, etc. is GLS.

Page 22: Data organization

Extra stuff

Panel data reveals information that is unattainable with non-panel data.

Page 23: Data organization

Three-Dimensional Structure of the ASA-NBER Data Set

Page 24: Data organization

Shock Occurrence vs. Shock Impact

These shocks all occur in quarter 6 but impact inflation in different quarters.

These shocks all impact inflation in quarter 9 but occur in different quarters.

Page 25: Data organization

Shock Occurrence vs. Shock Impact

, 1ˆ ˆˆth th t hu

1, 1ˆ ˆ ˆth th t hv u u

, , 11

1ˆN

th ith i t hi

F FN

Cumulative shocks

Cross-sectional shocksDiscrete shocks

Page 26: Data organization

Shock Occurrence vs. Shock Impact

Shock Measure Shocks Occur From Shocks Impact Inflation From

Cumulative shocks

th Beginning of quarter t – h to the end of quarter t.

Beginning of quarter t – h to the end of quarter t.

Cross-sectional shocks

uth

Beginning of quarter t – h to the end of quarter t – h.

Beginning of quarter t – h to the end of quarter t.

Discrete shocks

vth Beginning of quarter t – h to the end of quarter t – h.

Beginning of quarter t to the end of quarter t.


Recommended