07-12-2016 08:34 AM
I am trying to calculate the implied cost of capital (k_ct in the model below) of four models following Hail and Leuz (2006, 2009) with SAS using IBES dataset.
I have tried using 'proc model' but SAS keeps saying that I need to define the parameters.
So I have tried generating 10000 rates by using do i=1 to 10000 and setting rate = t/10000 and plugging the rates into the model to come up with 10000 prices (left hand variable).
But this seems to take too long and I still cannot get the result with required precision.
Can anyone please recommend me better way to solve this problem?
Thank you in advance.
07-12-2016 10:30 PM
data ae_parm; set ae; do t=1 to 1000; prc=prc; bkvlps=bkvlps; medest=medest; r_cl=rand('Uniform'); medest2=medest2; bkv1=bkv1; medest3=medest3; bkv2=bkv2;medest4=medest4; bkv3=bkv3;medest5=medest5; bkv4=bkv4; growth=growth; output; end; run; data goal; set ae; prc=prc; bkvlps=bkvlps; medest=medest; medest2=medest2; bkv1=bkv1; medest3=medest3; bkv2=bkv2;medest4=medest4; bkv3=bkv3;medest5=medest5; bkv4=bkv4; growth=growth; run; proc model data = ae_parm noprint outmodel = r_cl; endogenous r_cl; prc = bkvlps + (medest - bkvlps*r_cl)/(1+r_cl) + (medest2 - bkv1*r_cl)/(1+r_cl)**2 + (medest3 - bkv2*r_cl)/(1+r_cl)**3 +(medest4 - bkv3*r_cl)/(1+r_cl)**4 + (medest5 - bkv4*r_cl)/(1+r_cl)**5 + ((medest5 - bkv4*r_cl) + (1 + growth))/((r_cl - growth) * ((1+r_cl)**5)); fit prc/ outest = prcest; solve r_cl /estdata = prcest data = goal; run;
This is the code I have used trying to estimate r_cl.
I am new to using SAS so I just tried to follow the sample code from online but it doesn't seem to be working as intended.