A short introduction to applied econometrics Part C: Introduction to STATA PowerPoint PPT Presentation

presentation player overlay
1 / 22
About This Presentation
Transcript and Presenter's Notes

Title: A short introduction to applied econometrics Part C: Introduction to STATA


1
A short introduction to applied econometricsPart
C Introduction to STATA
  • presented by
  • Dipl. Volkswirt Gerhard Kling

2
How to transfer data to STATA?
  • Stattransfer special software package
  • Very convenient!
  • Excel, SPSS, Eviews, STATA, Gauss etc.
  • Use import function in STATA
  • Similar to the Excel import procedure
  • Sometimes mistakes (dot comma etc.)
  • Advice Store your data in Excel
  • Easy for calculations
  • Still the best figures

3
The windows of STATA
  • Output window shows estimation results
  • Command line To type your instructions
  • Review box You can go back to former commands
    and correct mistakes
  • Variables List of current variables, can be
    included into commands
  • Data editor similar to SPSS shows data set
  • Do-file editor To run sequence of commands or
    self-designed programs

4
Help function
  • Search for commands or online sources
  • New programs are downloadable!
  • Access to example files
  • Files are written in STATA syntax
  • Syntax of STATA commands
  • command varlist if in, options required
    specifications
  • Example
  • regress gdp pop sav if gdplt2, robust nocons

5
The syntax of STATA
  • Help file tells you the appropriate syntax
  • Some commands have funny abbreviations like tsset
  • Note write if gdp2 not if gdp2
  • But write gen gdp2
  • Some commands require to specify an option
    command (like lag(2) after newey)
  • After a while, you will learn the syntax
    automatically!

6
Extended Harrod Domar model
  • Problems with omitted variables
  • Hence, we include additional information
  • Urban of population in urban areas
  • Trade of GDP (ImportExport)
  • Debt of GDP (only external debt of state)
  • Inflation CPI
  • Real real interest rate
  • FDI of GDP
  • AID of GDP
  • Over real overvaluation of the currency

7
How should we start?
  • Get an overview of data structure
  • list, data editor
  • Use descriptive statistics
  • sum variable, detail
  • tabstat varlist, statistics(mean sd...)
  • Missing values overview
  • codebook varlist

8
How are variables distributed?
  • Histograms histogram variable
  • Kernel density kdensity variable
  • Outliners are considerable
  • Debt, inflation
  • Extreme distribution of the aid variable
  • Solution Transform aid variable
  • Construct dummies for categories
  • Less 10, less 25, less 50, extreme cases

9
Generate dummy variables
  • We now try to build up categories of foreign aid
  • gen d101 if aidlt10
  • replace d100 if d10.
  • gen d251 if aidlt25 aidgt10
  • replace d250 if d25.
  • gen d501 if aidlt50 aidgt25
  • replace d500 if d50.
  • gen dextreme1 if aidgt50
  • replace dextreme0 if dextreme.

10
Correlation matrix
  • To identify multicollinearity
  • Later investigate relations precisely
  • Command correlate varlist
  • Correlation coefficients seem to be small
  • But Many variables auxiliary regressions?

11
Use scatterplots
  • Growth rate of GDP should appear on the vertical
    axis several explanatory variables
  • Command scatter two variables
  • Scatter with fitted curve
  • Command twoway (scatter gdp sav) (lfit gdp sav)

12
First impression
  • No relation urban, trade, fdi, over
  • Positive sav
  • Negative pop, real (few observations)
  • Outliners and few observations
  • Debt
  • Inflation
  • Preliminary results can help to specify
    regression!

13
How to specify a regression model?
  • Different methodologies I prefer from general to
    specific
  • Advantage Important effects included
  • Disadvantage Too many variables
  • Risk overspecification!
  • Run regression with all variables
  • Command reg depvar varlist
  • Be careful when inserting dummies!

14
Regression with all variables
  • Too few observations only 25!
  • All coefficients are not significant
  • Specification problem different sample size
  • F-test indicates low explanatory power
  • Adjusted R2 even negative
  • What should we do now?
  • Solution Use information provided by scatter
    plots drop variables with outliners and few
    observations

15
Drop variables with too few observations
  • Drop debt and inflation few observations
  • Drop urban, trade, fdi, over no relation
  • Drop aid variables
  • Specification tests like log likelihood are in
    this case not really reliable
  • Because Change in sample size!

16
Log likelihood ratio test
  • Skip variables with too few observations
  • Then regress with sav, pop, urban, trade, fdi,
    over, aid dummies
  • Save regression est store A
  • Reduce model and test if reduction is allowed
  • Command lrtest A
  • Important You have to fix the sample size using
    if option!
  • We end up with our HD model!

17
Latin American crisis
  • Thus far, our approach was not a success
  • We know from session two that Latin American
    countries behave differently!
  • By inserting an intercept dummy, we control for
    this shock
  • Now, re-run the specification procedure!
  • Model C cannot be rejected!

18
Test whether CLR assumptions are fulfilled
  • Model with latin, sav, pop, urban, real
  • Heteroscedasticity hettest, whitetst
  • Correlation matrix correlate varlist
  • Ramsey RESET ovtest
  • Results
  • Homoscedastic disturbances
  • No multicollinearity
  • OV or non-linearity

19
How to deal with non-linearity
  • Generate squared explanatory variables
  • Command gen poppoppop etc.
  • Include these squared variables
  • Test the model down using LR tests
  • We end up with latin, sav, pop, pop2, urban,
    urban2, real2

20
Conclusion
  • Stick to a specific model selection methodology
  • Sometimes theory offers good specifications
  • Try to interpret the model
  • Make illustrations of the non-linear impacts
    use Excel!
  • Improvement Panel data analysis, causality,
    dynamics etc.

21
Impact of population growth
22
Impact of urbanization
Write a Comment
User Comments (0)
About PowerShow.com