BookmarkSubscribeRSS Feed
HongqiuGu
Calcite | Level 5

Hi guys,

How to do instrumental variables analysis in SAS? I Just find STATA  software can do it  with IVREGRESS  procedure. Is there any specified STAT procedure can do that in SAS? 

If there is no such a procedure, how to do it with several data steps or  procedures?  Any examples?

Thanks a lot!

Hongqiu

4 REPLIES 4
SteveDenham
Jade | Level 19

Look at PROC MODEL and PROC SYSLIN in the SAS/ETS documentation, and PROC CALIS in the SAS/STAT documentation.  There should be examples for each of these (maybe more than you want, as PROC MODEL and PROC CALIS are very versatile in what they can do).

Steve Denham

HongqiuGu
Calcite | Level 5

Thanks for your suggestion. I'll find more details from documents.

Hongqiu

ets_kps
SAS Employee

As Steve mentioned, PROC SYSLIN or PROC MODEL are the easiest ways to estimate a regression using two-stage least squares.  Here is an example:

There are also more examples at SAS/ETS 13.1 User's Guide Example Programs

data in;

  label q = "Quantity"

  p = "Price"

  s = "Price of Substitutes"

  y = "Income"

  u = "Unit Cost";

  drop i e1 e2;

  p = 0; q = 0;

  do i = 1 to 60;

  y = 1 + .05*i + .15*rannor(123);

  u = 2 + .05*rannor(123) + .05*rannor(123);

  s = 4 - .001*(i-10)*(i-110) + .5*rannor(123);

  e1 = .15 * rannor(123);

  e2 = .15 * rannor(123);

  demandx = 1 + .3 * y + .35 * s + e1;

  supplyx = -1 - 1 * u + e2 - .4*e1;

  q = 1.4/2.15 * demandx + .75/2.15 * supplyx;

  p = ( - q + supplyx ) / -1.4;

  output;

  end;

run;

/*-- OLS Estimation --*/

proc syslin data=in;

  demand: model q = p y s;

  supply: model q = p u;

run;

/*-- Two-Stage Least Squares Estimation --*/

proc syslin data=in 2sls;

  endogenous p;

  instruments y u s;

  demand: model q = p y s;

  supply: model q = p u;

run;

HongqiuGu
Calcite | Level 5

Thanks for your help. That quit helpful!

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 4755 views
  • 5 likes
  • 3 in conversation