cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
rexneal
Level III

log2 transformation using new formula column

How can I log2 transformation many columns (hundreds) all at once? Is there a way of doing log2 transformation using the new formula column?
Thanks, Neal

4 REPLIES 4

Re: log2 transformation using new formula column

I don't think so. The log base 2 is not a built-in function. As far as I know, you would have to use the equivalent log( x ) / log( 2 ) expression.

 

It is possible to define custom functions that can appear in the formula editor. I do not think that they appear in the New Column Formula menu, though. There are a lot of Community members who are smarter than me, so someone else might have a better answer for you.

Re: log2 transformation using new formula column

So, you do have to build the formula, but it may not be as bad as you think. Let's suppose you have 100 columns where you need this transformation. Put those columns all together. By this I mean, they are contiguous. Suppose the first one is Column 11, second one is Column 12, etc. up to Column 110. Now create 100 new columns. Select your 100 new columns and choose Cols > Standardize Attributes. In the Standardize Properties area click on Column Properties and select Formula.Check the box for Substitute Column Reference. Click Edit Formula. Now enter the first formula for your first new column. With my scenario it would be Log(Column 111)/Log(2). When you click OK JMP will fill in a formula for every one of your new columns, marching through each of the columns that had the data to be transformed. Your last formula column should be Log(Column 110)/Log(2).

Dan Obermiller
rexneal
Level III

Re: log2 transformation using new formula column

Thanks so much. Neal

julian
Community Manager Community Manager

Re: log2 transformation using new formula column

Hi @rexneal,

I would suggest something similar to @Dan_Obermiller, but by first taking advantage of the New Formula Column functionality you do have to make new columns and title them correctly.

  1. Select your columns
  2. Right Click column header > New Formula Column > Transform > Log
  3. Select the new Log transformed columns
  4. Right Click column header > Standardize Attributes
  5. In the Standardize Properties section, select Formula
  6. Check the box for Substitute Column Reference
  7. Click Edit Formula
  8. Select the column inside the log function, and click the comma key to reveal the base
  9. Change the base to 2, click ok to close the formula, then ok to close Standardize Attributes. 

It might sound like a lot, but you can do this in 45 seconds. Here's a short video showing all the steps. 

 

 

I hope this helps!

@julian