<?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: Contrasts necessary to test for significance of differences between each pair of slopes in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416960#M21891</link>
    <description>&lt;P&gt;Thank you for the additional information.&amp;nbsp;You've made an excellent start.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The INPUT statement in your DATA step is probably wrong: it specifies &lt;EM&gt;a&lt;/EM&gt; as a categorical variable ("a $"), and it is missing &lt;EM&gt;x&lt;/EM&gt;. Perhaps you mean it to be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input x $ a b c d e;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ESTIMATE statement in the GLIMMIX (but not the MIXED) procedure has an ADJUST option that will work for what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="GLIMMIX documentation/ESTIMATE stmt" href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glimmix_syntax10.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_self"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glimmix_syntax10.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=hye;
  class x;
  model = x a*x b c d e / noint solution;
  estimate 'x1 vs x2' a*x  1 -1  0  0  0,
           'x1 vs x3' a*x  1  0 -1  0  0,
         /* add the other 7 comparisons */
           'x4 vs x5' a*x  0  0  0  1 -1 
         / adjust=bon stepdown adjdfe=row;
  run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note the change I've made in the MODEL statement: I added &lt;EM&gt;e&lt;/EM&gt;, and replaced &lt;EM&gt;a&lt;/EM&gt; with&amp;nbsp;&lt;EM&gt;x&lt;/EM&gt;; if the effect of the change is not obvious to you, run the model without &lt;EM&gt;b&lt;/EM&gt;, &lt;EM&gt;c&lt;/EM&gt;, &lt;EM&gt;d&lt;/EM&gt;, and&amp;nbsp;&lt;EM&gt;e &lt;/EM&gt;to see how the model is parameterized with respect to &lt;EM&gt;a&lt;/EM&gt; and &lt;EM&gt;x&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note, too, that for your equation to match the code above, there will be no intercept (const), there will be no "a*beta1", and "beta6" (and "beta7") will actually be 5 parameters, one for each level of &lt;EM&gt;x.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default, the estimates will be computed at &lt;EM&gt;b&lt;/EM&gt;=&lt;EM&gt;c&lt;/EM&gt;=&lt;EM&gt;d&lt;/EM&gt;=&lt;EM&gt;e&lt;/EM&gt;=0. Because there are no interactions involving these factors in the model, the estimates that you want will not be affected by the values of &lt;EM&gt;b&lt;/EM&gt;, &lt;EM&gt;c&lt;/EM&gt;, &lt;EM&gt;d&lt;/EM&gt;, and &lt;EM&gt;e&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not run this code, and so I don't guarantee it will work, it might need tweaking (and I'm not sure about your data input).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2017 05:32:23 GMT</pubDate>
    <dc:creator>sld</dc:creator>
    <dc:date>2017-11-29T05:32:23Z</dc:date>
    <item>
      <title>Contrasts necessary to test for significance of differences between each pair of slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416946#M21888</link>
      <description>&lt;P&gt;I have a categorical predictor that has 5 groups in it. I want to create contrasts necessary to&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt; test for significance of differences between each pair of slopes and then&amp;nbsp;u&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;se the Bonferroni adjustment to preserve the overall alpha for the simultaneous tests of slopes and &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;draw a conclusion about the regression slopes.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;In case of a predictor with 3 groups, the SAS code would look like:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;ods select SolutionF Contrasts;&lt;BR /&gt;contrast 'A vs B' pos*pts 1 -1 0;&lt;BR /&gt;contrast 'A vs C' pos*pts 1 0 -1;&lt;BR /&gt;contrast 'B vs C' pos*pts 0 1 -1;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;.. How to work in case of 5 groups ?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 03:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416946#M21888</guid>
      <dc:creator>samillioneer</dc:creator>
      <dc:date>2017-11-29T03:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Contrasts necessary to test for significance of differences between each pair of slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416948#M21889</link>
      <description>&lt;P&gt;Please provide more detail. See the posting guidelines here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Getting-Started/How-to-get-fast-helpful-answers/ta-p/226133/jump-to/first-unread-message" target="_self"&gt;https://communities.sas.com/t5/Getting-Started/How-to-get-fast-helpful-answers/ta-p/226133/jump-to/first-unread-message&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings12/189-2012.pdf" target="_self"&gt;http://support.sas.com/resources/papers/proceedings12/189-2012.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In particular, post the full code for the statistical model, and show what you've tried so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 03:49:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416948#M21889</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2017-11-29T03:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Contrasts necessary to test for significance of differences between each pair of slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416951#M21890</link>
      <description>&lt;P&gt;Thank you for&amp;nbsp;correcting my rookie mistake, I'll be elaborate henceforth. My dataset consists of response(R) and predictors(a,b,c,d,e) + a categorical predictor(x, which has five groups x1,x2,x3,x4,x5).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My regression model is R&amp;nbsp;= const+a(beta1)+b&lt;SPAN&gt;(beta2)+c&lt;/SPAN&gt;&lt;SPAN&gt;(beta3)+d(beta4)+e(beta5)+x(beta6)+a*x*(beta7)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to test for&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;significance of differences between each pair of slopes corresponding to a*x1, a*x2,a*x3, a*x4,a*x5. We will have 10&amp;nbsp;such pairs ( 5C2).&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;Here's the SAS code that produces a reparametrized model and gives the solutions table for the intercepts and slopes&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;data hye;&lt;BR /&gt;input&amp;nbsp;a $ b c d e;&lt;BR /&gt;datalines;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*data goes here*/&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc mixed data=hye method=type3;&lt;BR /&gt;class x;&lt;BR /&gt;model = b c d&amp;nbsp;a a*x / noint solution;&lt;/P&gt;&lt;P&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further, I would like to&amp;nbsp;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;construct the ten&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;contrasts&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt; necessary to test for significance of differences between each pair of slopes. I'm completely at loss how to go about it.&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;In case of three contrasts(3C2) originating from 3 groups for a categorical predictor, the code would be like this:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Times New Roman, serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;ods select SolutionF Contrasts;&lt;BR /&gt;contrast 'x1 vs x2' a*x 1 -1 0;&lt;BR /&gt;contrast 'x1 vs x3' a*x 1 0 -1;&lt;BR /&gt;contrast 'x2 vs x3' a*x 0 1 -1;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 04:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416951#M21890</guid>
      <dc:creator>samillioneer</dc:creator>
      <dc:date>2017-11-29T04:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Contrasts necessary to test for significance of differences between each pair of slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416960#M21891</link>
      <description>&lt;P&gt;Thank you for the additional information.&amp;nbsp;You've made an excellent start.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The INPUT statement in your DATA step is probably wrong: it specifies &lt;EM&gt;a&lt;/EM&gt; as a categorical variable ("a $"), and it is missing &lt;EM&gt;x&lt;/EM&gt;. Perhaps you mean it to be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input x $ a b c d e;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ESTIMATE statement in the GLIMMIX (but not the MIXED) procedure has an ADJUST option that will work for what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="GLIMMIX documentation/ESTIMATE stmt" href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glimmix_syntax10.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_self"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glimmix_syntax10.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=hye;
  class x;
  model = x a*x b c d e / noint solution;
  estimate 'x1 vs x2' a*x  1 -1  0  0  0,
           'x1 vs x3' a*x  1  0 -1  0  0,
         /* add the other 7 comparisons */
           'x4 vs x5' a*x  0  0  0  1 -1 
         / adjust=bon stepdown adjdfe=row;
  run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note the change I've made in the MODEL statement: I added &lt;EM&gt;e&lt;/EM&gt;, and replaced &lt;EM&gt;a&lt;/EM&gt; with&amp;nbsp;&lt;EM&gt;x&lt;/EM&gt;; if the effect of the change is not obvious to you, run the model without &lt;EM&gt;b&lt;/EM&gt;, &lt;EM&gt;c&lt;/EM&gt;, &lt;EM&gt;d&lt;/EM&gt;, and&amp;nbsp;&lt;EM&gt;e &lt;/EM&gt;to see how the model is parameterized with respect to &lt;EM&gt;a&lt;/EM&gt; and &lt;EM&gt;x&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note, too, that for your equation to match the code above, there will be no intercept (const), there will be no "a*beta1", and "beta6" (and "beta7") will actually be 5 parameters, one for each level of &lt;EM&gt;x.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default, the estimates will be computed at &lt;EM&gt;b&lt;/EM&gt;=&lt;EM&gt;c&lt;/EM&gt;=&lt;EM&gt;d&lt;/EM&gt;=&lt;EM&gt;e&lt;/EM&gt;=0. Because there are no interactions involving these factors in the model, the estimates that you want will not be affected by the values of &lt;EM&gt;b&lt;/EM&gt;, &lt;EM&gt;c&lt;/EM&gt;, &lt;EM&gt;d&lt;/EM&gt;, and &lt;EM&gt;e&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not run this code, and so I don't guarantee it will work, it might need tweaking (and I'm not sure about your data input).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 05:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/416960#M21891</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2017-11-29T05:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Contrasts necessary to test for significance of differences between each pair of slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/417176#M21903</link>
      <description>&lt;P&gt;Thank you for such a detailed response and a working solution. It indeed worked!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 18:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/417176#M21903</guid>
      <dc:creator>samillioneer</dc:creator>
      <dc:date>2017-11-29T18:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Contrasts necessary to test for significance of differences between each pair of slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/417178#M21904</link>
      <description>&lt;P&gt;Excellent! Thanks for letting me know.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 18:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Contrasts-necessary-to-test-for-significance-of-differences/m-p/417178#M21904</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2017-11-29T18:32:01Z</dc:date>
    </item>
  </channel>
</rss>

