我遇到一個問題,我想將大型測試程序中每個測試的總和和 n 製成表格。我不確定我的問題是什麼,但希望得到一些指導。程式碼編譯並輸出製表窗口,如下所示,但未填入。

下面是我寫的程式碼:
dt = Current Data Table();
colList = dt << Get Column Names( string );
colname = Column(dt, "TEST_T") << getname;
testIndex = (Loc(colList, colname))[1];
numRows = N Rows(dt);
For(i = (testIndex + 1), i <= N Items(colList), i++,
column = Column(dt, colList[i]);
For(j = 1, j <= numRows, j++,
column[j] = Substitute(column[j],
"Pass", "1",
"Fail", "0"
);
);
);
//Change Modeling Type for Tabulate functionality
dt:tst_temp << Set Modeling Type(Nominal);
dt:SITE_NUM << Set Modeling Type(Nominal);
////Change Every Column after TEST_T to Numeric Data Type and Continuous Modeling type
For(i = (testIndex + 1), i <= N Items(colList), i++,
column = Column(dt, colList[i]);
column << Data Type(Numeric);
column << Set Modeling Type(Continuous);
);
list = dt << Get Column Names( string );
Remove From(list, 1, testIndex);
yieldByTest = (dt << Tabulate(
Add Table(
Column Table(
Grouping Columns(:tst_temp),
Statisitcs(Sum, N)
),
Row Table(
Analysis Columns(Column(Eval(list)))
)
),invisible
)
) << Make Into data Table;
yieldByTest << Set Name("Yield by Test Across Temperature");
這是製表窗口的示例輸出。 實際上,行數會大得多。 跟進問題,有沒有辦法從 Tabulate 窗口將 Sum/N 放入每個溫度的列中? 我一直在手動執行此操作,但想知道是否有一種簡單的方法可以從 Tabulate 窗口執行此操作?

我認為這是一個例子,
在你的腳本中你有一個錯字“Statisics(Sum,N)”
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Get a list of all continuous Columns
colList = dt << Get Column Names( "Continuous" );
// Feed that list to Analysis Columns of Tabulate
dt << Tabulate(
Show Control Panel( 0 ),
Add Table( Column Table( Analysis Columns( Eval( colList ) ), Statistics( Mean, N ) ), Row Table( Grouping Columns( :sex ) ) )
);