Contributor
Posts: 60

# How to Solve an Equation in SAS?

Hi,

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

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)

Posts: 2,125

## How to Solve an Equation in SAS?

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

Contributor
Posts: 60

## Re: How to Solve an Equation in SAS?

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

Well, thank you all the same.

SAS Super FREQ
Posts: 4,243

## How to Solve an Equation in SAS?

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,

Contributor
Posts: 60

## Re: How to Solve an Equation in SAS?

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.