<?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 interaction effect with splines in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179808#M9350</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the weekend to try out and double check your suggestion. Everything works perfectly. Many thanks! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Sophie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jan 2015 11:10:27 GMT</pubDate>
    <dc:creator>SophieSw</dc:creator>
    <dc:date>2015-01-19T11:10:27Z</dc:date>
    <item>
      <title>Estimate interaction effect with splines</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179802#M9344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a model with a third order interaction with splines:&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;class trt sex;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;effect spl = spline(age);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;model aval = trt|sex|spl &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for a way to get an estimate for the trt*sex interaction effect at specific values for age. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to get an estimate for the effect of either trt or sex at a specific value for age with for instance:&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;estimate 'Diff trt at sex 1 x= 20' trtn [1,1] [-1,2] trtn*sex [1,1 1] [-1,2 1] trt*spl [1,1 20] [-1,2 20]&amp;nbsp; trt*sex*spl[1,1 1 20] [-1,2 1 20] /e;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;but fail at producing an estimate for the interaction effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR Sophie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 08:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179802#M9344</guid>
      <dc:creator>SophieSw</dc:creator>
      <dc:date>2015-01-13T08:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate interaction effect with splines</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179803#M9345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried using an LSMESTIMATE statement with the AT option?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For two treatments and two sexes, it would look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lsmestimate trt*sex*spl 'Trt diff for sex=1 at age = 20' 1 0 -1 0/at age=20;&lt;/P&gt;&lt;P&gt;and if you have multiple comparisons, more like;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lsmestimate trt*sex*spl 'Trt diff for sex=1 at age = 20' 1 0 -1 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Trt diff for sex=2 at age = 20' 0 1 0 -1/at age=20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, nonpositional syntax shuch as you have can also be used, but the advantage is in comparing the lsmeans at a given level.&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>Tue, 13 Jan 2015 18:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179803#M9345</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-01-13T18:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate interaction effect with splines</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179804#M9346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your responds. Actually I had tried something like this but all my attempts gave the message &lt;/P&gt;&lt;P&gt;ERROR: The constructed effect spl*trtn*SEXN is not a valid LSMESTIMATE effect.&lt;/P&gt;&lt;P&gt;I have two treatments and two sexes so I just tried exactly the code you provided and got the same error message again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Sophie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 07:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179804#M9346</guid>
      <dc:creator>SophieSw</dc:creator>
      <dc:date>2015-01-14T07:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate interaction effect with splines</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179805#M9347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lsmestimate trt*sex 'Trt diff for sex=1 at age = 20' 1 0 -1 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Trt diff for sex=2 at age = 20' 0 1 0 -1/at age=20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears that you cannot use the constructed effect (or its interactions) in the LSMEANS or LSMESTIMATE statement.&amp;nbsp; But you might be able to look at the trt*sex interaction, and see what the effect is at various ages by using the AT option.&amp;nbsp; I am trying to generalize from the documentation--Details: GLIMMIX Procedure&amp;gt; Parameterization of Generalized Linear Mixed Models&amp;gt; Notes on the EFFECT Statement.&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>Wed, 14 Jan 2015 15:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179805#M9347</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-01-14T15:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate interaction effect with splines</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179806#M9348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for trying to help me. But I still have not what I need because my interest is in the estimate and se for the difference in difference. The extent that the “trt diff for sex = 1” is different from the “trt diff for sex=2” at specific ages. I was already able to get an estimate for the effect of either trt or sex at a specific value for age with for instance:&lt;/P&gt;&lt;P&gt;estimate 'Diff trt at sex 1 x= 20' trtn [1,1] [-1,2] trtn*sex [1,1 1] [-1,2 1] trt*spl [1,1 20] [-1,2 20]&amp;nbsp; trt*sex*spl[1,1 1 20] [-1,2 1 20] /e;&lt;/P&gt;&lt;P&gt;and indeed, your code &lt;/P&gt;&lt;P&gt;lsmestimate trt*sex 'Trt diff for sex=1 at age = 20' 1 0 -1 0;&lt;/P&gt;&lt;P&gt;works as well &lt;/P&gt;&lt;P&gt;(even though this one fails:&lt;/P&gt;&lt;P&gt; lsmestimate trt*sex 'Trt diff for sex=1 at age = 20' 1 0 -1 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Trt diff for sex=2 at age = 20' 0 1 0 -1/at age=20;)&lt;/P&gt;&lt;P&gt;but what I need is the contrast of 'Trt diff for sex=1 at age = 20' versus 'Trt diff for sex=2 at age = 20’.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Sophie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 08:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179806#M9348</guid>
      <dc:creator>SophieSw</dc:creator>
      <dc:date>2015-01-15T08:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate interaction effect with splines</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179807#M9349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Difference of the differences would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lsmestimate trt*sex "Differences between sexes for treatment differences at age = 20' 1 -1 -1 1/at age=20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this is the first line minus the second line of the previous lsmestimate statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&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>Thu, 15 Jan 2015 18:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179807#M9349</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-01-15T18:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Estimate interaction effect with splines</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179808#M9350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the weekend to try out and double check your suggestion. Everything works perfectly. Many thanks! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Sophie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 11:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimate-interaction-effect-with-splines/m-p/179808#M9350</guid>
      <dc:creator>SophieSw</dc:creator>
      <dc:date>2015-01-19T11:10:27Z</dc:date>
    </item>
  </channel>
</rss>

