2 Stage Least Squares estimation with a System of 3 equation
Moderators: EViews Gareth, EViews Moderator
-
andreaasgr13
- Posts: 4
- Joined: Thu Apr 02, 2009 4:07 pm
2 Stage Least Squares estimation with a System of 3 equation
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
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
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
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:
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
-
andreaasgr13
- Posts: 4
- Joined: Thu Apr 02, 2009 4:07 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
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
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
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
You can't create a system called "untitled"
-
andreaasgr13
- Posts: 4
- Joined: Thu Apr 02, 2009 4:07 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
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
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
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
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.
If you're getting a singular matrix error, then, in all likelihood, you've specified the system incorrectly somehow.
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
Where is your instrument list?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
-
andreaasgr13
- Posts: 4
- Joined: Thu Apr 02, 2009 4:07 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
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
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
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
Since you are doing 2SLS there is no reason to use a system. You can just do each equation separately using the TSLS command.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
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: 2 Stage Least Squares estimation with a System of 3 equation
Proc->Make Residuals.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 equa
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?
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?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: 2 Stage Least Squares estimation with a System of 3 equa
Runs for me. Is your copy of EViews up to date?
Re: 2 Stage Least Squares estimation with a System of 3 equa
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
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
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
2 Stage Least Squares estimation with a System of 3 equation
Check the build date under help->about EViews.
Re: 2 Stage Least Squares estimation with a System of 3 equa
Hi Gareth
It reads Enterprise Edition- Dec 4 2009 build
It reads Enterprise Edition- Dec 4 2009 build
Who is online
Users browsing this forum: No registered users and 2 guests
