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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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