# Instrumental Variables Probit

Please how can I analyze using instrumental Variables probit estimation, test for over identification and generate the marginal effects using Shazam

add a comment

The following example may help you - adapted from Adkins(2009) as described below.

The example script can be downloaded here: IVProbit_Example.sha

The accompanying data is here: bank.shd

The SHAZAM Procedure can be downloaded here:IVProbit.prc

**EXAMPLE FILE**

```
* Example calling Instrumental Variables Probit Procedure
*
* Sample data is from Adkins(2009) to determine whether managerial incentives
* affect the use of foreign exchange derivatives by bank holding companies.
* Example replicates the results found in that paper.
*
* N.B. To reuse, set variables X,Y, X1 and Y1 to your own problem
*
* Read the data and create a constant by hand
read(bank.shd) / names
genr const = 1
* Set up matrices with all the variables of interest
* y = r.h.s. endogenous variables
* x = the complete set of instruments
* x1 = r.h.s. exogenous variables
* y1 = dichotomous l.h.s. variable
matrix y = eqrat|bonus|optval
matrix x = const|ltass|linsown|linstown|roe|mktbk|perfor|dealdum|div|dum97|dum98|dum99|dum00|no_emp|no_subs|no_off|ceo_age|gap|cfa
matrix x1 = const|ltass|linsown|linstown|roe|mktbk|perfor|dealdum|div|dum97|dum98|dum99|dum00
matrix y1 = d2
* Disable irrelevant output
set nooutput
set noecho
set nodoecho
* Call the Proc
exec IVProbit
* Print results
set output
print delt se
```

**SHAZAM PROCEDURE**

The procedure IVProbit is below:

```
* SHAZAM Procedure - Instrumental Variables Probit Estimator by AGLS
*
* Produces Amemiya's Generalised Least Squares Estimator (AGLS)
*
* This procedure produces a consistent estimator of the standard errors and can therefore
* easily be used for subsequent hypothesis testing of the parameters.
*
* References:
*
* Amemiya, T., 1978, The estimation of a simultaneous equation generalized probit model, Econometrica 46, 1193-1205.
* Amemiya, T., 1981, Qualitative response models: a survey, Journal of Economic Literature 19, 1483-1536.
* Newey, W.K., 1987, Efficient estimation oflimited dependent variable models with endogenous explanatory variables, Journal of Econometrics 36, 231-250
*
* Based on a program created and described by Lee C. Adkins in the paper
* Adkins, L., 2009, An Instrumental Variables Probit Estimator using gretl
* Steps defined below are described in that paper; Newey 1987 also a good reference
*
* Definitions of required input variables to be declared in calling routine.
* y = r.h.s. endogenous variables
* x = the complete set of instruments
* x1 = r.h.s. exogenous variables
* y1 = dichotomous l.h.s. variable
*
proc IVProbit
* Define equation matrices and useful parameters
matrix Z = X1|Y
gen1 nx=$rows
matrix b = INV(X'X)*X'Y
gen1 kx=$rows
gen1 ky=$cols
matrix d = INV(X'X)*X'Z
gen1 s = ky
gen1 kx1 = kx+1
gen1 kxy = kx+ky
* Step 1: Regress each y variable and store resid / pred
dim myres nx ky mypred nx ky
do #=1,ky
* Select the regressand vector from the matrix using its index
matrix ycol = y(0,#)
* Regress each y variable on x and store resid / pred
ols ycol x / resid=resid# pred=pred# noconstant
copy resid# myres / frow=1;nx trow=1;nx fcol=1;1 tcol=#;#
copy pred# mypred / frow=1;nx trow=1;nx fcol=1;1 tcol=#;#
endo
* Step 2 ...
```

Asked: ** 2013-05-14 10:53:47 +0000 **

Seen: **2,660 times**

Last updated: **Aug 19 '13**

Copyright **SHAZAM Analytics, 2018** Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.