View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Toolkit on Econometrics and Economics Teaching

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.3 | 3 ratings Rate this file 71 Downloads (last 30 days) File Size: 6.33 MB File ID: #32601 Version: 1.0
image thumbnail

Toolkit on Econometrics and Economics Teaching


Hang Qian (view profile)


Many MATLAB routines related to econometrics, statistics and introductory economics teaching.

| Watch this File

File Information

I have about a hundred MATLAB routines related to econometrics, statistics and introductory economics teaching, which are written mostly in my spare time in the past years. Most of these MATLAB functions / scripts are supplied with a graphic user interface so that so you may estimate the model with the mouse clicking. I would like to share these codes with every interested researcher, instructor and student.

This lump-sum package reflects revision up to August 2011. Since I receive feedbacks from users from time to time, I update those codes and post them program by program on my personal website. For the latest version, please visit

Though I made efforts to check the correctness of those codes before I posted them, due to the large quantity of the codes, there might be some errors remaining. If you are aware of bugs or imperfections of these codes, please let me know. I appreciate your comments and suggestions.

Here is a list of the packages:
Bayesian Econometrics Tools
* Bayesian Linear Regression
* Bayesian Regression with flexible disturbance specifications
* Bayesian Regime Switch Regression
* Bayesian Regression with Restricted Parameters
* Bayesian Seemingly Unrelated Regression (SUR)
* Bayesian Vector AutoRegression (VAR)
* Bayesian Endogenous Regressors and Instruments
* Bayesian Probit and Logit Model
* Bayesian Tobit Model
* Bayesian Panel Data Analysis
* Bayesian Stochastic Search Variable Selection
* Bayesian Highest Posterior Density (HPD) Region
* Bayesian Marginal Likelihood of Linear Regression Model

Microeconometrics Tools (Classical Inference)
* Ordinary Least Squares (OLS) and More
* Baseline Logit and Probit Model
* Unordered Logit Model with RUM
* Tobit Model of several varieties
* Illustration of Expectation—Maximization (EM) Algorithm
* Aggregated Covariate Data Model
* Bootstrap Bias Correction with MIV

Macroeconometrics Tools (Classical Inference)
* Generalized Method of Moments (GMM)
* Panel Data Analysis: Fixed and Random Effects, Two-way Fixed Effects
* Dynamic Programming by Euler Equation Based Policy Function Iteration
* Weak Efficient Market Hypothesis Testing

Numerical Methods and Statistics tools
* Climb High (A Numerical Nonlinear Optimization Routine)
* Numerical Nash Equilibrium
* Random Numbers from Common Distributions
* Cumulative Distribution Function (CDF) from Common Distributions
* Density Function from Common Distributions
* Universal sampling using inverse CDF, rejection, adaptive rejection, weighed bootstrap
* Numerical derivatives and integration

Extra Tools on Economic Teaching and Research
* Econ 101 Diagram Generator (Introductory Economics Textbook Style Graphs)
* MATLAB to R Codes Translator
* MATLAB to GAUSS Translator
* Class Attendance Checker
* Grades and Data Transformer

Contact information
Written by Hang Qian, Dept. of Economics, Iowa State University
Contact me:
More econometrics routines and pedagogical economics software are available at


This file inspired Stoch Pv.

Required Products Optimization Toolbox
Statistics and Machine Learning Toolbox
MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
21 Jul 2015 Hang Qian

Hang Qian (view profile)

Hi Jan,

Thank you very much for your comments. The points you raised are pertinent. Some programs in the toolkit were written years ago when I was learning MATLAB, and were not as computationally efficient as my recent works. I would like to keep the old program as is.

Please only take the useful part and discard the remaining. Reading the perfect codes is not as interesting as discovering some flags where we can improve the program for numerical efficiency and robustness.


- Hang Qian

Comment only
21 Jul 2015 Jan Simon

Jan Simon (view profile)

Lines like these are awkward and bewildering:

eval([char([81 72 49 61]),'[87 114 105 116 116 101 110 32 98 121];'])
eval([char([81 72 50 61]),'[32 72 97 110 103 32 81 105 97 110];'])

This is simply an obfuscation.

Some functions have comments in a foreign language, e.g. LINEAR_INTERP_DELUXE_4. Therefore I cannot estimate if this function does what is wanted.

The function vec.m is a time-consuming way to avoid the simple and efficient "y = x(:)".

The code contains "clear all, warning off", which have severe side effects.

Without doubt this work is impressive. But the can be improved substantially at many places. I cannot vote for it, because I'm working in another field and cannot test if it is useful.

Comment only
01 Feb 2015 Brad Stiritz

An extremely impressive body of work. Thank you Qian very much for your time and care, and for your generosity in sharing these helpful functions with the community.

The code looks well-organized with good variable names. I would have preferred more low-level comments explaining each step of your calculations. Overall, though, a truly excellent package that's very much appreciated! :)

02 Oct 2013 soukaina bencheikh


24 Jun 2012 XiaoYan

It seems extremely helpful. Thanks!

Contact us