<?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 Using interaction statement in Macro in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548685#M74446</link>
    <description>&lt;P&gt;Please I have my data in excel and I am using macro statements as shown below. I have my macros to analyze YieldB, YieldC and YieldW (which is working fine). Now I will like to see if there is an interaction between each of these yields and other variables that I have in the excel sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance how do I have an interaction statement like YieldB X MeanT and where exactly should it be in the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is below:&lt;/P&gt;&lt;P&gt;proc print;&lt;BR /&gt;proc sort data=C_YieldM;&lt;BR /&gt;by Trial;&lt;/P&gt;&lt;P&gt;/* Running Factorial Design without Rep effect but with day effect, The Covtest provides the covariance parameter estimates*/&lt;BR /&gt;%macro Rotation (var=);&lt;BR /&gt;proc mixed data=C_YieldM;&lt;BR /&gt;*By Year;&lt;BR /&gt;class Rep Trial T_System;&lt;BR /&gt;model &amp;amp;var=T_System;&lt;BR /&gt;random Rep(Trial) Trial Trial*T_System/solution;&lt;BR /&gt;repeated Trial/subject=rep*T_System type=ar(1) RCORR;&lt;BR /&gt;Lsmeans T_System/diff=all;&lt;BR /&gt;&lt;BR /&gt;/* Contrasts statement for the management practice */&lt;BR /&gt;estimate 'IRR_RF' T_System 1 -1;&lt;BR /&gt;ods output diffs=table;&lt;BR /&gt;ods output lsmeans=Mylsmeans;&lt;BR /&gt;Store Mylsmeans;&lt;/P&gt;&lt;P&gt;data calc_lsd;&lt;BR /&gt;set table;&lt;BR /&gt;lsd=stderr*tinv(1 -(0.05/2), df);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=calc_lsd;&lt;BR /&gt;*var lsd estimate stderr df;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc plm restore=Mylsmeans;&lt;BR /&gt;lsmeans T_System/pdiff adjust=tukey lines alpha=0.05;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%mend Rotation;&lt;/P&gt;&lt;P&gt;%Rotation (var=YieldB);&lt;BR /&gt;%Rotation (var=YieldC);&lt;BR /&gt;%Rotation (var=YieldW);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2019 04:52:17 GMT</pubDate>
    <dc:creator>Olanike</dc:creator>
    <dc:date>2019-04-05T04:52:17Z</dc:date>
    <item>
      <title>Using interaction statement in Macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548685#M74446</link>
      <description>&lt;P&gt;Please I have my data in excel and I am using macro statements as shown below. I have my macros to analyze YieldB, YieldC and YieldW (which is working fine). Now I will like to see if there is an interaction between each of these yields and other variables that I have in the excel sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance how do I have an interaction statement like YieldB X MeanT and where exactly should it be in the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is below:&lt;/P&gt;&lt;P&gt;proc print;&lt;BR /&gt;proc sort data=C_YieldM;&lt;BR /&gt;by Trial;&lt;/P&gt;&lt;P&gt;/* Running Factorial Design without Rep effect but with day effect, The Covtest provides the covariance parameter estimates*/&lt;BR /&gt;%macro Rotation (var=);&lt;BR /&gt;proc mixed data=C_YieldM;&lt;BR /&gt;*By Year;&lt;BR /&gt;class Rep Trial T_System;&lt;BR /&gt;model &amp;amp;var=T_System;&lt;BR /&gt;random Rep(Trial) Trial Trial*T_System/solution;&lt;BR /&gt;repeated Trial/subject=rep*T_System type=ar(1) RCORR;&lt;BR /&gt;Lsmeans T_System/diff=all;&lt;BR /&gt;&lt;BR /&gt;/* Contrasts statement for the management practice */&lt;BR /&gt;estimate 'IRR_RF' T_System 1 -1;&lt;BR /&gt;ods output diffs=table;&lt;BR /&gt;ods output lsmeans=Mylsmeans;&lt;BR /&gt;Store Mylsmeans;&lt;/P&gt;&lt;P&gt;data calc_lsd;&lt;BR /&gt;set table;&lt;BR /&gt;lsd=stderr*tinv(1 -(0.05/2), df);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=calc_lsd;&lt;BR /&gt;*var lsd estimate stderr df;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc plm restore=Mylsmeans;&lt;BR /&gt;lsmeans T_System/pdiff adjust=tukey lines alpha=0.05;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%mend Rotation;&lt;/P&gt;&lt;P&gt;%Rotation (var=YieldB);&lt;BR /&gt;%Rotation (var=YieldC);&lt;BR /&gt;%Rotation (var=YieldW);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 04:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548685#M74446</guid>
      <dc:creator>Olanike</dc:creator>
      <dc:date>2019-04-05T04:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using interaction statement in Macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548686#M74447</link>
      <description>&lt;P&gt;Looks to me like you are using PROC MIXED.&lt;/P&gt;
&lt;P&gt;So look at the manual for PROC MIXED.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you understand what code you want to run THEN you can think about to use a macro to generate that code.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 04:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548686#M74447</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-05T04:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using interaction statement in Macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548783#M74451</link>
      <description>&lt;P&gt;Thanks Tom. I can do the interaction if I used card input, but I have been using macro (with my data in excel) but where to fit in my interaction statement is my concern. Thanks you&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 14:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548783#M74451</guid>
      <dc:creator>Olanike</dc:creator>
      <dc:date>2019-04-05T14:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using interaction statement in Macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548784#M74452</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/71264"&gt;@Olanike&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks Tom. I can do the interaction if I used card input, but I have been using macro (with my data in excel) but where to fit in my interaction statement is my concern. Thanks you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That makes no sense to me. A CARDS statement is something you would use in a DATA step. An interaction is something you would specify in some statistical proc.&amp;nbsp; How you read the data makes no difference once you already have the dataset and are running a PROC.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 14:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-interaction-statement-in-Macro/m-p/548784#M74452</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-05T14:36:49Z</dc:date>
    </item>
  </channel>
</rss>

