Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- How to Solve an Equation in SAS?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-09-2012 07:33 AM

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)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to rpg163

02-09-2012 09:22 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Doc_Duke

02-09-2012 09:33 AM

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

Well, thank you all the same.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to rpg163

02-09-2012 09:43 AM

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,

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

02-09-2012 10:44 AM

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.