<?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 Genmod contrast statement for zero-inflated poisson model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468137#M24345</link>
    <description>&lt;P&gt;Using Genmod, I am estimating a zero-inflated Poisson model. I want to test a contrast involving covariates that appear only in the Zeromodel statement. There should be no problem doing so since this example appears in the SAS 9.4 documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc Genmod;&lt;/P&gt;&lt;P&gt;class a b;&lt;BR /&gt;model y=a / dist=zip;&lt;BR /&gt;zeromodel b;&lt;BR /&gt;contrast 'Label2' A 1 -1 &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29974"&gt;@Zero&lt;/a&gt; B 1 -1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, there is no overlap in this model between the covariates in the Model statement and those in the Zeromodel statement, and the requested Contrast involves covariates in both those statements. But when I try to do something exactly like the example code above, I get this error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ERROR: Effects used in the CONTRAST statement must have appeared previously in the MODEL statement."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions would be appreciated. I am baffled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="xis-refProc"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Wed, 06 Jun 2018 17:21:01 GMT</pubDate>
    <dc:creator>nwilcox</dc:creator>
    <dc:date>2018-06-06T17:21:01Z</dc:date>
    <item>
      <title>Genmod contrast statement for zero-inflated poisson model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468137#M24345</link>
      <description>&lt;P&gt;Using Genmod, I am estimating a zero-inflated Poisson model. I want to test a contrast involving covariates that appear only in the Zeromodel statement. There should be no problem doing so since this example appears in the SAS 9.4 documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc Genmod;&lt;/P&gt;&lt;P&gt;class a b;&lt;BR /&gt;model y=a / dist=zip;&lt;BR /&gt;zeromodel b;&lt;BR /&gt;contrast 'Label2' A 1 -1 &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29974"&gt;@Zero&lt;/a&gt; B 1 -1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, there is no overlap in this model between the covariates in the Model statement and those in the Zeromodel statement, and the requested Contrast involves covariates in both those statements. But when I try to do something exactly like the example code above, I get this error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ERROR: Effects used in the CONTRAST statement must have appeared previously in the MODEL statement."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions would be appreciated. I am baffled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="xis-refProc"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Jun 2018 17:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468137#M24345</guid>
      <dc:creator>nwilcox</dc:creator>
      <dc:date>2018-06-06T17:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Genmod contrast statement for zero-inflated poisson model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468164#M24347</link>
      <description>&lt;P&gt;In general that code should work.&amp;nbsp; Are there any other messages in the LOG?&amp;nbsp;&amp;nbsp;Without seeing the actual code/log my only guess is that you might have put DIST=POISSON rather than DIST=ZIP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What happens when you run the following?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data insure;&lt;BR /&gt; input n c car$ age;&lt;BR /&gt; ln = log(n);&lt;BR /&gt; datalines;&lt;BR /&gt; 500 42 small 1&lt;BR /&gt; 1200 37 medium 1&lt;BR /&gt; 100 1 large 1&lt;BR /&gt; 400 101 small 2&lt;BR /&gt; 500 73 medium 2&lt;BR /&gt; 300 14 large 2&lt;BR /&gt; ;&lt;BR /&gt;proc genmod data=insure;&lt;BR /&gt; class car age;&lt;BR /&gt; model c = car / dist = zip&lt;BR /&gt; &lt;BR /&gt; offset = ln;&lt;BR /&gt; zeromodel age;&lt;BR /&gt; contrast 'c' car 1 -1 &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29974"&gt;@Zero&lt;/a&gt; age 1 -1;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 18:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468164#M24347</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2018-06-06T18:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Genmod contrast statement for zero-inflated poisson model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468171#M24348</link>
      <description>&lt;P&gt;Also, note that the CONTRAST and ESTIMATE statements estimate the components of the contrast separately for the mean and zero-inflated models. If your goal is ultimately to make mean comparisons, see&lt;A href="http://support.sas.com/kb/44354" target="_self"&gt; this note&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 19:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468171#M24348</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2018-06-06T19:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Genmod contrast statement for zero-inflated poisson model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468356#M24351</link>
      <description>&lt;P&gt;Thanks for your help. I figured out my problem. In my code, the zero model had several separate rows and I had only preceded the first one with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29974"&gt;@Zero&lt;/a&gt;. Preceding every row with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29974"&gt;@Zero&lt;/a&gt; solved the problem. Sorry to bother you guys.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 13:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Genmod-contrast-statement-for-zero-inflated-poisson-model/m-p/468356#M24351</guid>
      <dc:creator>nwilcox</dc:creator>
      <dc:date>2018-06-07T13:22:45Z</dc:date>
    </item>
  </channel>
</rss>

