<?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: interaction of continuous and categorical variable in contrast/estimate statement in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261935#M13845</link>
    <description>&lt;P&gt;Some days I hate SAS. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I can't say why it's not working without seeing the parameterization (and maybe not even then), but I suspect the cause is there. I can't always get all the estimates I need from a single paramerterization, sometimes&amp;nbsp;multiple passes at the model are&amp;nbsp;needed.&lt;/P&gt;&lt;P&gt;You might try looking at the different parameterizations you get from:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;subgroup*time&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;subgroup subgroup*time&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;subgroup|time&lt;/STRONG&gt;&lt;BR /&gt;to see it that gives you any hints at what is missing.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2016 20:43:39 GMT</pubDate>
    <dc:creator>EastwoodDC</dc:creator>
    <dc:date>2016-04-06T20:43:39Z</dc:date>
    <item>
      <title>interaction of continuous and categorical variable in contrast/estimate statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261825#M13839</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’m working with some longitudinal binomial data in glimmix.&amp;nbsp; &amp;nbsp;I’ve got 3 time points (0, 1, and 2 as values) and I have some subgroups that are of interest (6, to be exact, two of which are race/ethnicity of White and Black).&amp;nbsp; I have treated subgroup as a class variable, time as continuous.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have crafted ESTIMATE statements that provide the estimate for subgroups at each time point (e.g. White at time 0, time 1…Black at time 0, time 1).&amp;nbsp; &amp;nbsp;I’m also trying to estimate the difference between two points (e.g. say, between time 0 and time 1 for White students.&amp;nbsp; I’ve been able estimate differences between time, differences between subgroup (White in position 6, Black in position 1)…but I keep getting Non-Est for my interaction of subgroup*time.&amp;nbsp; I’ve been working from this resource:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glimmix_a0000001457.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glimmix_a0000001457.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below are the estimate statements I have thus far...all but the last one appear to work as I expect.&amp;nbsp; Can someone kindly tell me what I’m missing (I must be in the weeds on this one)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;glimmix&lt;/STRONG&gt; data=cgr_sch method=rspl pconv=&lt;STRONG&gt;.001&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class school_code time_class subgroup;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model cgr_num/cgr_den=time subgroup&amp;nbsp; subgroup*time/link=logit dist=binomial solution ddfm=bw htype=&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; random intercept time/subject=school_code type=un g gcorr;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; estimate 'white at time 0' intercept &lt;STRONG&gt;1&lt;/STRONG&gt; time &lt;STRONG&gt;0&lt;/STRONG&gt; subgroup &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;1&lt;/STRONG&gt; subgroup*time [&lt;STRONG&gt;1&lt;/STRONG&gt;,&lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;6&lt;/STRONG&gt;],&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;'white at time 1' intercept &lt;STRONG&gt;1&lt;/STRONG&gt; time &lt;STRONG&gt;1&lt;/STRONG&gt; subgroup &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;1&lt;/STRONG&gt; subgroup*time [&lt;STRONG&gt;1&lt;/STRONG&gt;,&lt;STRONG&gt;1&lt;/STRONG&gt; &lt;STRONG&gt;6&lt;/STRONG&gt;]/cl exp ilink e;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; estimate 'diff 0 vs 1' time [-&lt;STRONG&gt;1&lt;/STRONG&gt;,&lt;STRONG&gt;0&lt;/STRONG&gt;] [&lt;STRONG&gt;1&lt;/STRONG&gt;,&lt;STRONG&gt;1&lt;/STRONG&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; estimate 'diff white v black' subgroup [-&lt;STRONG&gt;1&lt;/STRONG&gt;,&lt;STRONG&gt;1&lt;/STRONG&gt;] [&lt;STRONG&gt;1&lt;/STRONG&gt;,&lt;STRONG&gt;6&lt;/STRONG&gt;]/e;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; estimate 'diff 0 vs 1-white' subgroup*time [&lt;STRONG&gt;1&lt;/STRONG&gt;,&lt;STRONG&gt;0&lt;/STRONG&gt; &lt;STRONG&gt;6&lt;/STRONG&gt;] [-&lt;STRONG&gt;1&lt;/STRONG&gt;,&lt;STRONG&gt;1&lt;/STRONG&gt; &lt;STRONG&gt;6&lt;/STRONG&gt;]/e;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jason&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 16:35:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261825#M13839</guid>
      <dc:creator>jsberger</dc:creator>
      <dc:date>2016-04-06T16:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: interaction of continuous and categorical variable in contrast/estimate statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261917#M13840</link>
      <description>&lt;P&gt;Try changing your model statement to this:&lt;/P&gt;&lt;PRE&gt;model cgr_num/cgr_den= &lt;STRONG&gt;subgroup*time&lt;/STRONG&gt; /link=logit dist=binomial solution ddfm=bw htype=1;&lt;/PRE&gt;&lt;P&gt;Which may get your last Estimate statement to work, but will break the others.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise you willl need to specify the contrast values for time and subgroup, as well as time*subgroup.&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 19:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261917#M13840</guid>
      <dc:creator>EastwoodDC</dc:creator>
      <dc:date>2016-04-06T19:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: interaction of continuous and categorical variable in contrast/estimate statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261919#M13841</link>
      <description>Hi, thanks for the reply.  I know I can re-parameterize  the model and get the estimates directly.  But I have other models where quadratics may come in to play.  I'm wondering why, based on the hyperlink I included in the post, the way I have it coded won't work.&lt;BR /&gt;&lt;BR /&gt;I have ESTIMATE statements like those that follow that give me the estimates for each time point, but I can't seem to get an estimate of the difference between, say time 0 and time 1 for White students:&lt;BR /&gt;      estimate 'time 0-white' intercept 1 time 0 subgroup 0 0 0 0 0 1 time*subgroup 0 0 0 0 0 0 /cl exp ilink;&lt;BR /&gt;      estimate 'time 1-white' intercept 1 time 1 subgroup 0 0 0 0 0 1 time*subgroup 0 0 0 0 0 1 /cl exp ilink;&lt;BR /&gt;      estimate 'time 2-white' intercept 1 time 2 subgroup 0 0 0 0 0 1 time*subgroup 0 0 0 0 0 2 /cl exp ilink;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Apr 2016 19:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261919#M13841</guid>
      <dc:creator>jsberger</dc:creator>
      <dc:date>2016-04-06T19:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: interaction of continuous and categorical variable in contrast/estimate statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261927#M13843</link>
      <description>&lt;P&gt;Not sure, but based on the example&amp;nbsp;SAS may have parameterized Time as the last effect. Try this:&lt;/P&gt;&lt;PRE&gt;estimate 'diff 0 vs 1-white' subgroup*time [1,6 0] [-1,6 0]/e;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have just a few times, you can make Time a class effect and use LSMeans or LSEstimate / AT Time = 0.&lt;/P&gt;&lt;P&gt;This is sometimes useful with the /e option to show you the correct contract vector, which you can then plug into the Estimate statement.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 20:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261927#M13843</guid>
      <dc:creator>EastwoodDC</dc:creator>
      <dc:date>2016-04-06T20:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: interaction of continuous and categorical variable in contrast/estimate statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261930#M13844</link>
      <description>I did try that too...SAS kicks an error: "The level 0 is not valid for CLASS variable subgroup."&lt;BR /&gt;I think the 'continuous' effect has to come first.&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Apr 2016 20:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261930#M13844</guid>
      <dc:creator>jsberger</dc:creator>
      <dc:date>2016-04-06T20:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: interaction of continuous and categorical variable in contrast/estimate statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261935#M13845</link>
      <description>&lt;P&gt;Some days I hate SAS. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I can't say why it's not working without seeing the parameterization (and maybe not even then), but I suspect the cause is there. I can't always get all the estimates I need from a single paramerterization, sometimes&amp;nbsp;multiple passes at the model are&amp;nbsp;needed.&lt;/P&gt;&lt;P&gt;You might try looking at the different parameterizations you get from:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;subgroup*time&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;subgroup subgroup*time&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;subgroup|time&lt;/STRONG&gt;&lt;BR /&gt;to see it that gives you any hints at what is missing.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 20:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/261935#M13845</guid>
      <dc:creator>EastwoodDC</dc:creator>
      <dc:date>2016-04-06T20:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: interaction of continuous and categorical variable in contrast/estimate statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/262027#M13850</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally got a solution from Susan Durham at Utah State. &amp;nbsp;Effectively, you have to subtract the code for time 0:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;estimate intercept 1&amp;nbsp;subgroup [1, 6]&amp;nbsp;time [1, 0] subgroup*time [1, 0 6];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and time 1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;estimate intercept 1&amp;nbsp;subgroup [1, 6]&amp;nbsp;time [1, 1]&amp;nbsp;subgroup*time [1, 1 6];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With some cancellation of intercept and subgroup, you get:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;estimate 'diff 0 vs 1-white' time [1,1] [-1,0] subgroup*time [1,1 6] [-1,0 6];&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 09:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/interaction-of-continuous-and-categorical-variable-in-contrast/m-p/262027#M13850</guid>
      <dc:creator>jsberger</dc:creator>
      <dc:date>2016-04-07T09:47:02Z</dc:date>
    </item>
  </channel>
</rss>

