BookmarkSubscribeRSS Feed
Daniel_L
Calcite | Level 5

How do you request for a Hausman Test under the PROC SYSLIN procedure? I am trying to carry out a 2 stage least squares regression and need to check for the validity of my instrument.

I tried googling but to no avail.

7 REPLIES 7
SteveDenham
Jade | Level 19

You might try switching to PROC MODEL to do the 2SLS regression.  It has a HAUSMAN option.

Steve Denham

Daniel_L
Calcite | Level 5

Thank you for your response. PROC MODEL does have the Hausman option. However, it gives me results of a non-linear 2SLS regression whereas what I want to test is a linear model. Is it possible then to impose linear restrictions using PROC MODEL?

SteveDenham
Jade | Level 19

I am probably missing something here, but say you had:

proc model data=in;

y1 = a1 + b1*y2 + c1*x1;

y2 = a2 + b2*y1 + c2*x2;

fit y1 y2 / 2sls;

run;

(that probably needs some parms or instrument statements, but this is for illusration).

Specifying 2SLS means that derivatives are replaced with predicted values.  This has meaning if the equations are non-linear, but it just means that the instrumental variables x1 and x2 are used in the first stage fit, for when all of the equations in the system are "linear in the parameters" the derivatives are just regressions on the instrumental variables.

So, PROC MODEL should be a good choice if you want to now do Hausman testing.

Steve Denham

Daniel_L
Calcite | Level 5

I am referring to the discussion here http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0512a&L=sas-l&P=20981

"PROC SYSLIN is designed to work on simultaneous linear equations", which is what I intended.

However, "PROC MODEL is designed to work on non-linear equations".

SteveDenham
Jade | Level 19

Since the two methods give different results, there is obviously something different, and David gives the reason.  However, that does not mean that the results obtained from PROC MODEL are incorrect, merely obtained by a different algorithm.  And for me (and me only), I would trust the results from a goal seeking algorithm that accommodated correlations over an algorithm that does not accommodate the correlations (OLS and its extension to 2SLS in SYSLIN).  It's the only way I see in SAS to do the Hausman testing on simultaneous equations, other than to "roll your own" through data step programming.

Steve Denham

Daniel_L
Calcite | Level 5

Thanks Steve

Amanda_Lemon
Quartz | Level 8

Hi Steve, 

 

I am a little confused about one thing in your example (and in the example in the SAS documentation) -- why there are y1 and y2, and why do they switch places in the two equations? 

 

As the topic starter, I am also trying to run the Hausman Test, and I am not sure how to write the syntax... I thought that with y, endogenous x, and say two instruments (z1 and z2), I should write the first stage first and then the second stage... Is it not right? Where do y1 and y2 come from? 

 

proc model data = data;
endo x;
instruments z1 z2;
y = b0 + b1*x; 
x = b00 + b2*z1 + b3*z2;
fit y / ols 2sls hausman; 
run; 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 2555 views
  • 6 likes
  • 3 in conversation