<?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: Proc GLM interaction term with only specific levels in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-GLM-interaction-term-with-only-specific-levels/m-p/419192#M67790</link>
    <description>&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Many procedures output coded variables.&amp;nbsp; You can then process the output data set to drop terms.&amp;nbsp; Personally, I like transreg because 1) I wrote it, 2) it has nice names and labels for terms, and 3) it outputs a macro variable with all of the terms in the model.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2017 14:51:25 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2017-12-07T14:51:25Z</dc:date>
    <item>
      <title>Proc GLM interaction term with only specific levels</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-GLM-interaction-term-with-only-specific-levels/m-p/419178#M67787</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to run a linear regression with two categorical variables with 3 plus levels and one continuous variable on a continuous response variable, and is Thus using proc GLM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Continuous variables:&lt;/P&gt;&lt;P&gt;- Price&lt;/P&gt;&lt;P&gt;- rating&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Categorical varibles:&lt;/P&gt;&lt;P&gt;- product=(agriculture, rental, industry)&lt;/P&gt;&lt;P&gt;- customer_segment=(key, focus, corporate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to run the following regression, and if so how do you specify the interaction terms:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;GLM&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=model1_data2 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;alpha&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0.75&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;product customer_segment;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;model&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; price=rating&amp;nbsp;product&amp;nbsp;customer_segment industry*rating industry*key&amp;nbsp;/ &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;solution&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=model1_v2_out &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;r&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=res &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;p&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=benchmark2 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;lcl&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Q25 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ucl&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Q75;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; model1_data2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; model1_v2_out;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my issue is that i don't know how to specify interaction terms only involving specific levels of the categorical variable.&lt;/P&gt;&lt;P&gt;Hopes this makes sence.&lt;/P&gt;&lt;P&gt;I'm using SAS 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best, Andreas&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 14:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-GLM-interaction-term-with-only-specific-levels/m-p/419178#M67787</guid>
      <dc:creator>Dedes93</dc:creator>
      <dc:date>2017-12-07T14:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc GLM interaction term with only specific levels</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-GLM-interaction-term-with-only-specific-levels/m-p/419192#M67790</link>
      <description>&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Many procedures output coded variables.&amp;nbsp; You can then process the output data set to drop terms.&amp;nbsp; Personally, I like transreg because 1) I wrote it, 2) it has nice names and labels for terms, and 3) it outputs a macro variable with all of the terms in the model.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 14:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-GLM-interaction-term-with-only-specific-levels/m-p/419192#M67790</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-12-07T14:51:25Z</dc:date>
    </item>
  </channel>
</rss>

