About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • Last update: 5 years ago
  • Total downloads: 82
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Kadir (1 other programs)
See full specifications

scripts default iconTSLS (2SLS) (Scripts) Publisher's description

Original model: y = X*beta + u

% Original model: y = X*beta + u
% We are concerned that a regressor in X
% could be endogenous.
% W contains the instruments and all regressors in X
% except the suspected one.

% An example:
% m_t = b1 + b2*r_t + b3*y_t + b4*m_(t-1) + b5*m_(t-2) + u_t
% In this model, we have a concern that r_t could be correlated
% with u_t and we want to see the results with instruments,
% r_(t-1) and r_(t-2). So the inputs y, X and W must be
% y = m_t;
% X = [ones(length(y)) r y m_(t-1) m_(t-2)];
% W = [ones(length(y)) r_(t-1) r_(t-2) y m_(t-1) m_(t-2)];

% Please do not forget checking the length of the variables be equal

One computational method which can be used to calculate IV estimates is two-stage least squares (2SLS). In the first stage, each endogenous covariate in the equation of interest is regressed on all of the exogenous variables in the model, including both exogenous covariates in the equation of interest and the excluded instruments. The predicted values from these regressions are obtained.

Stage 1: Regress each column of X on W, (X = WОґ + errors)
and save the predicted (fitted) values:
^X=W inv(W'W)W'X=PwX

In the second stage, the regression of interest is estimated as usual, except that in this stage each endogenous covariate is replaced with the predicted values from its first stage model from the first stage.
Stage 2: Regress Y on the predicted values from the first stage:
Y=^XОІ+residuals (original model: Y=XОІ+u)
The resulting estimator of ОІ is numerically identical to the expression displayed above. A small correction must be made to the sum-of-squared residuals in the second-stage fitted model in order that the covariance matrix of ОІ is calculated correctly.

System Requirements:

MATLAB 7.1.0 (R14SP3)
Program Release Status: New Release
Program Install Support: Install and Uninstall

TSLS (2SLS) (Scripts) Tags:

Click on a tag to find related softwares

Is TSLS (2SLS) (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.