BookmarkSubscribeRSS Feed
rpg163
Calcite | Level 5

Hi,

I am try to solve an Equation in SAS, as follows and re is what I need

1.jpg

and

B(t)=B(t-1)+(1-K)EPS(t)=B0+(1-K)EPS0*t

What I need to solve is re, with other variables already knew.

Anyone can tell me how to do it in SAS?

Many THX.

BTW, this is an equation to calculate the equity cost of capital (GLS method)

4 REPLIES 4
Doc_Duke
Rhodochrosite | Level 12

SAS is not an algebraic manipulation language.  You would generally need to re-write the formula to isolate re on the left.  To directly manipulate an equation like this probably requires something like Wolfram's Mathematica.

Doc Muhlbaier

Duke

rpg163
Calcite | Level 5

Oh...., It's so sad to know this.

Well, thank you all the same.

Rick_SAS
SAS Super FREQ

Hold on. I thought the poster wants a numerical solution for this nonlinear system of equations. Write the expression on the left as F_t(R_e). Then the problem is solving the system

F_t(R_e) = P_t for t=1..T.

Now presumably there is no value of R_e that solves this exactly for all measured values of the data, so you want to find the value of R_e that best fits the data according to some criterion (for example, least squares).

It seems like you can solve this problem in SAS. Maybe PROC MODEL? If not, please explain what I'm missing,

rpg163
Calcite | Level 5

You are right.

Actually, I tried PROC MODEL, and this is my code:

proc model data=test noprint;

    by stkcd;

    ENDOGENOUS re;

    fit    price=BPS+BPS*(ROE1-re)/(1+re)+BPS1*(ROE2-re)/((1+re)**2)+BPS2*(ROE3-re)/((1+re)**3);  /* just for test, some items are not included*/

    solve re / out=asd;

quit;

But this does not work.

The log info shows, there is problem with"fit" and

;, /, DROP, INIT, INITIAL, KEEP, PARMS, START, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.  are expected.

Well, it's my first time to use proc model, and I really get confused on this procedure.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3456 views
  • 4 likes
  • 3 in conversation