The above code does linear/nonlinear GMM estimation. Users need to provide the number of parameters and the moment functions. Three examples are included. The first example is the GMM estimation of a binary choice model. The related model has 5 parameters and 5 moment conditions. The second example is the GMM estimation of a sample selection model. The related model has 8 parameters and 8 moment conditions. The third example is the GMM estimation of the return to schooling application in Lewble(2005). The related model has 19 parameters and 19 moment conditions.

simpbin0/ simpbin1/ simpbin2 estimate a binary choice model with possible endogenous regressors, given a very exogenous regressor (V) (Lewbel, 2005).

1. simpbin0 provides the simple binary choice estimator when the density of V is known.
2. simpbin1 provides the simple binary choice estimator assuming V is conditionally normal.
3. simpbin2 provides the simple binary choice estimator using a nonparametric sorted-data density for V model error.

simpsel1/simpsel2 estimate a selected sample model with possibly endogenous regressors, given a very exogenous regressor (V) in its selection indicator function (Lewbel, 2005).

1.simpsel1 provides a simple sample selection estimator assuming the selection model error is normal.
2.simpsel2 provides a simple sample selection estimator using a nonparametric sorted-data density of the selection model error.

1.sortedf1 is a command to calculate a nonparametric sorted-data density (Lewbel & Schennach, 2007). It is called by simpbin2 and simpsel2.
2.sortuniq1 is a command called by sortedf1. It sorts the data and keeps the unique values in ascending order.
3.zrnd is a command to round a near zero number away from zero.