<?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: Structuring data for an Alternative Specific Multinomial Regression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479921#M24957</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212633"&gt;@Errant&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I'm a little confused by your comment, do you mean categorize by id variables? What do you mean by &amp;lt;id variables&amp;gt;?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;lt;id variables&amp;gt; is a generic place holder for the information other than the brand information variables, might be client, date, shipping label,&amp;nbsp;survey respondent identification &amp;nbsp;or anything that identifies a specific record in the data if any. In your viewtable I see OBS as the likely one, but you have more variables to the right and I don't know what they might be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trust me, you work with data long enough and you will learn the value of identifying records in some unique form.&lt;/P&gt;
&lt;P&gt;So some of your data might look like (truncating some of the values as I don't feel like typing 10+ characters just to illustrate)&lt;/P&gt;
&lt;P&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp; Brand&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Price&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Feature&amp;nbsp;&amp;nbsp; Display&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.7099&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sunshine 0.9800&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Keebler&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.8799&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (can't tell as the image is incomplete)&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jul 2018 15:41:40 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-07-20T15:41:40Z</dc:date>
    <item>
      <title>Structuring data for an Alternative Specific Multinomial Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479041#M24922</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set that looks like this&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="cracker.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21821i9B9B723565C77CD4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cracker.jpg" alt="cracker.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see obs are on the far left, the following four columns represent whether or not a specific brand was purchased. The next four columns represent prices, the next eight columns indicate whether or not a display and feature was used for each brand.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to do an alternative specific regression in this context to represent each brand. Would the best data structure in this case be to sort and organize observations by brand purchase? Essentially, should I lump all the observations together where the purchase of nabisco is 1, for example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 13:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479041#M24922</guid>
      <dc:creator>Errant</dc:creator>
      <dc:date>2018-07-18T13:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Structuring data for an Alternative Specific Multinomial Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479112#M24925</link>
      <description>&lt;P&gt;If I understand your question I suspect that a complete restructure of the data set to look more like&lt;/P&gt;
&lt;P&gt;&amp;lt;id variables&amp;gt; Brand&amp;nbsp;&amp;nbsp; Price Feature Display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then in many regressions use the Brand variable a Class variable or perhaps a By variable.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 15:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479112#M24925</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-18T15:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Structuring data for an Alternative Specific Multinomial Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479310#M24936</link>
      <description>I'm a little confused by your comment, do you mean categorize by id variables? What do you mean by &amp;lt;id variables&amp;gt;?</description>
      <pubDate>Wed, 18 Jul 2018 22:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479310#M24936</guid>
      <dc:creator>Errant</dc:creator>
      <dc:date>2018-07-18T22:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Structuring data for an Alternative Specific Multinomial Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479921#M24957</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212633"&gt;@Errant&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I'm a little confused by your comment, do you mean categorize by id variables? What do you mean by &amp;lt;id variables&amp;gt;?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;lt;id variables&amp;gt; is a generic place holder for the information other than the brand information variables, might be client, date, shipping label,&amp;nbsp;survey respondent identification &amp;nbsp;or anything that identifies a specific record in the data if any. In your viewtable I see OBS as the likely one, but you have more variables to the right and I don't know what they might be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trust me, you work with data long enough and you will learn the value of identifying records in some unique form.&lt;/P&gt;
&lt;P&gt;So some of your data might look like (truncating some of the values as I don't feel like typing 10+ characters just to illustrate)&lt;/P&gt;
&lt;P&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp; Brand&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Price&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Feature&amp;nbsp;&amp;nbsp; Display&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.7099&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sunshine 0.9800&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Keebler&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.8799&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (can't tell as the image is incomplete)&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 15:41:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/479921#M24957</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-20T15:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Structuring data for an Alternative Specific Multinomial Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/480172#M24967</link>
      <description>&lt;P&gt;Thank you, that helps a lot. I'm trying to structure the data exactly the way you depicted it, with proc transpose and I'm running into some issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the ideal dataset would look like this, virtually the same thing you depicted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;obs&lt;/TD&gt;&lt;TD&gt;OBS&lt;/TD&gt;&lt;TD&gt;Purchase&lt;/TD&gt;&lt;TD&gt;Brand&lt;/TD&gt;&lt;TD&gt;Feature&lt;/TD&gt;&lt;TD&gt;Display&lt;/TD&gt;&lt;TD&gt;Price&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Private&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0.709999979&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Keebler&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0.980000019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Nabisco&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0.879999995&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Sunshine&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1.199999928&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've tried a few variations of proc transpose, but I haven't been able to mimic that exact structure. Can you tell what I'm missing?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc transpose data=HW5.crackers_hw5;
   var DisplKeebler  DisplNabisco DisplPrivate DisplSunshine FeatKeebler FeatNabisco FeatPrivate FeatSunshine; 
   by obs KEEBLER NABISCO PRIVATE SUNSHINE;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 18:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/480172#M24967</guid>
      <dc:creator>Errant</dc:creator>
      <dc:date>2018-07-21T18:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Structuring data for an Alternative Specific Multinomial Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/480564#M24999</link>
      <description>&lt;P&gt;Unless the variables follow very specific naming conventions it can be difficult to get proc transpose to realize that 1) you want to get two things from one variable its value and its name, 2) doing some other aligned item.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you sure the values you show for price are correct for the example picture data?&lt;/P&gt;
&lt;P&gt;I would expect for OBS 1 that Keebler would have the value of PriceKeepler or 0.879999995 and Nabisco would have the value of PriceNabisco or 1.199999928.&lt;/P&gt;
&lt;P&gt;If the values are as I suspect then use of arrays in a data step might be a better choice than going through Proc transpose:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   array b PRIVATE      KEEBLER       NABISCO      SUNSHINE;
   array d DisplPrivate DisplKeebler  DisplNabisco DisplSunshine ;
   array f FeatPrivate  FeatKeebler   FeatNabisco  FeatSunshine;
   array p PricePrivate PriceKeebler  PriceNabisco PriceSunshine;
   length Brand $ 8 ;
   do i=1 to dim(b);
      Purchase = b[i];
      Brand=vname( b[i] );
      Display = d[i];
      Feature = f[i];
      Price   = pr[i];
      output;
   end;
   keep obs brand display feature price;
run;

&lt;/PRE&gt;
&lt;P&gt;Please note that the order of the variables in the array definitions is critical so that each item references the same product set of values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 18:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Structuring-data-for-an-Alternative-Specific-Multinomial/m-p/480564#M24999</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-23T18:04:48Z</dc:date>
    </item>
  </channel>
</rss>

