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.
You might try switching to PROC MODEL to do the 2SLS regression. It has a HAUSMAN option.
Steve Denham
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?
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
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".
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
Thanks Steve
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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.