cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar

How can i choose the same observation to calculate a ratio for a series of observations?

Hello, I am pretty new to jmp, but I have a question regarding creating a function column. So I have a dateset where I have recorded physiological data for the same 6 heart rate values in 16 mice. I want to choose two of these physiological variables to calculate a ratio - and I want the numerator to be the phys. value for the corresponding highest heart rate, and the denominator for another phys. value but for the middle (3rd lowest) heart rate. How can I specify this for all my 16 mice?

4 REPLIES 4
jthi
Super User

Re: How can i choose the same observation to calculate a ratio for a series of observations?

Can you provide example data? 

-Jarmo

Re: How can i choose the same observation to calculate a ratio for a series of observations?

Hi, Jarmo!

 

Below is some example data for 4 of my animals, the E column will be my numerator and the early e' should be the denominator. So I want to calculate a ratio where E is from HR = 600, and early e' is from 400 for each animal (the HR intervals is the same for each animal)

jthi
Super User

Re: How can i choose the same observation to calculate a ratio for a series of observations?

Are other HR values important? Do you wish to keep the data format same? Just asking because the calculation is much easier to perform from table like this

jthi_0-1741179691299.png

You can also try to use formulas like these

numerator:

:E[Col Min(If(:HR == 600, Row(), .), :Animal ID)]

denominator:

:"early e'"n[Col Min(If(:HR == 400, Row(), .), :Animal ID)]

jthi_1-1741179906072.png

 

 

-Jarmo
txnelson
Super User

Re: How can i choose the same observation to calculate a ratio for a series of observations?

Here is the formula I came up with

Col Mean( If( :HR == 600, :E, . ), :Animal ID ) / Col Mean(
	If( :HR == 400, :early e', . ),
	:Animal ID
)

txnelson_0-1741181811345.png

 

Jim

Recommended Articles