Page 1 of 2

2 Stage Least Squares estimation with a System of 3 equation

Posted: Fri Apr 03, 2009 3:27 am
by andreaasgr13
Hi, I am new here and I am wondering about something related to SEM and 2SLS.
I have 3 equations,
co=c(1)+c(2)*pi+c(3)*pilagged+c(4)*W

I=c(5)+c(6)*pi+c(7)*pilagged+c(8)*klagged

W1=c(9)+c(10)*x+c(11)*xlagged+c(12)*time

and all the appropriate data for them. These are actually the Klein model 1.
What I dont know is how to put these 3 equations in eviews for estimation.
I chose Proc>Define System.
I am confused but I know I should put in the dependent variables box Co,I and W1,
On regressors and AR terms what do I put in common coefficients and Equations coefficients + what do I put in Instrument list in order to estimate the equations by 2SLS ?

Is this the appropriate course of action? If not what should I do to estimate them?
Is there anything else I should mention?

I have looked on google and then here but there is nothing that can help me,
Thank you very much for your time andreas

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Fri Apr 03, 2009 9:12 am
by EViews Gareth
You're probably best off not using the Proc->Define system dialog, and just writing the system out by hand.


I actually have a program that does the Klein model:

Code: Select all

'Get Data wfopen http://pages.stern.nyu.edu/~wgreene/Text/Edition6/TableF13-1.txt 'create time variable series tm = @year-1931 'create data series out of Klein identities series y = c01+i+g-t-wp series w = wp+wg smpl 1920 1940 series k= k1(+1) smpl 1941 1941 series k = k(-1)+i smpl @all system s s.append c01 =c(1)+c(2)*y+c(3)*y(-1) +c(4)*w @ c p(-1) k(-1) x(-1) tm wg g t s.append i = c(5)+ c(6)*y +c(7)*y(-1) +c(8)*k(-1) @ c p(-1) k(-1) x(-1) tm wg g t s.append wp = c(9)+ c(10)*x +c(11)*x(-1) +c(12)*tm @ c p(-1) k(-1) x(-1) tm wg g t s.tsls show s

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Fri Apr 03, 2009 10:57 am
by andreaasgr13
I wrote this,

system untitled

untitled.append co=c(1)+c(2)*pi+c(3)*pi(-1)+c(4)*W @ c pi(-1) k(-1) x(-1) time w2 g

untitled.append I=c(5)+c(6)*pi+c(7)*pi(-1)+c(8)*k(-1) @ c pi(-1) k(-1) x(-1) time w2 g

untitled.append W1=c(9)+c(10)*x+c(11)*x(-1)+c(12)*time @ c pi(-1) k(-1) x(-1) time w2 g

untitled.tsls

but I keep getting the message my system is not defined.
the variables have a different name but are correct.

thank you for your help

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Fri Apr 03, 2009 11:01 am
by EViews Gareth
You can't create a system called "untitled"

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Fri Apr 03, 2009 12:41 pm
by andreaasgr13
system AA

AA.append co=c(1)+c(2)*pi+c(3)*pi(-1)+c(4)*w

AA.append i=c(5)+c(6)*pi+c(7)*pi(-1)+c(8)*k(-1)

AA.append w1=c(9)+c(10)*x+c(11)*x(-1)+c(12)*time

AA.tsls

show AA

thats what I wrote. the system I chose from object>new object>system and named it AA.
I keep getting either system is not defined or the other error near singular matrix.

What do I have to do step by step in order to get the 2SLS procedure for the 3 equations above ?

I am sorry but I am deeply confused.

Thank you for your help gareth

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Fri Apr 03, 2009 1:17 pm
by EViews Gareth
If you have already created a system called AA, then you don't need the first line of that code.

If you're getting a singular matrix error, then, in all likelihood, you've specified the system incorrectly somehow.

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Fri Apr 03, 2009 1:55 pm
by startz
system AA

AA.append co=c(1)+c(2)*pi+c(3)*pi(-1)+c(4)*w

AA.append i=c(5)+c(6)*pi+c(7)*pi(-1)+c(8)*k(-1)

AA.append w1=c(9)+c(10)*x+c(11)*x(-1)+c(12)*time

AA.tsls

show AA

thats what I wrote. the system I chose from object>new object>system and named it AA.
I keep getting either system is not defined or the other error near singular matrix.

What do I have to do step by step in order to get the 2SLS procedure for the 3 equations above ?

I am sorry but I am deeply confused.

Thank you for your help gareth
Where is your instrument list?

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Sat Apr 04, 2009 2:58 am
by andreaasgr13
I did it after so many hours of trying. Now I have a different question.
The system remains the same , and I am in OLS
CO=C(1)+C(2)*PI+C(3)*PI(-1)+C(4)*W

I=C(5)+C(6)*PI+C(7)*PI(-1)+C(8)*K(-1)

W1=C(9)+C(10)*X+C(11)*X(-1)+C(12)*TIME

I press the residuals button but I only the get the graph for residuals. I need the lines for actual and fitted values as well.
I have searched the manual but I couldn't find an something. I have E-views 6 Student Version.
Suppose I know the intsrument list as well for 2SLS how do I get the actual and fitted values in that ?

Thanks a lot for your help up to now

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Sat Apr 04, 2009 4:54 am
by startz
I did it after so many hours of trying. Now I have a different question.
The system remains the same , and I am in OLS
CO=C(1)+C(2)*PI+C(3)*PI(-1)+C(4)*W

I=C(5)+C(6)*PI+C(7)*PI(-1)+C(8)*K(-1)

W1=C(9)+C(10)*X+C(11)*X(-1)+C(12)*TIME

I press the residuals button but I only the get the graph for residuals. I need the lines for actual and fitted values as well.
I have searched the manual but I couldn't find an something. I have E-views 6 Student Version.
Suppose I know the intsrument list as well for 2SLS how do I get the actual and fitted values in that ?

Thanks a lot for your help up to now
Since you are doing 2SLS there is no reason to use a system. You can just do each equation separately using the TSLS command.

Re: 2 Stage Least Squares estimation with a System of 3 equation

Posted: Sat Apr 04, 2009 8:49 am
by EViews Gareth
I did it after so many hours of trying. Now I have a different question.
The system remains the same , and I am in OLS
CO=C(1)+C(2)*PI+C(3)*PI(-1)+C(4)*W

I=C(5)+C(6)*PI+C(7)*PI(-1)+C(8)*K(-1)

W1=C(9)+C(10)*X+C(11)*X(-1)+C(12)*TIME

I press the residuals button but I only the get the graph for residuals. I need the lines for actual and fitted values as well.
I have searched the manual but I couldn't find an something. I have E-views 6 Student Version.
Suppose I know the intsrument list as well for 2SLS how do I get the actual and fitted values in that ?

Thanks a lot for your help up to now
Proc->Make Residuals.

Re: 2 Stage Least Squares estimation with a System of 3 equa

Posted: Tue Nov 15, 2011 12:34 am
by tinfah
Hi Gareth
When i run your program on the Klein model above, I get a near singular matrix in "DO-S.TSLS"
What could be the problem?

Re: 2 Stage Least Squares estimation with a System of 3 equa

Posted: Tue Nov 15, 2011 8:46 am
by EViews Gareth
Runs for me. Is your copy of EViews up to date?

Re: 2 Stage Least Squares estimation with a System of 3 equa

Posted: Tue Nov 15, 2011 9:28 pm
by tinfah
Hi Gareth,

I am using eViews 7. Are you using the same version. Thanks for the feedback. What does near singular matrix in DO_S.TSLS. Is there some collinearity of the data series that is the cause of this besides the Eviews version I am using.

Chung Tin Fah

2 Stage Least Squares estimation with a System of 3 equation

Posted: Tue Nov 15, 2011 9:51 pm
by EViews Gareth
Check the build date under help->about EViews.

Re: 2 Stage Least Squares estimation with a System of 3 equa

Posted: Wed Nov 16, 2011 1:38 am
by tinfah
Hi Gareth

It reads Enterprise Edition- Dec 4 2009 build