如何使用现有标准差数据表绘制图表?
例如:
样本平均值标准差
1 70000 25800
2 45000 19100
3 65000 41200
谢谢你!
这是执行此操作的一种方法:
给个数据表

你可以用图表来表示:

Names Default To Here( 1 );
New Table( "example",
Add Rows( 3 ),
New Column( "Sample",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Property( "Value Order", {Numerical Order( 0 )} ),
Set Selected,
Set Values( [1, 2, 3] ),
Set Display Width( 97 )
),
New Column( " Mean", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [70000, 45000, 65000] ) ),
New Column( "Standard deviation", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [25800, 19100, 41200] ) )
);
Graph Builder(
Variables( X( :Sample ), Y( :" Mean"n ), Y( :Standard deviation ) ),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 5 ) ),
Line( X, Y, Legend( 7 ) )
),
Elements(
Position( 1, 2 ),
Points( X, Y, Legend( 6 ) ),
Line( X, Y, Legend( 8 ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model( 5, Base( 0, 0, 0, Item ID( " Mean", 1 ) ) ),
Legend Model( 6, Base( 0, 0, 0, Item ID( "Standard deviation", 1 ) ) )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {5, [0], 7, [2], 6, [1], 8, [3]} )}
)
)
)
您的图形格式是否与我演示的不同?如果是这样,请提供它,社区将介入帮助您。
注意:数据表和图表的创建首先是交互完成的,完成后我请求 JMP 向我提供脚本。
注 2:我建议您花时间阅读“帮助”下拉菜单下标题为“发现 JMP”的文档。

我必须做几件事才能使您的数据发挥作用。
首先,在“列”选择区域中,我添加了两个新的虚拟列,分别为“上”和“下”。它们的创建是为了给出平均值±标准差的上限值和下限值。
其次,将“平均值”、“上限”和“下限”拖到 Y 轴拖放区域后,我将这些点改成了条形。由于我只想用条形来表示平均值,所以我更改了“变量”属性,并取消选中“上限”和“下限”。
第三,我在图表中添加了第二个条形图。我再次进入属性区域,将条形图样式更改为区间。由于我只想在区间条形图中显示上限和下限,因此我取消选择了平均值。
这是用于重新创建图表的 JSL
Graph Builder(
Transform Column( "Lower", Formula( :Mean - :Standard deviation ) ),
Transform Column( "Upper", Formula( :Mean + :Standard deviation ) ),
Size( 744, 627 ),
Variables(
X( :Sample ),
Y( :Mean ),
Y( :Upper, Position( 1 ) ),
Y( :Lower, Position( 1 ) )
),
Elements(
Bar( X, Y( 1 ), Legend( 4 ) ),
Bar( X, Y( 2 ), Y( 3 ), Legend( 6 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch( {"Bar"}, "", OutlineBox, {Close( 0 )} ),
Dispatch( {"Bar"[2]}, "", OutlineBox, {Close( 0 )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "Mean" )} )
)
)
注意:使用原始数据创建所需的图表会更简单。JMP 会为您生成平均值、上限和下限。