PROGRAMS AND OUTPUT
AND DATA FOR ENTIRE BOOK
[CHAPTERS 1-25 COMPLETE. CHAPTERS 26-27 TO BE COMPLETED IN JUNE]
For a zipped file with all programs and data and output
click here
[This version October 24 2005. See included file readme.txt for explanations].
For some explanation of programs click here
For details on the data sets click here
PROGRAMS: I. INTRODUCTION (chapters 1-3)
No programs.
PROGRAMS: II. CORE METHODS (chapters 4-10)
Section |
Pages |
Example |
Program and Output |
Data
[* means generated] |
4.5.3 |
84-5 |
Robust Standard
Errors for OLS, WLS and GLS |
mma04p1wls.do mma04p1wls.txt |
* mma04p1wls.asc |
4.6.4 |
88-90 |
Quantile and Median
Regression |
mma04p2qreg.do mma04p2qreg.txt |
qreg0902.dta or qreg0902.asc |
4.8.8 |
102-3 |
Instrumental Variables
Regression |
mma04p3iv.do mma04p3iv.txt |
* mma04p3iv.asc |
4.9.6 |
110-2 |
IV Application with
Weak Instruments |
mma04p4ivweak.do mma04p4ivweak.txt |
DATA66.dat and DATA66.dct |
5.9.2-3 |
159-63 |
Exponential: MLE
using ml command |
mma05p1mle.do mma05p1mle.txt |
* mma05data.asc |
5.9.2-3 |
159-63 |
Exponential: NLS
using nl command |
mma05p2nls.do mma05p2nls.txt |
* mma05data.asc |
5.9.2-3 |
159-63 |
Exponential: NLS
using ml command |
mma05p3nlsbyml.do mma05p3nlsbyml.txt |
* mma05data.asc |
5.9.4 |
159-63 |
Exponential: Computation
of marginal effects |
mma05p4margeffects.do mma05p4margeffects.txt |
* mma05data.asc |
6.5.4 |
198-9 |
Nonlinear 2SLS:
Using Limdep |
mma06p1nl2sls.lim mma06p1nl2sls.out |
* mma06p1nl2sls.asc |
6.5.4 |
198-9 |
Part of preceding
using Stata |
mma06p2twostage.do mma06p2twostage.txt |
* mma06p1nl2sls.asc |
7.4 |
241-3 |
Likelihood-based
Hypothesis Testts |
mma07p1mltests.do mma07p1mltests.txt |
* mma07p1mltests.asc |
7.6.3 |
248-9 |
Asymptotic Power
of Wald Test |
mma07p2power.do mma07p2power.txt |
No data |
7.7.1-5 |
250-4 |
Monte Carlo Simulation
of Wald Test |
mma07p3montecarlo.do mma07p3montecarlo.txt |
Data for many simulations
not saved |
7.8 |
254-6 |
Bootstrap example |
mma07p4boot.do mma07p4boot.txt |
* mma07p4boot.asc |
8.2.9 |
269-71 |
Conditional moment tests
example |
mma08p1cmtests.do mma08p1cmtests.txt |
* mma08p1cmtests.asc |
8.5.5 |
283-4 |
Nonnested models test
example |
mma08p2nonnested.do mma08p2nonnested.txt |
* mma08p2nonnested.asc |
8.7.3 |
290-1 |
Model diagnostics example |
mma08p3diagnostics.do mma08p3diagnostics.txt |
* mma08p3diagnostics.asc |
9.2 |
295-7 300 |
Nonparametric density
estimation and regression: appplication |
mma09p1np.do mma09p1np.txt |
|
9.4-9.5 |
307-19 |
Nonparametric regression:
more |
mma09p2npmore.do mma09p2npmore.txt |
* mma09p2npmore.asc |
9.3.3 |
300 |
Kernel functions plotted
(extra not in book). |
mma09p3kernels.do mma09p3kernels.txt |
* mma09p3kernels.asc |
10.2.5 |
338-9 |
Gradient method example
(Newton Raphson) |
mma10p1gradient.do mma10p1gradient.txt |
No data |
PROGRAMS: III. Computationally-Intensive Methods
(chapters 11-13)
Section |
Pages |
Example |
Program and Output |
Data |
11.3 |
366-8 |
Bootstrap example |
mma11p1boot.do mma11p1boot.txt |
* mma11p1boot.asc |
12.3.3 |
391-2 |
Integral Computation
Example |
mma12p1integration.do mma12p1integration.txt |
No data |
12.4.5, 12.5.6 |
397-7, 403-4 |
Maximum Simulated Likelihood
and Maximum Simulated Score Example |
mma12p2mslmsm.do mma12p2mslmsm.txt |
* mma12p2mslmsm.asc |
12.8.2 |
412-3 |
Illustration of
Methods to Draw Random Variates |
mma12p3draws.do mma12p3draws.txt |
No data |
13.2.2 |
424 |
Bayes Theorem Illustration
for Normal Distribution and Prior |
mma13p1bayesthm.do mma13p1bayesthm.txt |
No data |
13.6 |
452-4 |
MCMC Example: Gibbs
Sampler for SUR |
mma13p2bayesgibbs.sas mma13p2bayesgibbs.lst mma13p2bayesgibbs.log |
Program generated |
PROGRAMS: IV. Models for Cross-Section Data
(chapters 14-20)
Section |
Pages |
Example |
Program and Output |
Data |
14.2 |
464-5 |
Logit and Probit
Application (fishing mode) |
mma14p1binary.do mma14p1binary.txt |
Nldata.asc |
14.7.5 |
486 |
Maximum score estimator
for binary outcome |
mma14p2maxscore.lim mma14p2maxscore.out |
mma14p1binary.asc |
15.2.1-3 |
491-5 |
Multinomial Logit
and Conditional Logit Application (fishing mode) |
mma15p1mnl.do mma15p1mnl.txt |
Nldata.asc |
15.6.3 |
511 |
Nested Logit (or
GEV) estimation |
mma15p2gev.do mma15p2gev.txt |
Nldata.asc |
15.2.2 |
493-4 |
Limdep multinomial logit |
mma15p3mnl.lim mma15p3mnl.out |
Nldata.asc |
15.2.1-3 |
491-5 |
Limdep and addon
Nlogit for conditional and nested logit |
mma15p4gev.lim mma15p4gev.out |
mma15p4gev.asc |
16.2.1 |
530-1, 565 |
Classic Tobit MLE and CLAD |
mma16p1tobit.do mma16p1tobit.txt |
mma16p1tobit.asc |
16.3.4 |
540 |
Inverse Mills ratio plotted [corrected 11/6/2006] |
mma16p2mills.do mma16p2mills.txt |
No data |
16.6 |
553-5 |
Selection Model Application
(medical expenditures) |
mma16p3selection.do mma16p3selection.txt |
randdata.dta
or mma16p3selection.asc |
17.2 17.5.1 |
574-5 581-3 |
Nonparametric estimation (KM for
NA) for survival data (strike duration) |
mma17p1km.do mma17p1km.txt |
strkdur.dta
or strkdur.asc |
17.5.1 |
581-2 |
Nonparametric estimation (KM and
NA) for survival data (artificial) |
mma17p2kmextra.do mma17p2kmextra.txt |
Data in program |
17.6.1 |
584-6 |
Weibull distribution functions plotted |
mma17p3weib.do mma17p3weib.txt |
No data |
17.11 |
603-8 |
Duration regression models (unemployment
duration) |
mma17p4duration.do mma17p4duration.txt |
ema1996.dta or ema1996.asc |
18.8 |
632-6 |
Duration regression with unobserved
heterogeneity (unemployment duration) |
mma18p1heterogeneity.do mma18p1heterogeneity.txt |
ema1996.dta or ema1996.asc |
19.5 |
658-3 |
Competing risks model (unemployment
duration) |
mma19p1comprisks.do mma19p1comprisks.txt |
ema1996.dta or ema1996.asc |
20.2 20.7 |
671-4 690 |
Count regression (doctor contacts) [Table 20.6 added 11/6/2006] |
mma20p1count.do mma20p1count.txt |
randdata.dta mma20p1count.asc |
PROGRAMS: V. Models for Panel Data (chapters 21-23)
Section |
Pages |
Example |
Program and
Output |
Data |
21.3.1-3 |
708-13 |
Linear Panel Fixed
and Random Effects Application (hours and wages) |
mma21p1panfeandre.do mma21p1panfeandre.txt |
MOM.dat |
21.3.2 21.3.4 |
710 719 |
Linear Panel Estimators
manually obtained by OLS on transformed equation (hours and wages) |
mma21p2panmanual.do mma21p2panmanual.txt |
MOM.dat |
21.3.4 |
713-5 |
Linear Panel Residual
Analysis (hours and wages) |
mma21p3panresiduals.do mma21p3panresiduals.txt |
MOM.dat |
21.5.5 |
725 |
Linear Panel pooled
OLS and GLS estimation (hours and wages) |
mma21p4pangls.do mma21p4pangls.txt |
MOM.dat |
22.3 |
754-6 |
Linear Panel GMM Application
(hours and wages) |
mma22p1gmmpanel.do mma22p1gmmpanel.txt |
MOMprecise.dat |
23.3 |
792-5 |
Nonlinear Panel Application
(patents and R&D) |
mma23p1pannonlin.do mma23p1pannonlin.txt |
patr7079.asc |
PROGRAMS: VI. Further Methods (chapters 24-27)
Section |
Pages |
Example |
Program and Output |
Data |
24.7 |
848-53 |
Clustered Linear
Regression (household medical expenditure clustered on commune) |
mma24p1olscluster.do mma24p1olscluster.txt |
vietnam_ex1.dta or vietnam_ex1.asc |
Clustered Poisson Regression (individual
pharmacy visits clustered on commune) |
mma24p2poiscluster.do mma24p2poiscluster.txt |
vietnam_ex2.dta or vietnam_ex2.asc |
||
25.8.1-4 |
889-93 |
Treatment Evaluation:
Simple calculations (training on earnings) |
mma25p1treatment.do mma25p1treatment.txt |
nswpsid.da1 or nswpsid.dta |
25.8.5 |
893-6 |
Treatment Evaluation: Propensity score matching
(training on earnings): |
mma25p2matching.do mma25p2matching.txt |
nswpsid.da1 or nswpsid.dta |
25.8 |
889-96 |
Treatment Evaluation: Additional analysis
not in book using additional data sets (NSW experimental controls and
CPS controls) |
mma25p3extra.do mma25p3extra.txt |
nswre74_treated.dta
and nswre74_control.dta or nswre74_all.asc propensity_cps.dta or propensity_cps.asc |
26.5 |
919 |
Measurement Error
Bias Logit |
mma26p1melogit.do mma26p1melogit.txt |
Generated data |
27.8.1 |
936-7 |
Missing Data Multiple
Imputation Linear |
mma27p1milinear.do mma27p1milinear.txt mma27p2milinear.sas mma27p2milinear.lst mma27p2milinear.log |
mma27linear1.asc mma27linear2.asc mma27linear3.asc mma27linear4.asc |
27.8.2 |
937-9 |
Missing Data Multiple Imputation Logit |
mma27p3milogit.do mma27p3milogit.txt mma27p4milogit.sas mma27p4milogit.lst mma27p4milogit.log |
mma27logit1.asc mma27logit2.asc mma27logit3.asc mma27logit4.asc |