turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Learn SAS
- /
- Analytics U
- /
- New to Proc FCMP and Need Help with with SOLVE fea...

Topic Options

- 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
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-15-2016 07:58 PM

I'm working on a GIS project and was asked to validate a method used in a recently published article. One of the many steps to do this involves "back-solving" for a variable thats in a fraction within an exponent (pic below [solving for dxy]). Though the forumla looks complex, I think that the solve feature within proc fcmp should help me get a solution quicker without me having to do any time consuming algebra (e.g., ln(e)*ln(fraction)...). To test the SOLVE feature, I used the following inputs from the previously hyperlinked article knowing that I should get dxy=24.61 (or something close) as the solution:

*median=*20*SD=*6*Cglob=*30*SDglob=*5.91

I set the formula below to zero within my code (i.e., subtract 0.01 from both sides). That said, when I use *proc fcmp* to solve for "dxy", I get a missing value (i.e., ".") instead of the answer I should get (i.e., ~24.61).

Is there something I doing wrong? Is *proc fcmp *inappropriate for my needs? ANY feedback will be appreciative, as I am having difficulty finding a solution online. My SAS code is below the pic of the forumla.

**Wanting to solve for dxy within formula below assuming you know all other paramters/inputs:**

**SAS Code:**

proc fcmp outlib=work.funcs.algebra; function effect_catch(median, SD, Cglob, SDglob, dxy) ; return ( (((1+exp(-(median*constant("pi"))/(SD*sqrt(3))))/(1+exp(((dxy-median)*constant("pi"))/(SD*sqrt(3))))) * ((1+exp(-((Cglob/2)*constant("pi"))/(SDglob*sqrt(3))))/(1+exp(((dxy-(Cglob/2))*constant("pi"))/(SDglob*sqrt(3)))))) -0.01); endsub; function solvecatch(median, SD, Cglob, SDglob); dxy=solve('effect_catch', {.}, 0, median, SD, Cglob, SDglob,.); return(dxy); endsub; quit; options cmplib=work.funcs; data test; dxy=solvecatch(20, 6, 30, 5.91); put dxy=; run;

Accepted Solutions

Solution

12-16-2016
11:18 AM

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

Posted in reply to ldwight

12-15-2016 11:42 PM

All Replies

Solution

12-16-2016
11:18 AM

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

Posted in reply to ldwight

12-15-2016 11:42 PM