你好
給定一列帶有數值的列,我想以這種方式計算MA:
MAi = 1 / N * SUM(j = i-1至j = iw)Xj
其中w是窗口寬度,i-1是起始元素,iw是最後一個元素。 不用w = 2做例子
x
-------------
1 x1
2 x2
3 x3…..
4 x4 MA =(X3 + X2)/ 2
5 x5 MA =(X4 + X3)/ 2
6 x6…..
7 x7
通過使用“新建公式”列->“行”功能
我將權重設置為“相等”。 要獲得我之前報告的內容,之前的項目和之後的項目如何?
如果我要使用指數權重,也會出現同樣的問題。

謝謝菲利斯
你好,
如果它是一個簡單的移動平均值,則可以使用“公式編輯器”中的Lag()函數輕鬆地對其進行計算。
下面是一個有關如何計算Tablet Production樣本數據表中的“溶出度”列的前三行移動平均值的示例:
// Open Data Table: Tablet Production.jmp
// → Data Table( "Tablet Production" )
Open( "$SAMPLE_DATA/Tablet Production.jmp" );
// New column: Dissolution_MA3
Data Table( "Tablet Production" ) << New Column( "Dissolution_MA3",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
(Lag( :Dissolution, 1 ) + Lag( :Dissolution, 2 ) + Lag( :Dissolution, 3 ))
/ 3
)
);
// Report snapshot: Tablet Production - Graph Builder
Data Table( "Tablet Production" ) << Graph Builder(
Size( 799, 452 ),
Show Control Panel( 0 ),
Variables( Y( :Dissolution ), Y( :Dissolution_MA3, Position( 1 ) ) ),
Elements( Line( Y( 1 ), Y( 2 ), Legend( 6 ), Row order( 1 ) ) )
);
馬西莫干杯