<?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 multiple Interaction in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626613#M30137</link>
    <description>&lt;P&gt;I have generated dummy variables for every year as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data work;
     set work;

     array yrdummy(*) d_&amp;amp;startyr - d_&amp;amp;endyr;
     do i=1 to dim(yrdummy);
     if fyear = i+&amp;amp;startyr then yrdummy{i} = 1;
     else yrdummy{i} = 0;
     end;
     drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now I want to interact every d_'year' with a variable. For example, I have a dummy called 'd_group'. I want to interact d_group with d_1988 through d_2018 so that I am left with variables called d_group*d_1988 through d_group*d_2018. Is there a loop to make this happen?&lt;/P&gt;</description>
    <pubDate>Sat, 22 Feb 2020 06:55:42 GMT</pubDate>
    <dc:creator>kelSAS</dc:creator>
    <dc:date>2020-02-22T06:55:42Z</dc:date>
    <item>
      <title>multiple Interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626613#M30137</link>
      <description>&lt;P&gt;I have generated dummy variables for every year as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data work;
     set work;

     array yrdummy(*) d_&amp;amp;startyr - d_&amp;amp;endyr;
     do i=1 to dim(yrdummy);
     if fyear = i+&amp;amp;startyr then yrdummy{i} = 1;
     else yrdummy{i} = 0;
     end;
     drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now I want to interact every d_'year' with a variable. For example, I have a dummy called 'd_group'. I want to interact d_group with d_1988 through d_2018 so that I am left with variables called d_group*d_1988 through d_group*d_2018. Is there a loop to make this happen?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 06:55:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626613#M30137</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2020-02-22T06:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: multiple Interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626625#M30143</link>
      <description>&lt;P&gt;Yes there can be a loop to do this, but why do you need these dummy variables? Many SAS procedures create dummy variables internally, so you don't have to create them yourself.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 12:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626625#M30143</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-22T12:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: multiple Interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626650#M30148</link>
      <description>&lt;P&gt;I want to compare two coefficients of the same model with two different sample. To do so, I need to interact all variables in the model with the dummy variable that divides total observations into the two different samples.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to display tables that have the coefficients on all variables with one sample and the same with the other sample, and the third column would show the difference between the two samples. Because the fixed effects are going to change the coefficients if I run the two samples separately, I need to have all variables interacted with the indicator variable and include in the model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you tell me how to create the loop, please?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 18:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626650#M30148</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2020-02-22T18:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: multiple Interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626652#M30149</link>
      <description>&lt;P&gt;Modeling procedures in SAS (such as PROC GLM and many others) create the interactions for you. So all you have to do is specify the desired model (with main effects and interactions) and you don't have to create dummy variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code fits a model with all two-way interactions of X1 X2 X3 X4 X5, no dummy variables needed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=have;
    class x1-x5;
    model y=x1|x2|x3|x4|x5@2;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Feb 2020 19:48:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626652#M30149</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-22T19:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: multiple Interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626872#M30153</link>
      <description>&lt;P&gt;You might be trying to do what is described in &lt;A href="http://support.sas.com/kb/24177" target="_self"&gt;this note&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 14:26:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/626872#M30153</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2020-02-24T14:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: multiple Interaction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/628984#M30206</link>
      <description>Thanks, but this only handles one group. I have about 300 groups.</description>
      <pubDate>Tue, 03 Mar 2020 00:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multiple-Interaction/m-p/628984#M30206</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2020-03-03T00:57:47Z</dc:date>
    </item>
  </channel>
</rss>

