<?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: Difference between * and | in coding interactions between continuous and categorical variables. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491667#M129003</link>
    <description>&lt;P&gt;What does the&amp;nbsp;@2 do?&lt;/P&gt;</description>
    <pubDate>Fri, 31 Aug 2018 15:21:40 GMT</pubDate>
    <dc:creator>lalaktgrau</dc:creator>
    <dc:date>2018-08-31T15:21:40Z</dc:date>
    <item>
      <title>Difference between * and | in coding interactions between continuous and categorical variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491655#M128994</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to code interactions between genotype and a metabolite. There are 4 genotypes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I code the model as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CLASS gene;&lt;/P&gt;&lt;P&gt;MODEL outcome=gene metabolite gene*metabolite;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get a different output than if I code the model as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CLASS gen;&lt;/P&gt;&lt;P&gt;MODEL outcome=gene metabolite gene|metabolite;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use the | I am able to see that one of my genotypes is a reference group versus with the *, I get estimates for all 4 genotypes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the difference between * and | and which model would be correct????&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491655#M128994</guid>
      <dc:creator>lalaktgrau</dc:creator>
      <dc:date>2018-08-31T15:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between * and | in coding interactions between continuous and categorical variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491658#M128995</link>
      <description>&lt;P&gt;The second model uses variables GEN and GENE. Was that intentional?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To answer your question, the notation A | X (where A is a CLASS&amp;nbsp;variable) is equivalent to the three terms&lt;/P&gt;
&lt;P&gt;A X&amp;nbsp;A*X&lt;/P&gt;
&lt;P&gt;That is, A|X includes main effects and the interaction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you repeat a main effect, it will be dropped. Consequently, the following models are equivalent:&lt;/P&gt;
&lt;P&gt;MODEL outcome=gene | metabolite;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;MODEL outcome=gene metabolite gene*metabolite;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;MODEL outcome=gene metabolite gene | metabolite;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Of these, the first is simplest. The third is confusing and should be avoided.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491658#M128995</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-08-31T15:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between * and | in coding interactions between continuous and categorical variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491659#M128996</link>
      <description>&lt;P&gt;Do you have a small typo in your second CLASS statement? Gen&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;E&lt;/STRONG&gt;&lt;/FONT&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/161934"&gt;@lalaktgrau&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to code interactions between genotype and a metabolite. There are 4 genotypes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I code the model as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CLASS gene;&lt;/P&gt;
&lt;P&gt;MODEL outcome=gene metabolite gene*metabolite;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get a different output than if I code the model as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CLASS gen;&lt;/P&gt;
&lt;P&gt;MODEL outcome=gen metabolite gene|metabolite;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use the | I am able to see that one of my genotypes is a reference group versus with the *, I get estimates for all 4 genotypes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the difference between * and | and which model would be correct????&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491659#M128996</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-31T15:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between * and | in coding interactions between continuous and categorical variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491660#M128997</link>
      <description>&lt;P&gt;In general The | does a factorial model in short hand: A|B is the equivalent of : A B A*B&lt;/P&gt;
&lt;P&gt;model Y = A|B|C; is the same as&lt;/P&gt;
&lt;P&gt;model Y = A B C&amp;nbsp;&amp;nbsp; A*B A*C B*C&amp;nbsp;&amp;nbsp; A*B*C;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you did not include which actual proc you are running or any other options specific output differences are hard to determine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thought your example appears to have GENE spelled as GEN. If there are actually two different variables in your set GENE and GEN then that likely accounts for most of the difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491660#M128997</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-31T15:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between * and | in coding interactions between continuous and categorical variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491662#M128998</link>
      <description>&lt;P&gt;Here's an example of specifying two models that are the same, with the same results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title 'Method1';
proc glm data=sashelp.heart;
class sex;
model ageatstart = height weight sex weight*sex;
run;
quit;
title 'Method2';
proc glm data=sashelp.heart;
class sex;
model ageatstart =height weight|sex @2;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:14:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491662#M128998</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-31T15:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between * and | in coding interactions between continuous and categorical variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491664#M129000</link>
      <description>&lt;P&gt;I corrected the Gene typo. That wasn't an error in my actual code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491664#M129000</guid>
      <dc:creator>lalaktgrau</dc:creator>
      <dc:date>2018-08-31T15:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between * and | in coding interactions between continuous and categorical variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491667#M129003</link>
      <description>&lt;P&gt;What does the&amp;nbsp;@2 do?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491667#M129003</guid>
      <dc:creator>lalaktgrau</dc:creator>
      <dc:date>2018-08-31T15:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between * and | in coding interactions between continuous and categorical variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491669#M129004</link>
      <description>&lt;P&gt;@Specifies a 2 way interaction. If you had listed three variables separated by | with&amp;nbsp;@2 it would do all two way interactions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;model ageAtStart = weight | height | diastolic @2; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Should be the same as (assuming I wrote it out correctly).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;model ageAtStart = weight height diastolic weight*height weight*diastolic height*diastolic;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/161934"&gt;@lalaktgrau&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10214"&gt;@What&lt;/a&gt; does the&amp;nbsp;@2 do?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-and-in-coding-interactions-between-continuous/m-p/491669#M129004</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-31T15:24:12Z</dc:date>
    </item>
  </channel>
</rss>

