与:

dalist = {{379, 219, 228, 401}, {387, 239, 230, 393},
          {403, 238, 217, 429}, {377, 233, 225, 432}}

BarChart@dalist




我想针对每个条件为每个Bin计算/绘制相对频率,而不是绝对计数。

哪里:

{379, 219, 228, 401}


一个条件的4个箱计数。因此:

{379, 219, 228, 401}[[1]]/Total@{379, 219, 228, 401}




是我要查看的第一个条件/第一个Bin的结果,而不是计数本身。

最佳答案

是不是

BarChart[dalist/Total /@ dalist]


关于wolfram-mathematica - 在Mathematica中计算相对频率,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7190167/

10-12 22:02