我有一張批次和晶圓表,它們已根據產量分配了一個響應代碼(紅色、綠色、藍色;不是我的選擇,但這是我必須處理的)。 批次和晶圓的組合具有分配給它們的多個響應。 我想要做的是按批次和晶圓匯總表格,並且在組合具有多個響應的情況下將所有值添加到變量中。
從:
到:

你是對的:
dt2 << selectRows(r2);
也有效。 2012 年的“selectRows”可能確實需要一個矩陣。 但更可能的是我只是這麼認為。 。 。
問題: @ian_jmp你能解釋一下發生了什麼事嗎: dt2 << selectRows(矩陣({r2})); ? 為什麼矩陣是單個整數?
就這樣,儘管我仍然需要嘗試伊恩的腳本。 我使用製表和重新編碼來完成您使用堆棧所做的第一步,但我最終得到了第二步相同的結果,這是我以前沒有使用過的。 再一次感謝你的幫助。
我沒有。 謝謝指點。 我永遠不會將消費者研究與半導體代工廠的過程控制監控數據的分析聯繫起來:))
謝謝,希望我缺少一個步驟過程,但這會讓我到達那裡。
你有沒有看到幫助>圖書>消費者研究>分類響應分析章節? 分類平台可以很好地處理多重響應類型,並提供多種方法來匯總和可視化此類數據。
你好@馬克代頓,
也許您正在尋找腳本化的解決方案,在這種情況下,您可以停止閱讀...... @ian_jmp效果很好。 但是,如果您想以交互方式執行此操作,以下內容應該適合您:
1. 使用 Tables->Split(將 Response 放置在 Split By 和 Split Columns 角色中,將 Lot、Wafer 放置在 Group By 角色中):

2. 在新表中,選擇新列,然後使用“列”->“實用工具”->“組合列”菜單創建新的多重響應列:

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");