Grocer Function
NAME
twosls - Two-Stage Least-squares Regression
CALLING SEQUENCE
[results]=twosls(arg1,...,argn)
PARAMETERS
Input
-
argi : arguments which can be:
- an equation of the following form:
'vary=coef1*varx1+...+coefi*varxi'
where:
* coefi = the name of a coefficient
* varxi = the name of a variable
- 'coef=coef1;coef2;...coefn' where coef1,...,coefn are the
names of the coefficients in the system
(optional; default: 'coef=a1;...,an')
- 'endo =[endo1;...;endon]' where endo1,...,endon are the
names of the endogenous variables
(optional; necessary if the names of the endogenous
variables in the rhs of the equations are not the same as
those of the lhs; default: the names of all the lhs sides
of the equations)
- 'noprint' if you do not want to print the results
Output
-
results =a results tlist with:
- results('meth') = 'tsls'
- results('namecoef') = the matrix of the names of the
coefficients
- results('riv1'),...,results('rivn) = the results of the iv
estimation for each equation (see iv for more details)
DESCRIPTION
Computes Two-Stage Least-squares Regression
EXAMPLE
rt=twosls('y1=a+b*x1','y2=d+e*(y1-x2)+f*x2','coef=a;b;d;e;f')
Example taken from function twosls_d. The equations are 'y1=a+b*x1' and 'y2=d+e*(y1-x2)+f*x2'. Coefficients are a, b, d, e and f. Their name is given to the function through the input 'coef=a;b;d;e;f'.
AUTHOR
Eric Dubois 2002