BookmarkSubscribeRSS Feed

[PRODUCT] LOG 함수를 활용한 인수의 곱을 인수의 합으로 처리

Started ‎06-11-2020 by
Modified ‎06-11-2020 by
Views 73

DATA BACK;

     INPUT VAR;

CARDS;

1

2

3

4

5

;

******************************;

* 관측치 인수의 곱                 ;

******************************;

DATA BACK2;

     RETAIN VAR1 1;

 SET BACK;

     VAR1 = VAR1*VAR;

RUN;

 

* 로그의 성격을 활용하여 인수의 곱을 인수의 리스트를 더하여 처리하는 방식;

* LOG(A*B*C) = LOG(A)+LOG(B)+LOG(C)

=> A*B*C = EXP(LOG(A)+LOG(B)+LOG(C));

 

PROC SQL;

  SELECT EXP(SUM(LOG(VAR))) AS VAR2

  FROM   BACK;

QUIT;

Version history
Last update:
‎06-11-2020 10:45 PM
Updated by:
Contributors

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Article Labels
Article Tags