你好
JMP 如何计算加权标准差(在 Distribution Platform 的加权选项卡中选择变量时?
谢谢
法涅
这不是无知的问题。 权重标准差或方差至少有四种定义。 这些定义仅在使用的分母上有所不同。 也就是说,所有定义中的加权均值和权重平方和都是相同的。 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