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?
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;
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;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.