BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ieva
Pyrite | Level 9

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

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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.

View solution in original post

3 REPLIES 3
Rick_SAS
SAS Super FREQ

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.

Ksharp
Super User

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

ieva
Pyrite | Level 9

Thank you Rick and Ksharp for the explanations!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 3 replies
  • 2794 views
  • 3 likes
  • 3 in conversation