我在尝试编写脚本将 Tabulate 对象变成新数据表时遇到了问题。我尝试了以下两种语法,但都没有创建表。我将其用作更大工作流程中的一个步骤。
t2 = tbl << Tabulate(
Add Table(
Column Table( Grouping Columns( :Treatment ) ),
Row Table(
Analysis Columns(
:"Attribute 1"n,
:"Attribute 2"n,
:"Attribute 3"n,
:"Attribute 4"n,
:"Attribute 5"n, :"Attribute 6"n,
:"Attribute 7"n, :"Attribute 8"n,
:"Attribute 9"n,
:"Attribute 10"n, :"Attribute 11"n
),
Statistics( Mean )
)
),
Local Data Filter(
Mode( Show( 0 ) ),
Add Filter( columns( :A or B), Where( :A or B == "A" ) )
),
)) << Make Into Data Table();
和
t2 = tbl << Tabulate(
Add Table(
Column Table( Grouping Columns( :Treatment ) ),
Row Table(
Analysis Columns(
:"Attribute 1"n,
:"Attribute 2"n,
:"Attribute 3"n,
:"Attribute 4"n,
:"Attribute 5"n, :"Attribute 6"n,
:"Attribute 7"n, :"Attribute 8"n,
:"Attribute 9"n,
:"Attribute 10"n, :"Attribute 11"n
),
Statistics( Mean )
)
),
Local Data Filter(
Mode( Show( 0 ) ),
Add Filter( columns( :A or B), Where( :A or B == "A" ) )
),
));
Wait(1);
t2 << Make Into Data Table();
我使用的是 JMP 17.2。
嗯,有趣。
在第一个示例中,当您添加一些括号时,它应该可以工作。如果没有括号,您会将消息发送到表格,而不是 Tabulate 对象。
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
(dt << Tabulate(
Add Table(
Column Table( Analysis Columns( :height ) ),
Row Table( Grouping Columns( :sex ) )
)
)) << Make Into Data Table();
第二个选项应该可行。可能是打字错误?
最简单的方法:
使用 GUI,然后转到日志并“窃取代码”。
添加括号后问题就解决了 - 所有这些问题都只是打字错误。谢谢!