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

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

11-25-2011 06:39 AM

Hi,

I am wondering how far SAS can be used for mathematical calculations. Is there some way to use SAS for such operations like:

a) 1/0 = infinity

0/0 =NaN (not a number)

b) Somehow solving formulas. For example like in MatLab finding differential:

diff(X^3)

ans=3X^2

Sometimes it seems that SAS is a super-tool with all included J Or maybe this is an area where SAS can’t be used?

Ieva

Accepted Solutions

Solution

11-26-2011
05:57 PM

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

11-26-2011 05:57 PM

a) SAS uses missing values to represent NaNs. In statistics, an observation can be a NaN if it is missing for a statistical reason (for example, a survey question was left unanswered) or for a mathematical reason (the log of a non-positive number). SAS supports 28 missing values: see http://analytics.ncsu.edu/sesug/2005/TU06_05.PDF for details.

Some people assign the .P missing value to mean "positive infinity" and .N to mean "negative infinity," but most don't. To me a NaN is a NaN.

b) MATLAB licenses (or bought?) the Maple symbolic algebra engine. No, SAS does not include symbolic integration or differentiation. Some SAS procedures support automatic differentiation in order to compute the gradients and Jacobians of objective functions, but that feature is not universal.

All Replies

Solution

11-26-2011
05:57 PM

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

11-26-2011 05:57 PM

a) SAS uses missing values to represent NaNs. In statistics, an observation can be a NaN if it is missing for a statistical reason (for example, a survey question was left unanswered) or for a mathematical reason (the log of a non-positive number). SAS supports 28 missing values: see http://analytics.ncsu.edu/sesug/2005/TU06_05.PDF for details.

Some people assign the .P missing value to mean "positive infinity" and .N to mean "negative infinity," but most don't. To me a NaN is a NaN.

b) MATLAB licenses (or bought?) the Maple symbolic algebra engine. No, SAS does not include symbolic integration or differentiation. Some SAS procedures support automatic differentiation in order to compute the gradients and Jacobians of objective functions, but that feature is not universal.

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

11-27-2011 09:45 PM

Yes. SAS has already offer such function. About detail ,refer to documentation.

data have; input a b; div=divide(a,b); cards; 1 0 0 0 0 1 1 . 0 1 . 1 ; run; proc print;run;

Ksharp

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

11-28-2011 02:04 AM

Thank you Rick and Ksharp for the explanations!