大家好,
我正在嘗試匯總多個表,但我需要它處於循環形式。
1.如何將輸出表名循環為統一名稱(例如摘要1,摘要2)
2.如何再次循環以下輸出表以獲得另一個摘要
請幫忙。 TIA
- 是否有需要摘要 1、摘要 2...等名稱的特定名稱?
- 如果您有特定的名稱,則可以使用這些名稱,但我建議不要使用它並使用引用。
這是 Big Class 如何使用引用的示例
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt_list = dt << Subset(
By(:sex),
All rows,
Selected columns only(0),
columns(:name, :age, :height, :weight)
);
show(dt_list);
//add dt to dt_list
Insert into(dt_list, dt);
show(dt_list);
//create list to collect summary tables
dt_summary_list = {};
//will require JMP16 due to For Each. For Each can be replöaced with for loop
For Each({val, idx}, dt_list,
dt_summary = val << Summary(
output table("Summary " || char(idx)), //we can use output table() to define name
//output table("Summary"), //you could also let jmp take care of naming
Group(:age),
Mean(:height),
Freq("None"),
Weight("None")
);
Insert Into(dt_summary_list, dt_summary);
);
Show(dt_summary_list[2]); //should use list and indices rather than "hardcoded" names
summary_of_summary = Datatable("Summary 2") << Summary(
output table("SummaryOfSummary2"),
Mean(:"Mean(height)"n),
Freq("None"),
Weight("None")
);