Sytanx for 2SLS

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Sytanx for 2SLS

Postby diggetybo » Thu Oct 22, 2015 11:48 am

Hello,

I'm looking to use code to run a 2SLS estimate. For example:

OLS is easy enough

Code: Select all

equation eq01.ls y c x
How does eviews code look for the 2sls? I'm guessing there is an entry for the instruments. Let's suppose I have two instruments (in addition to the right hand variable x) callthem, iv1, and iv2. How would this look in eviews code? From there I should be able to figure out the rest by myself.

Thank you

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Sytanx for 2SLS

Postby EViews Gareth » Thu Oct 22, 2015 11:53 am

Perform the estimation you want interactively using the dialogs, then (if using EViews 9), look at the Capture Window to view the code version, or (for all versions), open the equation, click on View->Representations to find out the command line form.

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Sytanx for 2SLS

Postby diggetybo » Thu Oct 22, 2015 11:58 am

ohhhh brilliant,

That saves me all kinds of trouble.

So according to the command capture log, it looks like this (if x1 is endogenous):

Code: Select all

equation eq02.tsls y c x1 x2 @ x2 iv1 iv2
Thank you again.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Sytanx for 2SLS

Postby EViews Glenn » Thu Oct 22, 2015 2:10 pm

Note that C is added as an instrument automatically unless you explicitly tell EViews to leave it out.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest