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
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