As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Tip of the Day

From sasCommunity
Jump to: navigation, search

sasCommunity Tip of the Day

data show;
    val = 55;
    b2 = log2(val);
    v2 = log(val) / log(2);
 
    put b2= ;
    put v2=;
run;

SAS supports only 3 bases for the log function, namely, {2, 10, exp(1)}, corresponding to functions log2(), log10(), and log(), respectively.

Sometimes, we need to calculate log value of any positive base number, just as in Excel or some other programming environment, we have function like log(Val, Base). It is not hard to do so by noting that we can calculate logarithms with other base values by dividing the result of the log() function with log(base), where log() is the natural logarithm function.

Therefore, log(Value, Base)=log(Value)/log(Base). This can be shown in this short DATA step to the right.


Submitted By Liang Xie



Feel free to comment on this tip.


Prior tip - Next tip -- Random Tip

Submit a Tip


 

Tips Index by Status

Currently in Use | Yet to be Scheduled | Still Under Review | Tip Awaiting Refinement

Search Tips:


The Tip of the Day Project

A new technical Tip of the Day related to SAS software will be shown on this page and the sasCommunity.org main page every day. Before getting started, you can Browse and Search the current list of tips contributed by users.

Anyone can participate. We hope you do! Here's how:

  1. Submit a Tip by posting a SAS tip that you think others might find useful
  2. Review a Tip prior to publishing
This effort is similar to, and was motivated by, the Wikipedia Tip of the Day Project. Please tell us what you think