76 views

Uploaded by arsalan1984

Econometrics

- Jawapan Econometrics Phd
- PGDBA
- Econometrics Problem Set
- Assignment 3 Solutions
- Econometrics Homework
- Formula Sheet Econometrics.pdf
- Econometrics Project
- Honors Exam 2012 Econometrics With Answers
- econometrics paper.docx
- Econometrics Exam.
- Section A
- Econometrics Assignment No 1
- Econometrics PS Final Answers: Replication study
- BAB 7 Multiple Regression and Other Extensions of the Simple
- Homework 04 Answers
- Summary Econometrics
- Answers
- Econometrics Essay
- Econometrics Assignment HW4
- Homework 02 Answers

You are on page 1of 4

This version: March 4, 2010

Original version: October 22, 2009

Abstract

The original edition of Microeconometrics using Stata, published in December 2008, was

written for Stata version 10.1. Here we consider use of the original edition using Stata version

11, released in July 2009, including the February 2010 update to the ml command.

Note also that the revised edition of Microeconometrics using Stata, published in February

2010, incorporates the changes discussed below.

1. Introduction

The original edition of Microeconometrics using Stata, published in December 2008, was written

for Stata version 10.1. Here we consider use of the original edition using Stata version 11, released

in July 2009.

All the book programs will run in Stata 11 as published, because they all include a version

control command { version 10.1.

If you want to instead run the programs in Stata 11 under version 11, replace the version control

command version 10.1 with version 11. Then all the book programs except for two will run

without modi cation. In the next section, we discuss the changes required for these two examples.

In the following section, we discuss how some of the examples can be more simply implemented

using commands introduced in Stata 11.

We assume that the user has used the update command in Stata, so that the most recent update

of Stata version 11 is being used.

It is better to run the programs in Stata 11 under version 11. To do so wherever the command

. version 10.1

appears, replace it with the command

. version 11

In that case all the book programs will run in Stata 11 with three exceptions, examples in

programs using the ml command in chapter 11 (given in le mus11p1opt.do). These exceptions

arise because the ml command is now a front end to the new Mata moptimize() optimization

function, necessitating minor changes to the ml command to be consistent with moptimize().

Furthermore, a February 2010 update to Stata 11 included additional changes to these commands. The new documentation for the changed ml commands can be obtained at

http://www.stata.com/support/errata/i/stata11/ml.pdf, as well as in corresponding les

moptimize.pdf and optimize.pdf for the related commands.

First, in the example on pages 374-5 that computes robust standard errors, the ml command d1

method should be changed to the new lf1 method. So on page 374 replace the program d1poissrob

with

. * Method lf1: Program lf1poisrob is variation of program d1pois for robust se's

. program lf1poisrob

1. version 11

2. args todo b lnfj g1

3. tempvar theta1 // theta1 = x'b where x given in eq(1)

4. mleval `theta1' = `b', eq(1)

5. local y $ML_y1 // define y so program more readable

7. quietly replace `lnfj' = -exp(`theta1') + `y'*`theta1' - lnfactorial(`y')

8. if (`todo'==0) exit

9. quietly replace `g1' = `y' - exp(`theta1') // extra code for robust

10. end

and then on page 375 replace

. ml model d1 d1poisrob (docvis = private chronic female income), vce(robust)

with

. ml model lf1 lf1poisrob (docvis = private chronic female income), vce(robust)

Similarly if method d2 was used with a robust VCE option we should change the method to lf2.

Second, in the example on pages 375-6 that uses the ml command d2 method, the option negh

should be added. So on page 375 replace

. ml model d2 d2pois (docvis = private chronic female income)

with

. ml model d2 d2pois (docvis = private chronic female income), negh

The reason for this change is that the ml command d2 method feeds into new Mata moptimize()

command d2 evaluator which as default has the user de ne the Hessian, so in version 11 the ml

command d2 method as default has the user de ne the Hessian. By contrast, previous versions of

Stata asked for de nition of minus the Hessian. The version 11 option negh signals that minus the

Hessian has been provided.

2

Third, the type v evaluators for the optimize() function have been renamed to type gf evaluators. Throughout section 11.7 change the v2 method to the gf2 method. In particular in the

fourth last line of code on page 378 change

: optimize_init_evaluatortype(S, "v2")

to

: optimize_init_evaluatortype(S, "gf2")

Stata version 11 introduces several new commands and constructs that make it easier to implement

some of the methods given in the book.

3.1. Marginal e ects

The new Stata margins command supplants the Stata mfx command and the user-written margeff

command. The mfx and margeff commands can still be used, but it is better to use margins. The

margins command is fully supported by Stata and will compute the average marginal e ect for

many more models than user-written command margeff.

For example, consider the chapter 10.6 Poisson regression

. poisson docvis private chronic female income, vce(robust)

To obtain, respectively, the marginal e ect at the mean (MEM), marginal e ect at a representative value (MER) and average marginal e ect (AME) for all regressors give the commands

. margins, dydx(*) atmean

. margins, dydx(*) at(private=1 chronic=0 female=1 income=10)

. margins, dydx(*)

//

//

//

MEM

MER

AME

The marginal e ects computed using the above commands will use calculus methods. For

indicator variables it is better to use the nite-di erence method (which is the default for mfx and

margeff). To do so using the margins command we rst identify the variables that are indicator

variables using variable name pre x i.

.

.

.

.

margins, dydx(*) atmean

//

margins, dydx(*) at(private=1 chronic=0 female=1 income=10) //

margins, dydx(*)

//

MEM

MER

AME

These commands yield the same output as given in chapter 10.6 of the book.

The pre x i. used in the preceding example is now part of a broader construct called factor

variables. See especially [U] 25 Working with categorical data and factor variables (pp.

339-357). Factor variables make it much easier to de ne models based on sets of indicator variables

formed from categorical variables, and models with interactions between any combination of sets of

indicator variables and continuous variables. This also makes it much easier to perform hypothesis

tests of group e ects and to compute marginal e ects in models with interactions.

For example, consider the page 345 example of computation of the AME when income appears

in a cubic polynomial. The commands

. quietly poisson docvis private chronic female c.income c.income#c.income ///

>

c.income#c.income#c.income, vce(robust)

. margins, dydx(income)

give the same estimate of the AME as on page 345, and additionally give the standard error and

associated 95 percent con dence interval for this estimate.

3.3. Generalized method of moments

Version 11 of Stata introduces the gmm command to compute generalized method of moment (GMM)

estimators. This makes it much easier to code up the nonlinear instrumental variables examples

given in the book.

The Mata-code example given on pages 381-3 can now be done using the much simpler Stata

code

. gmm (docvis - exp({xb:private chronic female income}+{b0})), ///

> instruments(firmsize chronic female income) onestep

An overidenti ed model is estimated by adding appropriate variables to the instruments list.

In that case one can use option twostep to obtain more e cient estimates, and then use postestimation comand estat overid to enable a test of overidentifying restrictions.

A similar change can be made for the example on pages 596-7.

The revised edition to \Microeconometrics using Stata", published in March 2010 for Stata version 11, incorporates the above-mentioned changes. The programs for the revised edition are at

http://www.stata-press.com/data/musr.html

References

Cameron, A.C., and P.K. Trivedi (2009), Microeconometrics using Stata, College Station (TX),

Stata Press.

Cameron, A.C., and P.K. Trivedi (2010), Microeconometrics using Stata, Revised Edition, College

Station (TX), Stata Press.

4

- Jawapan Econometrics PhdUploaded byNoel Chenta Adrastos
- PGDBAUploaded bysmriti
- Econometrics Problem SetUploaded byjohnpaulcorpus
- Assignment 3 SolutionsUploaded byFaas1337
- Econometrics HomeworkUploaded bykmbibireddy
- Formula Sheet Econometrics.pdfUploaded byJustin Huynh
- Econometrics ProjectUploaded byLavinia Sandru
- Honors Exam 2012 Econometrics With AnswersUploaded byCindy Toh
- econometrics paper.docxUploaded byrina
- Econometrics Exam.Uploaded byShayan Ahmed
- Section AUploaded byDivyen Patel
- Econometrics Assignment No 1Uploaded byNischal Thapa
- Econometrics PS Final Answers: Replication studyUploaded byDzhandarova Nurfatima
- BAB 7 Multiple Regression and Other Extensions of the SimpleUploaded byClaudia Andriani
- Homework 04 AnswersUploaded byMo Ml
- Summary EconometricsUploaded byFatimah Ahmad
- AnswersUploaded byFahd Alahaideb
- Econometrics EssayUploaded byErin Madden
- Econometrics Assignment HW4Uploaded byNikhil Sharma
- Homework 02 AnswersUploaded byornelaabegaj_8315239
- econometrics SolutionsUploaded byarmailgm
- Econometrics ProjectUploaded byUDallasEcon
- Econometrics AssignmentUploaded byBhanu Kant Jhingan
- ECONOMETRICS-Assignment 2Uploaded byGaby Jacinda Andreas
- EconometricsUploaded byshyasir
- Multiple Regression AnswersUploaded byAli Khaliq
- Econometrics: Assignment 1Uploaded byrcraw87
- Econometrics Question and AnswerUploaded byEdith Kua
- Econometrics FinalUploaded byJack Molloy
- Econometrics ProjectUploaded byRohit Pandey

- Chapter 13 Financial Statement Analysis SolutionsUploaded byVi
- Errata.pdfUploaded byarsalan1984
- AFE_Cook[1]Uploaded byarsalan1984
- Research methodUploaded byarsalan1984
- Errata1 POEUploaded byarsalan1984
- Research 32Uploaded byarsalan1984
- DHA_News2012-13 (1)Uploaded byarsalan1984
- 726040711Uploaded byarsalan1984
- Topic1 Version 1Uploaded byarsalan1984
- AFE_Cook[1]Uploaded byarsalan1984
- AFE_Cook[1]Uploaded byarsalan1984
- Tier 1Uploaded byarsalan1984
- HeaderUploaded byMichael Arriesga
- GradesUploaded byarsalan1984
- Gretl ManualUploaded byarsalan1984
- Kingdom of Saudi Arabia Al Taibah MedinahUploaded byarsalan1984
- 01 GrowthUploaded byzee

- Lect16 Symbolic MathematicsUploaded bySergio Andres Rincon Caupaz
- Matrix PropertiesUploaded bymgpadalkar
- GateUploaded byRamesh Konakalla
- Business_Calculus_NotesUploaded byTom Kowalski
- RTA_2_2010_edUploaded byAlbert Ccari Supo
- Problems Involving Rate of ChangeUploaded byPaolo Naguit
- Chapter 4 Solutions MCV4UUploaded byVoormila Nithiananda
- 6Uploaded byApple Genesis
- Methods and Software Engineering Tools for Simulation of Robot DynamicsUploaded byAnonymous Hy5Ir9QX
- The Geometric Application of Ordinary Differential EquationUploaded byDileep Kumar Manjhi
- Harmonic Motion LabUploaded bybminesrules951195
- ecesyllabus[1]Uploaded bynitishk985
- Combination of Dynamic Geometry, Algebra and Calculus in the Software System GeogebraUploaded byAprilYantoni
- Vector Calculus - Final.exam-IUploaded bytinkertinker1435
- BC2 Study GuideUploaded bysmswamy
- Applied Mathematics and Computation Volume 219 issue 3 2012 [doi 10.1016_j.amc.2012.07.007] Chi-Chang Wang; Wu-Jung Liao; Yin-Sung Hsu -- Hybrid spline difference method for the Burgers’ equation.pdfUploaded byNarayanan Srinivasan
- 1-s2.0-S0020746211000977-mainUploaded bynoured547244
- es4 - analysis - slides - rev 2014Uploaded byapi-203629011
- problemUploaded bymohsen133
- Interpolating SplinesUploaded bymykingboody2156
- ppt on applications of derivativesUploaded byPradeep Chaudhary
- BBMP1103 Mathematics for ManagementUploaded byezzatuL
- How to Perform Associative OperationsUploaded byAnnelyanne Rufino
- Chapter 03Uploaded byK Cor
- Malliavin's Calculus and Applications in StochasticUploaded byIgor F. C. Battazza
- mathematics.pdfUploaded byJohn Smith
- Surface IntergralsUploaded byAndrew Shao
- MAT401_A3_T3_2016Uploaded bykukumaluXD
- Fluid Mechanics 1 NotesUploaded byParas Thakur
- CoS Draft April 3 2015Uploaded bySucharitha Suchi