Using NLOGIT for Discrete Choice Modeling

Slides:



Advertisements
Similar presentations
Econometrics I Professor William Greene Stern School of Business
Advertisements

Discrete Choice Modeling William Greene Stern School of Business New York University Lab Sessions.
Discrete Choice Modeling
Discrete Choice Modeling William Greene Stern School of Business New York University Lab Sessions.
Discrete Choice Modeling William Greene Stern School of Business New York University Lab Sessions.
Applied Econometrics Second edition
Discrete Choice Modeling William Greene Stern School of Business New York University.
Part 17: Nonlinear Regression 17-1/26 Econometrics I Professor William Greene Stern School of Business Department of Economics.
Part 12: Asymptotics for the Regression Model 12-1/39 Econometrics I Professor William Greene Stern School of Business Department of Economics.
3. Binary Choice – Inference. Hypothesis Testing in Binary Choice Models.
Discrete Choice Modeling William Greene Stern School of Business New York University Lab Sessions.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
Part 12: Random Parameters [ 1/46] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business.
Discrete Choice Modeling William Greene Stern School of Business New York University Lab Sessions.
Discrete Choice Modeling William Greene Stern School of Business New York University Lab Sessions.
Statistical Inference and Regression Analysis: GB Professor William Greene Stern School of Business IOMS Department Department of Economics.
A Simple Guide to Using SPSS© for Windows
Part 4: Partial Regression and Correlation 4-1/24 Econometrics I Professor William Greene Stern School of Business Department of Economics.
EViews. Agenda Introduction EViews files and data Examining the data Estimating equations.
Introduction to SPSS Short Courses Last created (Feb, 2008) Kentaka Aruga.
Discrete Choice Modeling William Greene Stern School of Business New York University Lab Sessions.
Efficiency Measurement William Greene Stern School of Business New York University.
Empirical Methods for Microeconomic Applications William Greene Department of Economics Stern School of Business.
Part 5: Random Effects [ 1/54] Econometric Analysis of Panel Data William Greene Department of Economics Stern School of Business.
Using SPSS for Windows Part II Jie Chen Ph.D. Phone: /6/20151.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 1 Introduction.
Frontier Models and Efficiency Measurement Lab Session 1 William Greene Stern School of Business New York University 0Introduction 1Efficiency Measurement.
Forecasting Choices. Types of Variable Variable Quantitative Qualitative Continuous Discrete (counting) Ordinal Nominal.
Introduction to SPSS. Object of the class About the windows in SPSS The basics of managing data files The basic analysis in SPSS.
Empirical Methods for Microeconomic Applications William Greene Department of Economics Stern School of Business.
How to use Limdep?. Three important windows 1.Project window (you can check e.g. the variable and matrix lists and how the variables are coded) 2. Editing.
1/26: Topic 2.2 – Nonlinear Panel Data Models Microeconometric Modeling William Greene Stern School of Business New York University New York NY USA William.
The Probit Model Alexander Spermann University of Freiburg SoSe 2009
An Interactive Tutorial for SPSS 10.0 for Windows©
The Multiple Regression Model
Limited Dependent Variables
15.5 The Hausman test For the random effects estimator to be unbiased in large samples, the effects must be uncorrelated with the explanatory variables.
By Dr. Madhukar H. Dalvi Nagindas Khandwala college
Basic operations in Matlab
DEPARTMENT OF COMPUTER SCIENCE
Microeconometric Modeling
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Discrete Choice Modeling
Microeconometric Modeling
Use of Mathematics using Technology (Maltlab)
Econometric Analysis of Panel Data
Empirical Methods for Microeconomic Applications
Econometric Analysis of Panel Data
Statistical Inference and Regression Analysis: GB
Econometric Analysis of Panel Data
Microeconometric Modeling
Eviews Tutorial for Labor Economics Lei Lei
Econometrics Chengyuan Yin School of Mathematics.
Discrete Choice Modeling
Econometrics I Professor William Greene Stern School of Business
Scripts In Matlab.
Econometrics I Professor William Greene Stern School of Business
Econometrics I Professor William Greene Stern School of Business
Microeconometric Modeling
Econometric Analysis of Panel Data
Chengyuan Yin School of mathematics
MPHIL AdvancedEconometrics
Microeconometric Modeling
Econometrics I Professor William Greene Stern School of Business
Microeconometric Modeling
Microeconometric Modeling
Empirical Methods for Microeconomic Applications
Econometrics I Professor William Greene Stern School of Business
Empirical Methods for Microeconomic Applications
Empirical Methods for Microeconomic Applications
Presentation transcript:

Using NLOGIT for Discrete Choice Modeling William Greene Department of Economics Stern School of Business

Getting Started

Upload Your Project File

Contents of the Project File Open folder Name Sample size Variables

Use File:New/OK to open an Editing Window

Type Commands in the Editor

Use File:Open to open a command file

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 $

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

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 _

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.

The Go Button

“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)

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$

Model Commands Generic form: Model name ; Lhs = dependent variable ; Rhs = independent variables $ Almost all models require ;Lhs and ;Rhs. Rhs should generally include ONE to request a constant term. Models have different other required specifications Many optional specifications.

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

Other Models Other Types of Models Use the whole sample REGRESS ; Lhs = income ; Rhs = One,age educ,female $ LOGIT ; Lhs = doctor LOGIT ; If [ married = 1] ; Lhs = doctor ; Rhs = one,age,educ,female ; RPM ; Fcn = one(n),age(n),educ(n)$ Other Types of Models

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

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

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

Output Window

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 $

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 $

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.

Save Your Work When You Exit

The Project and Command files will be waiting for you when you restart the program.