寻求帮助....我想知道脚本语法是否已更改。
我正在对包含数千列的数据表运行一些统计数据和 t 检验。 然后我生成一个摘要“组合数据表”来对 p 值列进行排序。 然后我想根据 p 值选择/排除,但它似乎根本不起作用。有什么想法吗?
/***********************************/
/*pVal selection*/
// Create the combined data table, using xPath (return a list of the OutlineBoxes from the report that have the title Ordered Differences Report. Then, use the first of those to make the combined data table.)
outlines = (Report( ow1[1] ) << Top Parent) << XPath( "//OutlineBox[text()='Ordered Differences Report']" );
dt1 = outlines[1][Table Box( 1 )] << Make Combined Data Table;
dt1 = current data table();
//Select the rows w/ low pVal, create a String value of all the Column Names, by selected row
pVals = Loc(dt1:"p-Value"n << get as matrix > 0.05);
comparisonStrings = {};
For(i = 1, i <= N Items(pVals), i++,
Insert Into(comparisonStrings, char(dt1:Y[pVals[i]]));
);
show(comparisonStrings);
//Go to source dt, select all Cols that match the string and exclude. You're left with only Cols from charts w low pVal.
dt_Data_Wide << clear select;
dt_Data_Wide << Clear Column Selection();
colList = dt_Data_Wide << Get Column Names( String ); /*gets a list of all columns*/
For( i = 1, i <= N Items( comparisonStrings ), i++,
If( Contains( colList, Char( comparisonStrings[i] ) ),
Column( dt_Data_Wide , Char( comparisonStrings[i] ) ) << Set Selected( 1 ) << exclude( 1 )
)
);
dt_Data_Wide << clear select;
dt_Data_Wide << Clear Column Selection();您的 JSL 似乎适用于我运行的简单示例。对于那些 p 值大于 .05 的列,它将列属性设置为已排除。你发现什么不同?
它生成并设置“ComparisonStrings”列表
它清除源表的选择。
它生成列名列表
但是循环选择和排除似乎没有做任何事情。



您的 JSL 没有做任何会更改您引用为“dt1”的数据表的事情;如果您想消除 p 值高于 .05 的行,添加
dt1 << select rows(pVals);
dt1 << delete rows;
在你的“Show(comparisonStrings);”之后