Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Empirical Methods for Microeconomic Applications William Greene Department of Economics Stern School of Business."— 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 Open folder Name Sample size Variables Contents of the Project File

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

6

7 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 $

8 Type Commands in the Editor

9 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 $

10 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 _

11 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.

12 The Go Button

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

14 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$

15

16 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

17

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

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

20 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

21 Output Window

22 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 $

23 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= ; m = R*B - q ; C=R*XXI*R' ; bstar = B - XXI*R'* *m ; Vbstar=VARB - ssqrd*XXI*R'* *R*XXI $ DISPLAY ; Parameters = bstar ; Labels = x ; Covariance = vbstar $

24

25 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 R 2 in the most recent regression), and sumsqdev.

26 Save Your Work When You Exit


Download ppt "Empirical Methods for Microeconomic Applications William Greene Department of Economics Stern School of Business."

Similar presentations


Ads by Google