如何根據 dt2 中的唯一值列表從 dt1 中選擇和排除行?因此,我使用 dt1 運行 t 檢驗分析(通過 ChartID 表示 Chamber),然後創建所有 p 值的組合數據表 dt2。 我想將其過濾到 p<=0.05 的行,然後創建這些低 pValue 的獨特的列表,並使用它僅使用低 PValue 重新繪製圖表。
我現在有點卡住試圖鏈接回原來的 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 中選擇和排除行?uniqueVals 變量必須具有與 dt1 相同的數據類型,因此您可以選擇要更改的類型。 如果您不需要將 Chart_ID 作為數字數據類型,在這種情況下我很可能會將其更改為 dt1 中的字符。
回复:如何根據 dt2 中的唯一值列表從 dt1 中選擇和排除行?@jthi
因此,進行匯總後,看起來 Chart_ID 是 Numeric Continuous,而原始源數據 dt1 Chart_ID 是 numeric Nominal,pvalue 表 dt2 是 Character Nominal。
//extra, just to look at the data
dtUnique = New Table( "uniqueVals less 0.05");
dtUnique << New Column( "ChannelID", Values(uniqueVals));

回复:如何根據 dt2 中的唯一值列表從 dt1 中選擇和排除行?@brady_brady
好問題。 所以我的源數據 (dt1) 將 Chart_ID 作為數字標稱。 創建圖表並運行 t 檢驗,然後輸出組合數據表 (dt2) 後,Chart_ID 列為字符標稱值。
回复:如何根據 dt2 中的唯一值列表從 dt1 中選擇和排除行?我的第一個猜測是字符和數值之間不匹配。
下面是 Big Class 的示例:
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 中選擇和排除行?您的圖表 ID 是數字嗎? Summarize 中的 by() 結果是一個字符串列表——即使原始組標識符是數字。 這將防止這些列表元素(同樣是字符串)與原始表中的任何值(數字)匹配。
??
乾杯,
布雷迪