cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
skratchzero
Level II

How do I calculate a new column with row-dependent operations determined by a grouping label?

I created a stacked table that has a column X corresponding to x-coordinates, a column Label with a grouping label, and finally the Data column. Suppose the set of x-coordinates shared for all collected data are [1,2,3,4,5,6,7,8,9,10], there are three groups A,B,C, and the data are arbitrary numbers. I want to make a new column where the value from Data is normalized within each group (A, B, C) by the value from that group at a specific coordinate, let's say X=3. In other words, for every row where Label = A, divide Data by the value of Data where X=3 AND Label=A. Repeat for B and C. I can think of approaches with if and for loops, but I suspect that is a pretty inefficient way to do the calculation at scale.

1 ACCEPTED SOLUTION

Accepted Solutions
hogi
Level XIII

Re: How do I calculate a new column with row-dependent operations determined by a grouping label?

3 REPLIES 3
hogi
Level XIII

Re: How do I calculate a new column with row-dependent operations determined by a grouping label?

use the Normalization GUI 

hogi
Level XIII

Re: How do I calculate a new column with row-dependent operations determined by a grouping label?

If you prefer a script: 
use the GUI once to create a normalized column, then steal the code.

hogi_2-1719608492311.png

 

 

skratchzero
Level II

Re: How do I calculate a new column with row-dependent operations determined by a grouping label?

Wow that's exactly what I needed, thank you!

Recommended Articles