如何根据 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。