<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Summarize response data to multiple response modeling type in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188477#M40732</link>
    <description>&lt;P&gt;You are correct that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2 &amp;lt;&amp;lt; selectRows(r2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;also works. It's possible that in 2012 'selectRows' did need a matrix. But it's more likely that I just thought it did . . .&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2019 19:49:24 GMT</pubDate>
    <dc:creator>ian_jmp</dc:creator>
    <dc:date>2019-03-21T19:49:24Z</dc:date>
    <item>
      <title>Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/187404#M40634</link>
      <description>&lt;P&gt;I have a table of lots and wafers, which have been assigned a response code based on yield (red, green, blue; not my choice, but it's what I have to work with). There are combinations of lots and wafers that have multiple responses assigned to them. What I want to do is summarize the table by lot and wafer, and where a combination has multiple repsonses add all values to the variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;From:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Response Data.jpg" style="width: 304px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16362i40A972D091F16ED9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Response Data.jpg" alt="Response Data.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Multiple Response Data.jpg" style="width: 304px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16361i2A55D41C85E98821/image-size/large?v=v2&amp;amp;px=999" role="button" title="Multiple Response Data.jpg" alt="Multiple Response Data.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 16:26:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/187404#M40634</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-03-18T16:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/187685#M40655</link>
      <description>&lt;P&gt;I had some old code that might help. Perhaps there is a better way now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// 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 &amp;lt;&amp;lt; Summary(Group(gCols));
	dt2 &amp;lt;&amp;lt; setName("Multiple Response Summary of "||(dt &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; newColumn(rCol, Expression, None);
	for(r2=1, r2&amp;lt;=NRow(dt2), r2++,
		dt2 &amp;lt;&amp;lt; clearSelect;
		dt2 &amp;lt;&amp;lt; selectRows(Matrix({r2}));
		r = dt &amp;lt;&amp;lt; getSelectedRows;
		// Response values are initially put in a list to make getting the unique values easier
		mr2 = {};
		for(i=1, i&amp;lt;=NRow(r), i++,
			InsertInto(mr2, Column(dt, rCol)[r[i]]);
			);
		// Force the values in the list to be unique
		mr2 = associativeArray(mr2) &amp;lt;&amp;lt; getKeys;
		// Put the list of unique values in the table
		Column(dt2, rCol)[r2] = mr2;
		);
	dt2 &amp;lt;&amp;lt; clearSelect;
	// Now need to 'unpack' each list to get values suitable for the 'Multiple Response' modeling type
	allLists = Column(dt2, rCol) &amp;lt;&amp;lt; getValues;
	for(r2=1, r2&amp;lt;=NRow(dt2), r2++,
		mr2 = allLists[r2];
		for(i=1, i&amp;lt;=NItems(mr2), i++,
			if(i==1,
				str2 = mr2[i],
				str2 = str2 || ", " || mr2[i];
				);
			);
		allLists[r2] = str2;
		);
	Column(dt2, rCol) &amp;lt;&amp;lt; setDataType("Character");
	Column(dt2, rCol) &amp;lt;&amp;lt; setModelingType("Multiple Response");
	Column(dt2, rCol) &amp;lt;&amp;lt; 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");
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Mar 2019 11:55:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/187685#M40655</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2019-03-19T11:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/187718#M40658</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7923"&gt;@MarkDayton&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Perhaps you were looking for a scripted solution, in which case, you can stop reading... &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605"&gt;@ian_jmp&lt;/a&gt;&amp;nbsp;'s works perfectly. However, if you want to do this interactively, the following should work for you:&lt;/P&gt;
&lt;P&gt;1. Use Tables-&amp;gt;Split (place Response in the Split By and Split Columns roles and Lot, Wafer in the Group By role):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 811px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16373i835E09FC04FEB452/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. In the new table, select the new columns and then use the Cols-&amp;gt;Utilities-&amp;gt;Combine Columns menu to create the new, multiple response column:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 468px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16375i83470630C2539236/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Press delete to do away with the select columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 14:01:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/187718#M40658</guid>
      <dc:creator>jerry_cooper</dc:creator>
      <dc:date>2019-03-19T14:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/187727#M40659</link>
      <description>&lt;P&gt;Did you see &lt;STRONG&gt;Help&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Books&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Consumer Research&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Categorical Response Analysis&lt;/STRONG&gt; chapter? The Categorical platform handles the multiple response type very well and provides many ways to summarize and visualize such data.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 14:27:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/187727#M40659</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-03-19T14:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188195#M40696</link>
      <description>&lt;P&gt;Thanks, was hoping there was a single step process that I was missing, but this will get me there.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 20:36:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188195#M40696</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-03-20T20:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188196#M40697</link>
      <description>&lt;P&gt;Thanks, I'll give it a shot.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 20:37:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188196#M40697</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-03-20T20:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188197#M40698</link>
      <description>&lt;P&gt;I hadn't. Thanks for the pointer. I would never have associated Consumer Research with analysis of process control monitoring data from a semiconductor foundry :))&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 20:41:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188197#M40698</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-03-20T20:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188419#M40725</link>
      <description>&lt;P&gt;That did it, though I still need to try Ian's script. I used Tabulate and Recode to accomplish the first step you did with stack, but I ended up with the same result for step two, which I hadn't used before. Again, thanks for the help.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:40:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188419#M40725</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-03-21T15:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188453#M40728</link>
      <description>&lt;P&gt;Question: &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605"&gt;@ian_jmp&lt;/a&gt;&amp;nbsp;can you explain what's going on with:&amp;nbsp;&lt;STRONG&gt;dt2 &amp;lt;&amp;lt; selectRows(Matrix({r2}));&lt;/STRONG&gt;? Why the matrix for a single interger?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 19:14:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188453#M40728</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-03-21T19:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize response data to multiple response modeling type</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188477#M40732</link>
      <description>&lt;P&gt;You are correct that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2 &amp;lt;&amp;lt; selectRows(r2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;also works. It's possible that in 2012 'selectRows' did need a matrix. But it's more likely that I just thought it did . . .&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 19:49:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-response-data-to-multiple-response-modeling-type/m-p/188477#M40732</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2019-03-21T19:49:24Z</dc:date>
    </item>
  </channel>
</rss>

