<?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: ESTIMATE statement for interaction effect of 2 categorical variables with many categories in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920734#M45735</link>
    <description>&lt;P&gt;I cannot edit my post so writing again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above ESTIMATE statement is not correct and I have missed adding the x2&amp;nbsp; part in it.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Mar 2024 14:01:19 GMT</pubDate>
    <dc:creator>PamG</dc:creator>
    <dc:date>2024-03-18T14:01:19Z</dc:date>
    <item>
      <title>ESTIMATE statement for interaction effect of 2 categorical variables with many categories</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920731#M45734</link>
      <description>&lt;P&gt;I have a modified (robust) Poisson model and I need to estimate the effect sizes for each combination of two multi-category variables, x1 and x2.&amp;nbsp;&amp;nbsp;X1 had 28 levels and X2 has 3 levels. Is there an easier, concise way to write the ESTIMATE statement using PROC PLM and some kind of macro? I can keep&amp;nbsp;writing the ESTIMATE statements as below but we will also be collapsing the bins and it is going to be tedious to keep writing it this way.&amp;nbsp; (I am sorry but I do not have sample data to share).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC GENMOD;
CLASS x1(ref='0' param=ref) x2 (ref='1' param=ref);
MODEL flag=x1  x2 x1*x2/ DIST=POISSON LINK=LOG;
REPEATED SUBJECTID=id/type=unstr;

ESTIMATE 'X1=1 x2=1' Intercept 1 x1 1
x2
0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
x1*x2
0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0;
ESTIMATE 'x1=2 x2=1' Intercept 1 x1 1
x1*x2
1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0;
ESTIMATE 'x1=3 x2=1' Intercept 1 x1 1
x1*x2
0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0;
ESTIMATE 'x1=4 x2=1' Intercept 1 x1 1
x1*x2
0	0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0;
ESTIMATE 'x1=5 x2=1' Intercept 1 x1 1
x1*x2
0	0	0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0;
..more statements;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Mar 2024 13:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920731#M45734</guid>
      <dc:creator>PamG</dc:creator>
      <dc:date>2024-03-18T13:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: ESTIMATE statement for interaction effect of 2 categorical variables with many categories</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920734#M45735</link>
      <description>&lt;P&gt;I cannot edit my post so writing again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above ESTIMATE statement is not correct and I have missed adding the x2&amp;nbsp; part in it.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 14:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920734#M45735</guid>
      <dc:creator>PamG</dc:creator>
      <dc:date>2024-03-18T14:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: ESTIMATE statement for interaction effect of 2 categorical variables with many categories</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920736#M45736</link>
      <description>&lt;P&gt;As I've said here often, you should avoid the difficulty in coding ESTIMATE statements when simpler statements can be used such as the LSMEANS and LSMESTIMATE statements. That is the case here. The LSMEANS statement can give you estimates of all of the X1, X2 combinations:&amp;nbsp; &amp;nbsp;lsmeans x1*x2 / ilink cl;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the discussion in the "Zou's modified Poisson approach" section of &lt;A href="https://support.sas.com/kb/23/003.html" target="_self"&gt;this note&lt;/A&gt; that shows an example of a similar analysis to estimate risk ratios (relative risks) comparing levels.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 14:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920736#M45736</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-03-18T14:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: ESTIMATE statement for interaction effect of 2 categorical variables with many categories</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920737#M45737</link>
      <description>&lt;P&gt;I am actually using PROC LOGISTIC.&amp;nbsp; Using LSMEANS gives an error saying that GLM parametrization is needed.&amp;nbsp; I will need to use the same with STRATA statement with PROC LOGISTIC as well.&amp;nbsp; Is there a way to simplify the writing of these multiple ESTIMATE /CONTRAST statements?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 14:36:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920737#M45737</guid>
      <dc:creator>PamG</dc:creator>
      <dc:date>2024-03-18T14:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: ESTIMATE statement for interaction effect of 2 categorical variables with many categories</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920739#M45738</link>
      <description>&lt;P&gt;In the CLASS statement in PROC LOGISTIC, choose the global option PARAM=GLM.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_syntax05.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_syntax05.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 14:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920739#M45738</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-18T14:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: ESTIMATE statement for interaction effect of 2 categorical variables with many categories</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920792#M45741</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/442038"&gt;@PamG&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am actually using PROC LOGISTIC.&amp;nbsp; Using LSMEANS gives an error saying that GLM parametrization is needed.&amp;nbsp; I will need to use the same with STRATA statement with PROC LOGISTIC as well.&amp;nbsp; Is there a way to simplify the writing of these multiple ESTIMATE /CONTRAST statements?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Post Code and Log related to your actual question. Posting code from Proc Genmod and then asking for a solution to Proc Logistic is like putting diesel fuel into a gas engine (or electric ) vehicle.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":astonished_face:"&gt;😲&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 17:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/ESTIMATE-statement-for-interaction-effect-of-2-categorical/m-p/920792#M45741</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-18T17:19:38Z</dc:date>
    </item>
  </channel>
</rss>

