cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

Moving Average

I have a table called drugs with columns drug and result, how do I calculate the moving average of the result column by taking the first 4 rows followed by the next 4 rows and similarly continue. Pfa the sample table for reference. 

12 REPLIES 12
txnelson
Super User

Re: Moving Average

Create a new column in your data table, and apply the folloing formula

Col Moving Average( :Result, weighting = 1, before = 3, :Drug )
Jim
jojmp
Level III

Re: Moving Average

what does weighting = 1, before = 3, :Drug mean?
Could you please explain the formula

Re: Moving Average

JMP's support documentation gives some additional background for how the formula may be defined (defines the arguments and also includes some nice little examples):  https://www.jmp.com/support/help/en/16.2/#page/jmp/statistical-functions-2.shtml#

 

PatrickGiuliano_0-1660093800183.png

 

You can find in Wikipedia (https://en.wikipedia.org/wiki/Moving_average) more on first principles and mathematical/ conceptual understanding behind the Moving Average Calculation:

 

 

Recommended Articles