我有一张包含批次和晶圆的表格,根据产量(红色、绿色、蓝色;不是我的选择,但这是我必须使用的)分配了一个响应代码。 有分配给它们的多个响应的批次和晶圆的组合。 我想要做的是按批次和晶圆汇总表格,如果组合有多个响应,则将所有值添加到变量中。
从:
至:

你是对的:
dt2 << selectRows(r2);
也有效。 2012 年的“selectRows”可能确实需要一个矩阵。 但更有可能的是,我只是认为它确实如此。 . .
问题: @ian_jmp你能解释一下发生了什么吗: dt2 << selectRows(矩阵({r2})); ? 为什么是单个整数的矩阵?
做到了,尽管我仍然需要尝试 Ian 的脚本。 我使用 Tabulate 和 Recode 来完成你对堆栈所做的第一步,但我在第二步中得到了相同的结果,这是我以前没有使用过的。 再一次感谢你的帮助。
我没有。 感谢您的指点。 我永远不会将消费者研究与分析来自半导体代工厂的过程控制监控数据联系起来:))
你有没有看到帮助>图书>消费者研究>分类反应分析章节? 分类平台很好地处理了多响应类型,并提供了多种方法来汇总和可视化此类数据。
你好@马克代顿,
也许您正在寻找脚本解决方案,在这种情况下,您可以停止阅读... @ian_jmp的作品完美。 但是,如果您想以交互方式执行此操作,则以下内容应该适合您:
1. 使用 Tables->Split(将 Response 放在 Split By 和 Split Columns 角色中,Lot, Wafer 放在 Group By 角色中):

2. 在新表中,选择新列,然后使用 Cols->Utilities->Combine Columns 菜单创建新的多重响应列:

3. 按删除删除选择的列。
希望这可以帮助。
我有一些旧代码可能会有所帮助。 也许现在有更好的方法:
// ian.cox@jmp.com: 23Jun2012
NamesDefaultToHere(1);
// **********************************************************************************************
// Given a table (dt), a list of grouping columns therein (gCols), and a character response
// column (rCol), aggregates the latter into a multiple response column
// **********************************************************************************************
mrSummarize =
Function({dt, gCols, rCol}, {Default Local},
// Summarize using the specified grouping columns to get dt2
dt2 = dt << Summary(Group(gCols));
dt2 << setName("Multiple Response Summary of "||(dt << getName));
// Loop over the rows of dt2 and build a new column with the multiple response values:
// Exploit the linking between dt2 and dt to do this
dt2 << newColumn(rCol, Expression, None);
for(r2=1, r2<=NRow(dt2), r2++,
dt2 << clearSelect;
dt2 << selectRows(Matrix({r2}));
r = dt << getSelectedRows;
// Response values are initially put in a list to make getting the unique values easier
mr2 = {};
for(i=1, i<=NRow(r), i++,
InsertInto(mr2, Column(dt, rCol)[r[i]]);
);
// Force the values in the list to be unique
mr2 = associativeArray(mr2) << getKeys;
// Put the list of unique values in the table
Column(dt2, rCol)[r2] = mr2;
);
dt2 << clearSelect;
// Now need to 'unpack' each list to get values suitable for the 'Multiple Response' modeling type
allLists = Column(dt2, rCol) << getValues;
for(r2=1, r2<=NRow(dt2), r2++,
mr2 = allLists[r2];
for(i=1, i<=NItems(mr2), i++,
if(i==1,
str2 = mr2[i],
str2 = str2 || ", " || mr2[i];
);
);
allLists[r2] = str2;
);
Column(dt2, rCol) << setDataType("Character");
Column(dt2, rCol) << setModelingType("Multiple Response");
Column(dt2, rCol) << setValues(allLists);
dt2;
);
// Sample table
dt = New Table( "Data",
Add Rows( 3 ),
New Column( "Lot",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values( [1, 1, 2] )
),
New Column( "Wafer",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values( [2, 2, 1] )
),
New Column( "Response",
Character,
"Nominal",
Set Values( {"Green", "Red", "Blue"} )
)
);
// Try out the function
mrSummarize(dt, {"Lot", "Wafer"}, "Response");