1 / 26

Empirical Methods for Microeconomic Applications

Empirical Methods for Microeconomic Applications. William Greene Department of Economics Stern School of Business. Lab 1. Descriptive Tools, Regression, Panel Data. Upload Your Project File. Contents of the Project File. Open folder. Name Sample size Variables.

erma
Download Presentation

Empirical Methods for Microeconomic Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Empirical Methods for Microeconomic Applications William Greene Department of Economics Stern School of Business

  2. Lab 1. Descriptive Tools, Regression, Panel Data

  3. Upload Your Project File

  4. Contents of the Project File Open folder Name Sample size Variables

  5. Use File:New/OK to open an Editing Window

  6. Generic Command Format Verb ; specification ; specification ; … $  Every command ends with $  Use as many lines as desired.  Use spaces wherever desired.  Capital or lower case – no matter. Example: Create ; x = z*y + log(Income) $ Example; PROBIT ; Lhs = doctor ; Rhs = one,X $

  7. Type Commands in the Editor

  8. Important Commands: SAMPLE ; first - last $ • Sample ; 1 – 1000 $ • Sample ; All $ CREATE ; Variable = transformation $ • Create ; loginc = Log(income) $ • Create ; logincF = .5*loginc*female $ • Create ; … any algebraic transformation $

  9. Name Conventions CREATE ; name = any result desired $ Name is the name of a new variable • No more than 8 characters in a name • The first character must be a letter or _ • May not contain -,+,*,/,^,%,!,@,#, etc. • May contain _

  10. Model Command Model ; Lhs = dependent variable ; Rhs = list of independent variables $ • Regress ; Lhs = income ; Rhs = ONE,age,educ,female $ • ONE requests the constant term Models are REGRESS, PROBIT, POISSON, LOGIT, TOBIT, … and over 100 others. All have the same form.

  11. The Go Button

  12. “Submitting” Commands One line command • Place cursor on that line • Press “Go” button More than one line command and/ormore than one command. • Highlight all lines (like any text editor) • Press “Go” button

  13. Describe the data DSTAT ; Rhs = * $ Kernel Estimator KERNEL ; Rhs = income $ or KERNEL ; If[female = 1 & married = 1] ; Rhs = income ; Title=Kernel Estimator for Married Women$

  14. Compute a Regression Use the whole sample REGRESS ; Lhs = income ; Rhs = One,age educ,female $ Use part of the sample REGRESS ; If [ married = 1] ; Lhs = income ; Rhs = one,age,educ,female $ The constant term in the model

  15. Interactions and Nonlinearities Regress ; Lhs = loginc ; Rhs = One,age,age^2,educ, female, female*educ $

  16. Standard Three Window Operation Commands typed in editing window Project window shows variables Results appear in output window

  17. Model Results Regress ; Lhs = income ; Rhs =One,age,educ,female ; Res = e $ (Regression with residuals saved) Produces results: Displayed results in output Variables added to data set Matrices Named Scalars

  18. Output Window

  19. New Variable Regress;Lhs=income ;Rhs=One,age,educ,female ; Res = e $ ? We can now manipulate the new ? variable created by the regression. Namelist ; z = married,hhkids $ Create;esq = e*e / (sumsqdev/nreg) – 1 $ Regress; Lhs = esq ; Rhs=One,z $ Calc ; List ; LMTstHet = nreg*Rsqrd $

  20. Saved Matrices B=estimated coefficients and VARB=estimated asymptotic covariance matrix are saved by every model command. Different model estimators save other results as well. Here, we manipulate B and VARB to compute a restricted least squares estimator the hard way. REGRESS ; Lhs = income ; Rhs=One,age,educ,female $ NAMELIST ; X = One, age,educ,female $ MATRIX ; R = [0,1,1,1] ; q = [1] ; XXI=<X'X> ; m = R*B - q ; C=R*XXI*R' ; bstar = B - XXI*R'*<C>*m ; Vbstar=VARB - ssqrd*XXI*R'*<C>*R*XXI $ DISPLAY ; Parameters = bstar ; Labels = x ; Covariance = vbstar $

  21. Saved Scalars Model estimates include named scalars. Linear regressions save numerous scalars. Others usually save 3 or 4, such as LOGL, and others. The program on the previous page used SSQRD saved by the regression. The LM test two pages back used NREG (the number of observations used), RSQRD (the R2 in the most recent regression), and sumsqdev.

  22. Save Your Work When You Exit

More Related