Choose Language Hide Translation Bar
Community Trekker

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

0 Kudos

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.

Learn it once, use it forever!

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
0 Kudos
Community Trekker

Re: log2 transformation using new formula column

Thanks so much. Neal

0 Kudos

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. 


(view in My Videos)


I hope this helps!