Econometrics

© All Rights Reserved

76 views

Econometrics

© All Rights Reserved

- Homework 02 Answers
- Answers to Assignment 1
- ECONOMETRICS-Assignment 2
- econometrics Solutions
- Formula Sheet Econometrics.pdf
- Brooks Answers (Introductory Econometrics for Finance)
- Econometrics Project
- Econometrics Project
- Econometrics Project
- econometrics paper.docx
- Econometrics Exam.
- econometricsTutorials_Exam_QuestionsSelectedAnswers
- Econometrics
- Econometrics Homework
- Basics of Econometrics
- Jawapan Econometrics Phd
- Econometrics Assignment
- Econometrics Problem Set
- Econometrics Assignment No 1
- Honors Exam 2012 Econometrics With 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

- Homework 02 AnswersUploaded byornelaabegaj_8315239
- Answers to Assignment 1Uploaded byGeorge Lee
- ECONOMETRICS-Assignment 2Uploaded byGaby Jacinda Andreas
- econometrics SolutionsUploaded byarmailgm
- Formula Sheet Econometrics.pdfUploaded byJustin Huynh
- Brooks Answers (Introductory Econometrics for Finance)Uploaded byAndreyZinchenko
- Econometrics ProjectUploaded byUDallasEcon
- Econometrics ProjectUploaded byRohit Pandey
- Econometrics ProjectUploaded byLavinia Sandru
- econometrics paper.docxUploaded byrina
- Econometrics Exam.Uploaded byShayan Ahmed
- econometricsTutorials_Exam_QuestionsSelectedAnswersUploaded byFiliz Ertekin
- EconometricsUploaded byAaron KW
- Econometrics HomeworkUploaded bykmbibireddy
- Basics of EconometricsUploaded byJorge Rojas-Vallejos
- Jawapan Econometrics PhdUploaded byNoel Chenta Adrastos
- Econometrics AssignmentUploaded byBhanu Kant Jhingan
- Econometrics Problem SetUploaded byjohnpaulcorpus
- Econometrics Assignment No 1Uploaded byNischal Thapa
- Honors Exam 2012 Econometrics With AnswersUploaded byCindy Toh
- EconometricsUploaded byshyasir
- Homework 04 AnswersUploaded byMo Ml
- Assignment 3 SolutionsUploaded byFaas1337
- PGDBAUploaded bysmriti
- Multiple Regression AnswersUploaded byAli Khaliq
- Econometrics Question and AnswerUploaded byEdith Kua
- Econometrics Assignment HW4Uploaded byNikhil Sharma
- Econometrics EssayUploaded byErin Madden
- Econometrics: Assignment 1Uploaded byrcraw87
- Summary EconometricsUploaded byFatimah Ahmad

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

- 5th sem syllabusUploaded byJg
- The Elephants in the RoomUploaded byJoshua
- Cluster AnalysisUploaded byFrancisco Andres Garcia Barrera
- Infosys Hw4Uploaded byAdam Ong
- Avoiding Pressure Surge Damage in PipelineUploaded byFerlie Indrapati
- Mo Iwa Fun Oniwa : Individuality of Being in Classical Yoruba OntologyUploaded byToyin Adepoju
- Class 02 - Types of MaintenanceUploaded byb_shadid8399
- Activity Book for 3-4 years Children.pdfUploaded byMarietta Mosolygó
- Shear Strength in the New Eurocode 2. a Step ForwardUploaded byChineseAssassin
- Chapter 39Uploaded byGrace Sun Hae Lutia
- Dickerman-Stock Illustrations of Animal Intelligence (TAPhA 42 [1911])Uploaded byBudbudabuddha
- TEK Exchange Courses Spring 19 - Autumn 19Uploaded byBobby Yusuf Haka
- Dead Women Talking Full Report FinalUploaded byjefry
- Directory of ScholarshipUploaded bypalkybd
- Big Data Sourcebook Your Guide to the Data Revolution Free eBookUploaded byKrishna Dash
- ProgrammingSeftTestUploaded byblackvoodoo
- VESFG001Uploaded byromeo112976
- What is SyllabusUploaded byDesfindah Ranita
- Hypercom T4220 Credit Card MachineUploaded byMerchant Service Provider
- Optimizer.pdfUploaded byjhbr23
- Negative Theology of the Yogavasistha and the Lankavatara SutraUploaded bySivason
- 10g NF-II D39100Uploaded byAnonymous EZO2aZ
- CodingUploaded bybalavignesh1313
- REGIS LAURENT, "AN INTRODUCTION TO ARISTOTLE’S METAPHYSICS OF TIME.Historical research into the mythological and astronomical conceptions that preceded Aristotle’s philosophy"Uploaded byVillegagnonsPlaisance
- EE6913-SyllabusUploaded bykarthikhrajv
- 161017 Rhonheimer Moral ObjectsUploaded byThomist Aquinas
- SssUploaded byKona Kiran
- Biological Effects of Electromagnetic InformationUploaded byGuido AB
- Animal Clinical ChemistryUploaded byAngel Garcia
- Course FileUploaded byabhinay1111

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.