<?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: How to write estimate statements for continuous by continuous interactions in proc genmod? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195737#M10455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might have to sneak up on this a bit.&amp;nbsp; I always have trouble with the L matrix entries needed to do this, so I would try to get a start on it by using the LSMEANS statement with the /e option.&amp;nbsp; To make this work somewhat better, rearrange the MODEL statement so that the class variables come first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lsmeans sex/e;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should give a matrix that includes values for the continuous variables, including the interaction, with these values set at the mean.&amp;nbsp; However, these may be the coefficients so test it with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;estimate &amp;lt;all class variable stuff&amp;gt; &amp;lt;continuous values&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and see if it gives back the LSmeans.&amp;nbsp; Once you have this down, it then becomes a matter of calculating the estimate at two points and creating an L matrix as the difference between the two.&amp;nbsp; I don't know if it sounds harder to do than it actually is, but &lt;A __default_attr="178104" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; has given several examples in the past month on how to do this (yes for categorical variables, but the principle applies to continuous as well).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jul 2015 18:13:43 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2015-07-06T18:13:43Z</dc:date>
    <item>
      <title>How to write estimate statements for continuous by continuous interactions in proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195736#M10454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am studying the association between a continuous exposure variable and a dichotomous outcome variable using poisson regression with robust error variance.&amp;nbsp; (I chose to use poisson regression here as opposed to logistic regression because the outcome prevalence in my sample is quite high - greater than 20%.)&amp;nbsp; In conducting my analyses, I found a significant interaction between the continuous exposure and a continuous modifier variable.&amp;nbsp; I would like to calculate the risk ratio when both the exposure and the modifier are increased by 10 units.&amp;nbsp; I have found examples of how to do this with estimate statements when working with interactions among categorical variables, but I have been unable to find similar examples for continuous by continuous interactions.&amp;nbsp; What is the appropriate SAS syntax for this scenario?&amp;nbsp; The code I am using is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc genmod data=test1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class sex race subject/ ref=first param=ref;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; model outcome = exposure*modifier exposure modifier age sex race / dist=poisson link=log type3 wald;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; repeated subject=subject / type=unstr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; estimate ???;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Jul 2015 18:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195736#M10454</guid>
      <dc:creator>jmdecu</dc:creator>
      <dc:date>2015-07-04T18:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to write estimate statements for continuous by continuous interactions in proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195737#M10455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might have to sneak up on this a bit.&amp;nbsp; I always have trouble with the L matrix entries needed to do this, so I would try to get a start on it by using the LSMEANS statement with the /e option.&amp;nbsp; To make this work somewhat better, rearrange the MODEL statement so that the class variables come first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lsmeans sex/e;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should give a matrix that includes values for the continuous variables, including the interaction, with these values set at the mean.&amp;nbsp; However, these may be the coefficients so test it with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;estimate &amp;lt;all class variable stuff&amp;gt; &amp;lt;continuous values&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and see if it gives back the LSmeans.&amp;nbsp; Once you have this down, it then becomes a matter of calculating the estimate at two points and creating an L matrix as the difference between the two.&amp;nbsp; I don't know if it sounds harder to do than it actually is, but &lt;A __default_attr="178104" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; has given several examples in the past month on how to do this (yes for categorical variables, but the principle applies to continuous as well).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 18:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195737#M10455</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-07-06T18:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to write estimate statements for continuous by continuous interactions in proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195738#M10456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For continuous predictors, one puts the values of the predictors in the estimate statement. That is, when one lists x1, for example, the procedure substitutes the estimated parameter for x1; so, you give the x1 value. Here is an example program for what I think you want (using x1 and x2 for continuous predictors and cat for a categorical predictor (class variable). The model is for&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ln(mu) = intercept + b1*x1 + b2*x2 + b3*x1*x2&lt;/P&gt;&lt;P&gt;More comments after the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc genmod data=a;&lt;/P&gt;&lt;P&gt;class cat;&lt;/P&gt;&lt;P&gt;model y = x1 x2 x1*x2 cat / type3 dist=poisson ;&lt;/P&gt;&lt;P&gt;estimate '0 0'&amp;nbsp;&amp;nbsp; int 1&amp;nbsp; x1 0&amp;nbsp; x2 0&amp;nbsp; x1*x2 0;&lt;/P&gt;&lt;P&gt;estimate '10 10' int 1&amp;nbsp; x1 10 x2 10 x1*x2 100;&lt;/P&gt;&lt;P&gt;estimate '10-0, 10-0'&amp;nbsp;&amp;nbsp; x1 10 x2 10 x1*x2 100 ;&lt;/P&gt;&lt;P&gt;/* Substract one from the other to get change in Y with a change in 10 (for x1 and x2) */&lt;/P&gt;&lt;P&gt;estimate '6 10'&amp;nbsp; int 1&amp;nbsp; x1 6&amp;nbsp; x2 10 x1*x2 60 ;&lt;/P&gt;&lt;P&gt;estimate '16 20' int 1&amp;nbsp; x1 16 x2 20 x1*x2 320 ;&lt;/P&gt;&lt;P&gt;estimate '16-6, 20-10'&amp;nbsp; x1 10 x2 10 x1*x2 260 ;&lt;/P&gt;&lt;P&gt;/* Because of interaction, difference depends on actual levels of x1,x2 */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I give examples of getting the expected values for (x1,x2) = (0,0), and (10,10); that is an increase in 10 for both predictors. One puts in the x values, and the procedure does the multiplication. Note that for the x1*x2 term, one puts in 100 (10*10) for the second one. Subtracting the first two estimate statements gives the third one, the one I think you want (difference for a change in 10 for x1 and x2). You just subtract each of the relevant terms. You don't need the first two. I put them in to show you where the third one came from. I then did this for (x1,x2) = (6,10) and (16,20). Last estimate is the one you would want. You just subtract the relevant terms (320-60, and so on). With categorical variables in the model, one is getting expected values averaged over all the levels of the these factors. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 20:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195738#M10456</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2015-07-06T20:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to write estimate statements for continuous by continuous interactions in proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195739#M10457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is exactly what I was looking for.&amp;nbsp; Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 20:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-write-estimate-statements-for-continuous-by-continuous/m-p/195739#M10457</guid>
      <dc:creator>jmdecu</dc:creator>
      <dc:date>2015-07-06T20:55:40Z</dc:date>
    </item>
  </channel>
</rss>

