如何根據 dt2 中的唯一值列表從 dt1 中選擇和排除行?所以我使用 dt1 來運行 t-test 分析(Mean by Chamber by ChartID),然後創建一個包含所有 pvalues 的組合數據表 dt2。 我想將其過濾到 p<=0.05 的行,然後創建這些低 pValues 的獨特、唯一列表,並使用它來重新繪製我的圖表,其中僅包含低 PValues。
我現在試圖鏈接回原始的 dt1 時有點卡住了。 最終選擇似乎不起作用的地方。
還要注意,如果有更好的方法來選擇、排除、加入回源 dt,請告訴我。 我試過摘要,關聯數組。
//creating the table of pValues
dt2 = Report( ow[1] )["Means Comparisons", "Comparisons for all pairs using Tukey-Kramer HSD","Ordered Differences Report"][Table Box( 1 )] << Make Combined Data Table;
dt2 << set name( "pValue PairWise by Channel Tukey")
//select and exclude high pVals
dt2 << select where("p-Value"n > 0.05);
dt2 << exclude;
//get list of remaining Unique Chart_ID's
summarize(uniqueVals=by(CHART_ID));
//trying to select on the original source data
dt1 << select where( contains( uniqueVals, :CHART_ID));
//then need to invert and exclude分析腳本編寫回复:如何根據 dt2 中的唯一值列表從 dt1 中選擇和排除行?您的圖表 ID 偶然是數字嗎? Summarize 中的 by() 結果是一個字符串列表——即使原始組標識符是數字。 這將阻止那些列表元素(同樣是字符串)與原始表中的任何值(它們是數字)匹配。
??
乾杯,
布雷迪
回复:如何根據 dt2 中的唯一值列表從 dt1 中選擇和排除行?我的第一個猜測是字符和數值之間不匹配。
下面是一個大類的例子:
Names Default To Here(1);
dt1 = Open("$SAMPLE_DATA/Big Class.jmp");
ow = Oneway(Y(:height), X(:age), All Pairs(1));
dt2 = Report(ow)["Means Comparisons", "Comparisons for all pairs using Tukey-Kramer HSD","Ordered Differences Report"][Table Box( 1 )] << Make Combined Data Table;
dt2 << set name( "pValue PairWise by Channel Tukey");
dt2 << select where(:"p-Value"n > 0.05);
dt2 << exclude;
summarize(dt2, uniqueVals=by(:level)); //check out the type of :level column, could be character
//convert to numbers OR you could convert values in dt1 to characters
For( i = 1, i <= N Items(uniqueVals ), i++,
uniqueVals[i] = Num(uniqueVals[i] )
);
dt1 << select where(Contains(uniqueVals, :age));回复:如何根據 dt2 中的唯一值列表從 dt1 中選擇和排除行?@brady_brady
好問題。 所以我的源數據 (dt1) 有 Chart_ID 作為數字名義。 創建圖表並運行 t-Test 然後輸出組合數據表 (dt2) 後,Chart_ID 列是 Character Nominal。