<?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: an efficient way to add dummy variables in PROC MODEL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116700#M32181</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do you want to try the code below?&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;length list $ 2000;&lt;BR /&gt;retain list;&lt;BR /&gt;&amp;nbsp; do i=1 to 20; &lt;BR /&gt;&amp;nbsp; list=catx('+',list,cats(cats('a',i+2),'*',cats('col',i)));&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;call symputx('list',list);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;list;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;y1=a0+a1*x1+a2*x2+&amp;amp;list.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2012 17:34:32 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2012-07-24T17:34:32Z</dc:date>
    <item>
      <title>an efficient way to add dummy variables in PROC MODEL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116699#M32180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;Hi Everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: inherit;"&gt;I want to use fixed effects to estimate a model, using GMM estimation and the model consists of simultaneous equations. I am using PROC MODEL (proc panel does not support simultaneous equations) and using dummy variable to control the fixed effects.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;Since there are 100+ dummy variables, does that mean I need to create 100+ parameters corresponding to these 100+ dummy variables? Is there any efficient way to add the dummy variables when using PROC MODEL? Generate 100+ parameters for the dummy variable is too much burden...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;Suppose the simultaneous eq. model is like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;y1=a0+a1*x1+a2*x2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;y2=b0+b1*x1+b2*x3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;After adding the dummy variables, the model will be like this??!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: arial, sans-serif; color: #000066;"&gt;y1=a0+a1*x1+a2*x2+a3*col1+a4*col2+a5*col3+....a102*col100+...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: inherit; color: #000066;"&gt;&lt;SPAN style="font-style: inherit; font-family: arial, sans-serif;"&gt;y2=&lt;/SPAN&gt;b0+b1*x1+b2*x3+b3*col1+b4*col2+b5*col3+....b102*col100+...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: inherit; color: #000066;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;Is there any easy way to write the dummy variables and the corresponding parameters,&amp;nbsp; like col1-c100 in PROC MODEL?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;Thanks very much. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; color: #000066;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, sans-serif; color: #222222; text-align: -webkit-auto; background-color: #ffffff;"&gt;&lt;SPAN style="color: #000066; font-size: 12pt; font-style: inherit; font-family: inherit;"&gt;Alice.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 16:30:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116699#M32180</guid>
      <dc:creator>alicewong</dc:creator>
      <dc:date>2012-07-24T16:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: an efficient way to add dummy variables in PROC MODEL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116700#M32181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do you want to try the code below?&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;length list $ 2000;&lt;BR /&gt;retain list;&lt;BR /&gt;&amp;nbsp; do i=1 to 20; &lt;BR /&gt;&amp;nbsp; list=catx('+',list,cats(cats('a',i+2),'*',cats('col',i)));&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;call symputx('list',list);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;list;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;y1=a0+a1*x1+a2*x2+&amp;amp;list.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 17:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116700#M32181</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-07-24T17:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: an efficient way to add dummy variables in PROC MODEL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116701#M32182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can reference this paper that has a macro explaining how to create the macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.wuss.org/proceedings11/Papers_Sun_B_74902.pdf" title="http://www.wuss.org/proceedings11/Papers_Sun_B_74902.pdf"&gt;http://www.wuss.org/proceedings11/Papers_Sun_B_74902.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not 100% sure but think LinLin's code will create the code, but won't create the dummy variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 18:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116701#M32182</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-07-24T18:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: an efficient way to add dummy variables in PROC MODEL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116702#M32183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you have SAS/STAT, use PROC GLMMOD, to output parameter&amp;nbsp; and associated column numbers and use SQL to create your statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc glmmod data=sashelp.cars outparm=parm;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class type;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model MPG_CITY=TYPE;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select cats('a', _colnum_, '*col', _colnum_) into :stmt separated by '+'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; parm&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%put &amp;amp;stmt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 20:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/an-efficient-way-to-add-dummy-variables-in-PROC-MODEL/m-p/116702#M32183</guid>
      <dc:creator>oloolo</dc:creator>
      <dc:date>2012-10-25T20:12:55Z</dc:date>
    </item>
  </channel>
</rss>

