cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

Cumulative Insect-Days

Hello,

 

I need help calculating something called Cumulative Insect-Days per treatment. I don't know how to do that as it involves calculating the mean of specific rows and the difference between two specific rows.

 

Cumulative insect-days = [ (Xi + Xi+1) * average(Y+Yi+1) ] + (Yi+1)

Xi and Xi+1 are adjacent points in time

Yi and Yi+1 are corresponding insect numbers

 

I have done these calculations in Excel (attached), but I need to do them in JMP as I have several columns and rows of data. Formula is in excel.

 

Thank you,

 

Bordini

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Cumulative Insect-Days

Here is the formula that will create the values you want

If( Row() == 1,
	val = :"Cumulative insect-days"n;
	lastVal = val;
,
	val = Mean( :Number of Insects, Lag( :Number of Insects ) ) * (:Date of Year - Lag( :Date of Year )) + lastVal;
	lastVal = val;
);
val;

txnelson_0-1632791159185.png

 

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Cumulative Insect-Days

Here is the formula that will create the values you want

If( Row() == 1,
	val = :"Cumulative insect-days"n;
	lastVal = val;
,
	val = Mean( :Number of Insects, Lag( :Number of Insects ) ) * (:Date of Year - Lag( :Date of Year )) + lastVal;
	lastVal = val;
);
val;

txnelson_0-1632791159185.png

 

Jim
bordini
Level III

Re: Cumulative Insect-Days

This approach works nicely. Thank you very much. I appreciate your help.

Recommended Articles