<?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 How to structure the input data for PROC MDC? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-structure-the-input-data-for-PROC-MDC/m-p/554619#M74682</link>
    <description>&lt;P&gt;I'm preparing my data to run proc MDC but kept receiving the error:&amp;nbsp;&lt;SPAN&gt;"ERROR: The NCHOICE= option is not allowed when the number of choices for each individual (ID) is not the same." I don't really get what it means. Could you help me figure out what's wrong?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original dataset (final1) is a panel transaction data that has the columns: customerid, week, brand, p1 p2 p3 p4 d1 d2 d3 d4 f1 f2 f3 f4.&lt;/P&gt;
&lt;P&gt;(P1-P4 are average price of brand 1-4 in that week, respectively. D1-4 are dummy variables showing whether that brand&amp;nbsp; is displayed in store, f1-4 are dummy variables that show whether brand 1-4 are featured in the store ads)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used this code to prepare the data and the outcome is in the attached file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mergemnl(keep=pid decision mode c1 c2 c3 p d f);&lt;BR /&gt;set final1;&lt;BR /&gt;array pvec{4} p1 p2 p3 p4;&lt;BR /&gt;array dvec{4} d1 d2 d3 d4;&lt;BR /&gt;array fvec{4} f1 f2 f3 f4;&amp;nbsp;&lt;BR /&gt;array s1{4}(1 0 0 0);&lt;BR /&gt;array s2{4}(0 1 0 0);&lt;BR /&gt;array s3{4}(0 0 1 0);&lt;/P&gt;
&lt;P&gt;retain pid 0;&lt;BR /&gt;pid + 1;&lt;BR /&gt;do i = 1 to 4;&lt;BR /&gt;mode = i;&lt;BR /&gt;p = pvec{i};&lt;BR /&gt;d = dvec{i};&lt;BR /&gt;f = fvec{i};&lt;BR /&gt;c1 = s1{i};&lt;BR /&gt;c2 = s2{i};&lt;BR /&gt;c3 = s3{i};&lt;BR /&gt;decision = ( brandnum = i );&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I used to run mdc:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc mdc data=mergemnl;&lt;BR /&gt;model decision =c1 c2 c3 p d f /&lt;BR /&gt;type=clogit&lt;BR /&gt;nchoice = 4&lt;BR /&gt;optmethod=qn&lt;BR /&gt;covest=hess;&lt;BR /&gt;id pid;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2019 02:09:12 GMT</pubDate>
    <dc:creator>Linh1</dc:creator>
    <dc:date>2019-04-29T02:09:12Z</dc:date>
    <item>
      <title>How to structure the input data for PROC MDC?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-structure-the-input-data-for-PROC-MDC/m-p/554619#M74682</link>
      <description>&lt;P&gt;I'm preparing my data to run proc MDC but kept receiving the error:&amp;nbsp;&lt;SPAN&gt;"ERROR: The NCHOICE= option is not allowed when the number of choices for each individual (ID) is not the same." I don't really get what it means. Could you help me figure out what's wrong?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original dataset (final1) is a panel transaction data that has the columns: customerid, week, brand, p1 p2 p3 p4 d1 d2 d3 d4 f1 f2 f3 f4.&lt;/P&gt;
&lt;P&gt;(P1-P4 are average price of brand 1-4 in that week, respectively. D1-4 are dummy variables showing whether that brand&amp;nbsp; is displayed in store, f1-4 are dummy variables that show whether brand 1-4 are featured in the store ads)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used this code to prepare the data and the outcome is in the attached file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mergemnl(keep=pid decision mode c1 c2 c3 p d f);&lt;BR /&gt;set final1;&lt;BR /&gt;array pvec{4} p1 p2 p3 p4;&lt;BR /&gt;array dvec{4} d1 d2 d3 d4;&lt;BR /&gt;array fvec{4} f1 f2 f3 f4;&amp;nbsp;&lt;BR /&gt;array s1{4}(1 0 0 0);&lt;BR /&gt;array s2{4}(0 1 0 0);&lt;BR /&gt;array s3{4}(0 0 1 0);&lt;/P&gt;
&lt;P&gt;retain pid 0;&lt;BR /&gt;pid + 1;&lt;BR /&gt;do i = 1 to 4;&lt;BR /&gt;mode = i;&lt;BR /&gt;p = pvec{i};&lt;BR /&gt;d = dvec{i};&lt;BR /&gt;f = fvec{i};&lt;BR /&gt;c1 = s1{i};&lt;BR /&gt;c2 = s2{i};&lt;BR /&gt;c3 = s3{i};&lt;BR /&gt;decision = ( brandnum = i );&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I used to run mdc:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc mdc data=mergemnl;&lt;BR /&gt;model decision =c1 c2 c3 p d f /&lt;BR /&gt;type=clogit&lt;BR /&gt;nchoice = 4&lt;BR /&gt;optmethod=qn&lt;BR /&gt;covest=hess;&lt;BR /&gt;id pid;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 02:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-structure-the-input-data-for-PROC-MDC/m-p/554619#M74682</guid>
      <dc:creator>Linh1</dc:creator>
      <dc:date>2019-04-29T02:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to structure the input data for PROC MDC?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-structure-the-input-data-for-PROC-MDC/m-p/554638#M74683</link>
      <description>&lt;P&gt;Message was moved to procedure thread and title shortened.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 02:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-structure-the-input-data-for-PROC-MDC/m-p/554638#M74683</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-04-29T02:10:35Z</dc:date>
    </item>
  </channel>
</rss>

