BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
spasico
Calcite | Level 5

Syntax error occurs when I run 2SLS, but the data should be fine as the file I attached. I think the problem might be the part of running regression, but I don't know where wrong.

 

my first stage function is : batie = ln_ta ROA leverage growth age CPA big4 ibsize loss loss_lag liquidity INVplusAR_TA btm employ LD 

where "batie" is an endogenous variable, "employ" and "LD" are Instrument Variables for batie, other variables are exogenous variable ; 

 

my second stage function is : am = batie ln_ta ROA leverage growth age CPA big4 ibsize loss loss_lag liquidity INVplusAR_TA btm ;

 

SAS code are as following:

libname ok 'd:\all\ipo';
run;

proc model data=ok.www; instruments employ LD; batie = ln_ta ROA leverage growth age CPA big4 ibsize loss loss_lag liquidity INVplusAR_TA btm employ LD; am = batie ln_ta ROA leverage growth age CPA big4 ibsize loss loss_lag liquidity INVplusAR_TA btm ; fit batie am / 2sls outv=vdata vardef=n kernel=(bart,0,); title '2sls results'; run; quit;

How can I fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
kessler
SAS Employee

PROC MODEL requires that your model is specified using a mathematical expression including explicit parameters rather than just using a list of variables.  To do a two stage least squares estimation for your model you could use something like the following:

proc model data=new;
	am = p_batie*batie + p_ln_ta*ln_ta + p_ROA*ROA + p_leverage*leverage + p_growth*growth + p_age*age 
           + p_CPA*CPA + p_big4*big4 + p_ibsize*ibsize + p_loss*loss + p_loss_lag*loss_lag 
           + p_liquidity*liquidity + p_INVplusAR_TA*INVplusAR_TA + p_btm*btm;
	fit  am / 2sls outv=vdata vardef=n kernel=(bart,0,);
	instruments _exog_ employ LD;
	title '2sls results';
quit;

View solution in original post

1 REPLY 1
kessler
SAS Employee

PROC MODEL requires that your model is specified using a mathematical expression including explicit parameters rather than just using a list of variables.  To do a two stage least squares estimation for your model you could use something like the following:

proc model data=new;
	am = p_batie*batie + p_ln_ta*ln_ta + p_ROA*ROA + p_leverage*leverage + p_growth*growth + p_age*age 
           + p_CPA*CPA + p_big4*big4 + p_ibsize*ibsize + p_loss*loss + p_loss_lag*loss_lag 
           + p_liquidity*liquidity + p_INVplusAR_TA*INVplusAR_TA + p_btm*btm;
	fit  am / 2sls outv=vdata vardef=n kernel=(bart,0,);
	instruments _exog_ employ LD;
	title '2sls results';
quit;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Discussion stats
  • 1 reply
  • 910 views
  • 0 likes
  • 2 in conversation