你好
JMP 如何計算加權標準差(在分佈平台的加權選項卡中選擇變量時?)
謝謝
范妮
這不是無知的問題。 權重標準差或方差至少有四種定義。 這些定義僅在所使用的分母上有所不同。 也就是說,所有定義中的加權平均值和權重平方和都是相同的。 JMP 僅實現四種定義之一。 其他軟件可能會實現此定義或其他定義之一。
嗨馬克,
我陷入了自己的無知之中……
我在 Excel 中計算了數據集的加權平均值,並將其與 JMP 進行了比較。 結果不匹配。
我使用的公式是:

這與代碼一致,除了:
var = ss / (N Row( y )-1); // weighted variance, unbiased
應該:
var = ss / ((N Row( y )-1/N Row(y))*n; // weighted variance, unbiased
顯然我不明白這一點。
謝謝
范妮
嗨,馬克,
謝謝,我非常感謝您的意見。
因此,我假設不應使用設置權重列屬性時在分發平台中打印的標準差?
計算描述如下:加權算術平均值。 使用這些公式來了解結果中的數量。

使用腳本來說明計算步驟。 在運行腳本之前打開日誌。
Names Default to Here( 1 );
// open examle
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "Row Weight", Numeric, Continuous,
Values(
[0.466037725564092, 3.88878780649975, 2.4091640743427, 2.11785415420309,
4.79403748759069, 2.30050488375127, 1.58066931064241, 3.18035316769965,
1.57862229505554, 0.304837201256305, 3.91091752331704, 2.63118736562319,
3.27893625595607, 3.02616479573771, 1.75871466752142, 1.95901472005062,
1.4666282152757, 2.11275573237799, 2.02008433057927, 4.89492299617268,
0.493469994980842, 4.89886545110494, 2.22502982476726, 4.72375275800005,
0.830245516262948, 1.67820788919926, 3.44848407898098, 4.0259948768653,
3.2834971731063, 4.52901363372803, 3.88477634754963, 4.72076337435283,
4.64333190233447, 3.1073961337097, 0.579181439243257, 2.74820194579661,
0.191317443968728, 2.94498334173113, 2.51307534286752, 1.23225981369615]
)
);
// launch distribution analysis
biv = dt << Distribution(
Weight( :row weight ),
Continuous Distribution(
Column( :height ),
Customize Summary Statistics(
Sum Wgt( 1 ),
Variance( 1 ),
Corrected SS( 1 ),
Set Alpha Level( 0.05 )
)
),
SendToReport(
Dispatch( {}, "height", OutlineBox, {Set Title( "weighted height" )} )
)
);
// compute weight standard deviation and show intermediate results
y = :height << Get As Matrix; // data
w = :row weight << Get As Matrix; // weights
n = Sum( w ); // sum of weights
wYBar = (w`*y / n)[1]; // weighted average
ss = (w`*(y-wYBar)^2)[1]; // corrected weighted sum of squares
var = ss / (N Row( y )-1); // weighted variance, unbiased
s = Sqrt( var ); // weighted standard deviation
Show( wYbar, s, ss, var ); // view all results in Log