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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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