<?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 main effects in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752993#M36640</link>
    <description>That was a typo re: genmod. And none of my cells are empty. Thank you for the suggestion.</description>
    <pubDate>Thu, 08 Jul 2021 19:51:47 GMT</pubDate>
    <dc:creator>RAGC</dc:creator>
    <dc:date>2021-07-08T19:51:47Z</dc:date>
    <item>
      <title>estimate statement for main effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752984#M36638</link>
      <description>&lt;P&gt;I am trying to determine the interaction and main effects for my proc genmod model. I have two variables: varA has 4 categories and is categorized as 0-3, varB has 3 categories and is categorized as 0-2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using the following code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc gemnod;&lt;/P&gt;&lt;P&gt;class varA&amp;nbsp; (ref='3') varB (ref='0');&lt;/P&gt;&lt;P&gt;model Y = varA|varB;&lt;/P&gt;&lt;P&gt;estimate 'varA main effects of group 0 versus group 3' varA 3 0 0 -3 varA*varB 1 1 1 0 0 0 0 0 0 -1 -1 -1/divisor=3 exp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but keep getting non-est. Can anyone help?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 19:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752984#M36638</guid>
      <dc:creator>RAGC</dc:creator>
      <dc:date>2021-07-08T19:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: estimate statement for main effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752987#M36639</link>
      <description>&lt;P&gt;One cause for "non-est" is that at least one of the cells in your design is empty. Check for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, it is never going to work if you spell the name of the PROC wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 19:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752987#M36639</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-08T19:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: estimate statement for main effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752993#M36640</link>
      <description>That was a typo re: genmod. And none of my cells are empty. Thank you for the suggestion.</description>
      <pubDate>Thu, 08 Jul 2021 19:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752993#M36640</guid>
      <dc:creator>RAGC</dc:creator>
      <dc:date>2021-07-08T19:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: estimate statement for main effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752996#M36641</link>
      <description>&lt;P&gt;Okay, please convince me that there are no empty cells by running PROC FREQ, and show us the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=yourdatasetname;
     tables varA*varB;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Another possible cause for non-est is that you don't have the right coefficients typed in for the ESTIMATE statement. You might want to consider the SLICE command instead of the ESTIMATE command, which avoids this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the future, please do not type SAS code into your reply; do yourself a favor, and do all of us a favor, copy and paste the actual code you are using so we don't get distracted by spelling errors or missing semi-colons or similar.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 20:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/752996#M36641</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-08T20:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: estimate statement for main effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/753001#M36642</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RAGC_0-1625775433414.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61081i4685621E5D7CE876/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RAGC_0-1625775433414.png" alt="RAGC_0-1625775433414.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am not familiar with the slice command. I will look into it. Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 20:18:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/753001#M36642</guid>
      <dc:creator>RAGC</dc:creator>
      <dc:date>2021-07-08T20:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: estimate statement for main effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/753340#M36644</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't checked your estimate statement (yet).&lt;/P&gt;
&lt;P&gt;And I don't know how well you know about correctly specifying estimate and contrast statements (available in many procedures).&lt;/P&gt;
&lt;P&gt;As I have once gathered a lot of blogs on this for a former statistics professor of mine, I thought I would publish the list again here. Maybe you (and others) can profit from it.&lt;/P&gt;
&lt;P&gt;Let us know if you can sort it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The magical ESTIMATE (and CONTRAST) statements&lt;/P&gt;
&lt;P&gt;By Chris Daman on SAS Learning Post April 23, 2012&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2012/04/23/the-magical-estimate-and-contrast-statements/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2012/04/23/the-magical-estimate-and-contrast-statements/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Easy button" for ESTIMATE statements&lt;/P&gt;
&lt;P&gt;By Chris Daman on SAS Learning Post April 25, 2012&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2012/04/25/easy-button-for-estimate-statements/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2012/04/25/easy-button-for-estimate-statements/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ESTIMATE Statements - the final installment&lt;/P&gt;
&lt;P&gt;By Chris Daman on SAS Learning Post May 2, 2012&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2012/05/02/estimate-statements-the-final-installment/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2012/05/02/estimate-statements-the-final-installment/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to write CONTRAST and ESTIMATE statements in SAS regression procedures?&lt;/P&gt;
&lt;P&gt;By Rick Wicklin on The DO Loop June 6, 2016&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/06/06/write-contrast-estimate-statements-sas-regression-procedures.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2016/06/06/write-contrast-estimate-statements-sas-regression-procedures.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usage Note 24447: Examples of writing CONTRAST and ESTIMATE statements&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/24/447.html" target="_blank"&gt;https://support.sas.com/kb/24/447.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usage Note 67024: Using the ESTIMATE or CONTRAST statement or Margins macro to assess continuous variable effects in interactions and splines&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/67/024.html" target="_blank"&gt;67024 - Using the ESTIMATE or CONTRAST statement or Margins macro to assess continuous variable effects in interactions and splines (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 14:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/753340#M36644</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-10T14:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: estimate statement for main effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/753361#M36645</link>
      <description>&lt;P&gt;As I've said many times here and as is strongly reiterated in &lt;A href="http://support.sas.com/kb/24447" target="_self"&gt;this note on the ESTIMATE and CONTRAST statements&lt;/A&gt;, the thing is to always avoid those statements when other statements can be used. The LSMEANS, SLICE, and LSMESTIMATE statements can be used for most purposes and that is certainly the case here. There are several notes in the SAS support &lt;A href="https://support.sas.com/en/knowledge-base.html" target="_self"&gt;knowledgebase&lt;/A&gt; showing examples that use all of these statements to do the same thing in a model involving interactions. The simplest way to do what you want is with a basic LSMEANS statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;lsmeans varA / diff;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That statement will give all pairwise comparisons, so you can just pick out the one(s) you want. Another simple statement that will give the one particular comparison (level 1 - level 4) you show is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;lsmestimate varA 1 0 0 -1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To see the coefficients that you would use in an equivalent ESTIMATE statement, add the E option in the above statement. Note that you could still get non-estimable comparisons with these statements. If so, you might try using the OM= and BYLEVEL options in the above statements. See the descriptions of these statements and options in the Shared Concept and Topics chapter of the SAS/STAT User's Guide.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SLICE statement is not needed for this comparison, but you would use it if you want to, say, compare levels of varA within each level of varB. Again, see the many examples in the knowledgebase.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 18:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/753361#M36645</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-07-10T18:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: estimate statement for main effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/753362#M36646</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt; said:&lt;/P&gt;
&lt;P&gt;As I've said many times here and as is strongly reiterated in &lt;A href="http://support.sas.com/kb/24447" target="_self" rel="nofollow noopener noreferrer"&gt;this note on the ESTIMATE and CONTRAST statements&lt;/A&gt;, the thing is to always avoid those statements when other statements can be used. The LSMEANS, SLICE, and LSMESTIMATE statements can be used for most purposes and that is certainly the case here.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Agreeing completely. And I have bookmarked the link. Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 19:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/estimate-statement-for-main-effects/m-p/753362#M36646</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-10T19:06:13Z</dc:date>
    </item>
  </channel>
</rss>

