Any applied economic researcher using Stata and anyone teaching or studying microeconometrics will benefit from Cameron and Trivedi’s two volumes. They are an invaluable reference of the theory and intuition behind microeconometric methods using Stata. Those familiar with Cameron and Trivedi’s Microeconometrics: Methods and Applications will find the same rigor. Those familiar with the previous edition of Microeconometrics Using Stata will find the same explanation of Stata commands, their interpretation, and their connection with microeconometric theory as well as an introduction to computational concepts that should be part of any researcher’s toolbox.
This new edition covers all the new Stata developments relevant to microeconometrics that appeared since the the last edition in 2010. It also covers the most recent microeconometric methods that have been contributed by the Stata community but have not yet made it to Stata. For example, readers will find entire new chapters on treatment effects, duration models, spatial autoregressive models, lasso, and Bayesian analysis.
The first volume introduces foundational microeconometric methods, including linear and nonlinear methods for cross-sectional data and linear panel data with and without endogeneity as well as overviews of hypothesis and model-specification tests. Beyond this, it teaches bootstrap and simulation methods, quantile regression, finite mixture models, and nonparametric regression. It also includes an introduction to basic Stata concepts and programming and to Mata for matrix programming and basic optimization.
The second volume builds on methods introduced in the first volume and walks readers through a wide range of more advanced methods useful in economic research. It starts with an introduction to nonlinear optimization methods and then delves into binary outcome methods with and without endogeneity; tobit and selection model estimates with and without endogeneity; choice model estimation; count data with and without endogeneity for conditional means and count data for conditional quantiles; survival data; nonlinear panel-data methods with and without endogeneity; exogenous and endogenous treatment effects; spatial data modeling; semiparametric regression; lasso for prediction and inference; and Bayesian econometrics.
This is just a brief overview of the contents of the book, but it exemplifies the breadth and ambition of the two volumes. In sum, it is an essential book for any applied researcher and advanced microeconometrics courses.
List of tables
List of figures
Preface to the Second Edition (PDF)
1. STATA BASICS
1.1 Interactive use
1.2 Documentation
1.3 Command syntax and operators
1.4 Do-files and log files
1.5 Scalars and matrices
1.6 Using results from Stata commands
1.7 Global and local macros
1.8 Looping commands
1.9 Mata and Python in Stata
1.10 Some useful commands
1.11 Template do-file
1.12 Community-contributed commands
1.13 Additional resources
1.14 Exercises
2. DATA MANAGEMENT AND GRAPHICS
2.1 Introduction
2.2 Types of data
2.3 Inputting data
2.4 Data management
2.5 Manipulating datasets
2.6 Graphical display of data
2.7 Additional resources
2.8 Exercises
3. LINEAR REGRESSION BASICS
3.1 Introduction
3.2 Data and data summary
3.3 Transformation of data before regression
3.4 Linear regression
3.5 Basic regression analysis
3.6 Specification analysis
3.7 Specification tests
3.8 Sampling weights
3.9 OLS using Mata
3.10 Additional resources
3.11 Exercises
4. LINEAR REGRESSION EXTENSIONS
4.1 Introduction
4.2 In-sample prediction
4.3 Out-of-sample prediction
4.4 Predictive margins
4.5 Marginal effects
4.6 Regression decomposition analysis
4.7 Shapley decomposition of relative regressor importance
4.8 Differences-in-differences estimators
4.9 Additional resources
4.10 Exercises
5. SIMULATION
5.1 Introduction
5.2 Pseudorandom-number generators
5.3 Distribution of the sample mean
5.4 Pseudorandom-number generators: Further details
5.5 Computing integrals
5.6 Simulation for regression: Introduction
5.7 Additional resources
5.8 Exercises
6. LINEAR REGRESSION WITH CORRELATED ERRORS
6.1 Introduction
6.2 Generalized least-squares and FGLS regression
6.3 Modeling heteroskedastic data
6.4 OLS for clustered data
6.5 FGLS estimators for clustered data
6.6 Fixed-effects estimator for clustered data
6.7 Linear mixed models for clustered data
6.8 Systems of linear regressions
6.9 Survey data: Weighting, clustering, and stratification
6.10 Additional resources
6.11 Exercises
7. LINEAR INSTRUMENTAL-VARIABLES
7.1 Introduction
7.2 Simultaneous equations model
7.3 Instrumental-variables estimation
7.4 Instrumental-variables example
7.5 Weak instruments
7.6 Diagnostics and tests for weak instruments
7.7 Inference with weak instruments
7.8 Finite sample inference with weak instruments
7.9 Other estimators
7.10 Three-stage least-squares systems estimation
7.11 Additional resources
7.12 Exercises
8. LINEAR PANEL-DATA MODELS: BASICS
8.1 Introduction
8.2 Panel-data methods overview
8.3 Summary of panel data
8.4 Pooled or population-averaged estimators
8.5 Fixed-effects or within estimator
8.6 Between estimator
8.7 Random-effects estimator
8.8 Comparison of estimators
8.9 First-difference estimator
8.10 Panel-data management
8.11 Additional resources
8.12 Exercises
9. LINEAR PANEL-DATA MODELS: EXTENSIONS
9.1 Introduction
9.2 Panel IV estimation
9.3 Hausman–Taylor estimator
9.4 Arellano–Bond estimator
9.5 Long panels
9.6 Additional resources
9.7 Exercises
10. INTRODUCTION TO NONLINEAR REGRESSION
10.1 Introduction
10.2 Binary outcome models
10.3 Probit model
10.4 MEs and coefficient interpretation
10.5 Logit model
10.6 Nonlinear least squares
10.7 Other nonlinear estimators
10.8 Additional resources
10.9 Exercises
11. TESTS OF HYPOTHESES AND MODEL SPECIFICATION
11.1 Introduction
11.2 Critical values and p-values
11.3 Wald tests and confidence intervals
11.4 Likelihood-ratio tests
11.5 Lagrange multiplier test (or score test)
11.6 Multiple testing
11.7 Test size and power
11.8 The power onemean command for multiple regression
11.9 Specification tests
11.10 Permutation tests and randomization tests
11.11 Additional resources
11.12 Exercises
12. BOOTSTRAP METHODS
12.1 Introduction
12.2 Bootstrap methods
12.3 Bootstrap pairs using the vce(bootstrap) option
12.4 Bootstrap pairs using the bootstrap command
12.5 Percentile-t bootstraps with asymptotic refinement
12.6 Wild bootstrap with asymptotic refinement
12.7 Bootstrap pairs using bsample and simulate
12.8 Alternative resampling schemes
12.9 The jackknife
12.10 Additional resources
12.11 Exercises
13. NONLINEAR REGRESSION METHODS
13.1 Introduction
13.2 Nonlinear example: Doctor visits
13.3 Nonlinear regression methods
13.4 Different estimates of the VCE
13.5 Prediction
13.6 Predictive margins
13.7 Marginal effects
13.8 Model diagnostics
13.9 Clustered data
13.10 Additional resources
13.11 Exercises
14. FLEXIBLE REGRESSION: FINITE MIXTURES AND NONPARAMETRIC
14.1 Introduction
14.2 Models based on finite mixtures
14.3 FMM example: Earnings of doctors
14.4 Global polynomials
14.5 Regression splines
14.6 Nonparametric regression
14.7 Partially parametric regression
14.8 Additional resources
14.9 Exercises
15. QUANTILE REGRESSION
15.1 Introduction
15.2 Conditional quantile regression
15.3 CQR for medical expenditures data
15.4 CQR for generated heteroskedastic data
15.5 Quantile treatment effects for a binary treatment
15.6 Additional resources
15.7 Exercises
16. PROGRAMMING IN STATA
16.1 Stata matrix commands
16.2 Programs
16.3 Program debugging
16.4 Additional resources
17. MATA
17.1 How to run Mata
17.2 Mata matrix commands
17.3 Programming in Mata
17.4 Additional resources
18. OPTIMIZATION IN MATA
18.1 Mata moptimize() function
18.2 Mata optimize() function
18.3 Additional resources
19.2 Newton–Raphson method
19.3 Gradient methods
19.4 Overview of ml, moptimize(), and optimize()
19.5 The ml command: lf method
19.6 Checking the program
19.7 The ml command: lf0–lf2, d0–d2, and gf0 methods
19.8 Nonlinear instrumental-variables (GMM) example
19.9 Additional resources
19.10 Exercises
20.2 Some parametric models
20.3 Estimation
20.4 Example
20.5 Goodness of fit and prediction
20.6 Marginal effects
20.7 Clustered data
20.8 Additional models
20.9 Endogenous regressors
20.10 Grouped and aggregate data
20.11 Additional resources
20.12 Exercises
21.2 Multinomial models overview
21.3 Multinomial example: Choice of fishing mode
21.4 Multinomial logit model
21.5 Alternative-specific conditional logit model
21.6 Nested logit model
21.7 Multinomial probit model
21.8 Alternative-specific random-parameters logit
21.9 Ordered outcome models
21.10 Clustered data
21.11 Multivariate outcomes
21.12 Additional resources
21.13 Exercises
22.2 Tobit model
22.3 Tobit model example
22.4 Tobit for lognormal data
22.5 Two-part model in logs
22.6 Selection models
22.7 Nonnormal models of selection
22.8 Prediction from models with outcome in logs
22.9 Endogenous regressors
22.10 Missing data
22.11 Panel attrition
22.12 Additional resources
22.13 Exercises
23.2 Modeling strategies for count data
23.3 Poisson and negative binomial models
23.4 Hurdle model
23.5 Finite-mixture models
23.6 Zero-inflated models
23.7 Endogenous regressors
23.8 Clustered data
23.9 Quantile regression for count data
23.10 Additional resources
23.11 Exercises
24.2 Data and data summary
24.3 Survivor and hazard functions
24.4 Semiparametric regression model
24.5 Fully parametric regression models
24.6 Multiple-records data
24.7 Discrete-time hazards logit model
24.8 Time-varying regressors
24.9 Clustered data
24.10 Additional resources
24.11 Exercises
25.2 Nonlinear panel-data overview
25.3 Nonlinear panel-data example
25.4 Binary outcome and ordered outcome models
25.5 Tobit and interval-data models
25.6 Count-data models
25.7 Panel quantile regression
25.8 Endogenous regressors in nonlinear panel models
25.9 Additional resources
25.10 Exercises
26.2 Finite mixtures and unobserved heterogeneity
26.3 Empirical examples of FMMs
26.4 Nonlinear mixed-effects models
26.5 Structural equation models for linear structural equation models
26.6 Generalized structural equation models
26.7 ERM commands for endogeneity and selection
26.8 Additional resources
26.9 Exercises
27.2 Potential outcomes
27.3 Randomized control trials
27.4 Regression in an RCT
27.5 Treatment evaluation with exogenous treatment
27.6 Treatment evaluation methods and estimators
27.7 Stata commands for treatment evaluation
27.8 Oregon Health Insurance Experiment example
27.9 Treatment-effect estimates using the OHIE data
27.10 Multilevel treatment effects
27.11 Conditional quantile TEs
27.12 Additional resources
27.13 Exercises
28.2 Parametric methods for endogenous treatment
28.3 ERM commands for endogenous treatment
28.4 ET commands for binary endogenous treatment
28.5 The LATE estimator for heterogeneous effects
28.6 Difference-in-differences and synthetic control
28.7 Regression discontinuity design
28.8 Conditional quantile regression with endogenous regressors
28.9 Unconditional quantiles
28.10 Additional resources
28.11 Exercises
29.2 Overview of spatial regression models
29.3 Geospatial data
29.4 The spatial weighting matrix
29.5 OLS regression and test for spatial correlation
29.6 Spatial dependence in the error
29.7 Spatial autocorrelation regression models
29.8 Spatial instrumental variables
29.9 Spatial panel-data models
29.10 Additional resources
29.11 Exercises
30.2 Kernel regression
30.3 Series regression
30.4 Nonparametric single regressor example
30.5 Nonparametric multiple regressor example
30.6 Partial linear model
30.7 Single-index model
30.8 Generalized additive models
30.9 Additional resources
30.10 Exercises
31.2 Measuring the predictive ability of a model
31.3 Shrinkage estimators
31.4 Prediction using lasso, ridge, and elasticnet
31.5 Dimension reduction
31.6 Machine learning methods for prediction
31.7 Prediction application
31.8 Machine learning for inference in partial linear model
31.9 Machine learning for inference in other models
31.10 Additional resources
31.11 Exercises
32.2 Bayesian introductory example
32.3 Bayesian methods overview
32.4 An i.i.d. example
32.5 Linear regression
32.6 A linear regression example
32.7 Modifying the MH algorithm
32.8 RE model
32.9 Bayesian model selection
32.10 Bayesian prediction
32.11 Probit example
32.12 Additional resources
32.13 Exercises
33.2 User-provided log likelihood
33.3 MH algorithm in Mata
33.4 Data augmentation and the Gibbs sampler in Mata
33.5 Multiple imputation
33.6 Multiple-imputation example
33.7 Additional resources
33.8 Exercises
© Copyright 1996–2026 StataCorp LLC