Download presentation
Presentation is loading. Please wait.
Published byJames Reed Modified over 6 years ago
1
Econ 326 Prof. Mariana Carrera Lab Session X [DATE]
2
Outline
3
Panel Data Dataset in which behaviors of entities (e.g., individuals, companies, countries) are observed across time. Example:
4
Setting up panel regressions
Declare data to be panel data using xtset command. Use xtline to visualize panel data. xtline delay, overlay
5
Setting up time series data
Declare data to be time data using tsset command. Allows you to use lead and lag operators: L. and F. L.x = x(t-1) L2.x=x(t-2) F.x=x(t+1) F2.x=x(t+2) Two declaration syntaxes: Straight time series data Cross-sectional time series data
6
Fixed effects models in Stata
3 Stata commands for estimating linear FE models: xi: reg xtreg areg
7
Fixed effects (xi: reg)
Example syntax: Predictor variable Dependent variable xi: tells Stata to allow for factor variables i.variable creates dummies for categorical variable varname reg: basic OLS regression
8
Fixed effects (xi: reg)
Example output N-1 entity-specific intercepts
9
Fixed effects (xtreg) Example syntax: Fixed effects option
10
Fixed effects (xtreg) Example output: # of entities
identical to xi results
11
Fixed Effects (areg) Example syntax:
absorb(varname) includes variable varname as a series of dummy variables in regression
12
Fixed Effects (areg) Example output: identical to xi results
# of entities
13
Clustering standard errors
Example syntax Accounts for w/in county correlation of error term
14
Outreg2 (basics) Used to create publication-style tables.
Install with: ssc install outreg2 Basic syntax: Can export to word, excel, latex
15
Replace, append, model titles)
Create new file or replace existing one
16
Use variable labels
17
Reporting significance levels
Add tstat to replace standard errors w/t-statistics
18
Decimal places Decimal places for SEs Decimal places for coefficients
19
Showing selected coefficients
Use drop() or keep() to select variables Use nocons option to drop Constant from table.
20
Ordering coefficients
Re-order when running regression E.g., to show year above population: To specify ordering for multiple models: Use sortvar() to order rows of table
21
Adding model stats w/addstat
To see what stats are saved by Stata. Write name of statistic r() or e() scalars
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.