cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
SI-2000
Level I

Function in script to get log of a column

Hello,

I was wondering how I would go about taking the log10 of a few of my columns and then having the data posted.

E.g. For Column X, take the values (Y) and perform log10(Y) and save values under Column X Log

4 REPLIES 4
statman
Super User

Re: Function in script to get log of a column

If I understand you correctly, this is quite easy.  Create the new column logX.  Create a formula for the column (right click on the column and select Formula).  In the left column select Transcendental and you will see log10 option.  Simply put the column you want to transform in the parentheses.

Screen Shot 2021-02-25 at 3.29.40 PM.jpg

"All models are wrong, some are useful" G.E.P. Box
ron_horne
Super User (Alumni)

Re: Function in script to get log of a column

Hi @SI-2000 

for me the fastest way would be to select the columns you want to transform right click them and follow the menu in the picture: New formula column >> transform >> log

ron_horne_0-1614292390802.png

you can do that to as many columns you select in one go.

let us know if it works for you,

ron

 

Re: Function in script to get log of a column

Ron's method is definitely my favorite interactive method. If you need to script this, the 3rd line in the script below gives an example--the line before that just makes a table so we have something to work with. This gets a good bit trickier when you don't know the name of the column you're transforming ahead of time. (See "expression handling" in the scripting guide for details.)

 

Names Default To Here(1);

dt = as table(J(20,1,randomuniform()), << column names({"X"}));

dt << new column ("log10x", formula(log10(:x)));

 

txnelson
Super User

Re: Function in script to get log of a column

@SI-2000 

Your request has been answered by multiple community members.  However, I think coming to the community on such a fundamental JMP function will be very efficient for your JMP learning and usage.  There are such tools as the Discovering JMP document, JMP tutorials and the New User Welcome Kit that will introduce you to JMP much faster.  I encourage you to take the time to explore these items.  I believe that will make your entry into the JMP world far more enjoyable.

Discovering JMP document is available @

     Help=>Discovering JMP

The JMP Tutorials are available @

     Help=>Tutorials=>Beginners Tutorial

The Welcome Kit is available @

     Help=>JMP on the Web=>JMP Welcome Kit

 

Jim