<?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: Specify Pairwise Comparisons Using PROC GLM in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734112#M35618</link>
    <description>You can use write specific contrasts for desired comparison and adjust the P-values based on Bonferroni method by considering the number of pairwise comparisons:&lt;BR /&gt;This online resource might be useful:&lt;BR /&gt;&lt;A href="https://people.stat.sc.edu/habing/courses/516cmsup3.pdf" target="_blank"&gt;https://people.stat.sc.edu/habing/courses/516cmsup3.pdf&lt;/A&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 15 Apr 2021 06:07:49 GMT</pubDate>
    <dc:creator>gcjfernandez</dc:creator>
    <dc:date>2021-04-15T06:07:49Z</dc:date>
    <item>
      <title>Specify Pairwise Comparisons Using PROC GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/733914#M35614</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Is there a way to specify which pairwise comparisons you want to look at, so that I can apply a Bonferroni adjustment using PROC GLM?&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Example:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Factor A has 6 levels&lt;/P&gt;
&lt;P&gt;Outcome variable is continuous&lt;/P&gt;
&lt;P&gt;Thus we use an ANOVA model Y = mu + tau1 + tau2 + tau3 + tau4 + tau5 + tau6 + epsilon.&lt;/P&gt;
&lt;P&gt;I am interested in whether there is a significant difference of mean in levels 1 and 2, levels 3 and 5, and level 1 and 6. Thus I am testing the null hypotheses mu1 = mu2, mu3 = mu5, and mu1 = mu6. Since this isn't&amp;nbsp;&lt;STRONG&gt;all&lt;/STRONG&gt; pairwise comparisons, I want to apply Bonferroni adjustment in place of Tukey adjustment. However, I don't want it to adjust for all comparisons since I don't care about that. Can SAS accommodate this? Or is splitting the alpha the way to go?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 20:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/733914#M35614</guid>
      <dc:creator>amarikow57</dc:creator>
      <dc:date>2021-04-14T20:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Pairwise Comparisons Using PROC GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734112#M35618</link>
      <description>You can use write specific contrasts for desired comparison and adjust the P-values based on Bonferroni method by considering the number of pairwise comparisons:&lt;BR /&gt;This online resource might be useful:&lt;BR /&gt;&lt;A href="https://people.stat.sc.edu/habing/courses/516cmsup3.pdf" target="_blank"&gt;https://people.stat.sc.edu/habing/courses/516cmsup3.pdf&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Apr 2021 06:07:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734112#M35618</guid>
      <dc:creator>gcjfernandez</dc:creator>
      <dc:date>2021-04-15T06:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Pairwise Comparisons Using PROC GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734238#M35622</link>
      <description>&lt;P&gt;You should look into using the LSMESTIMATE statement.&amp;nbsp; You can do multiple comparisons and apply a Bonferroni correction (amongst many correction types).&amp;nbsp; Something like this may be what you are looking for:&lt;/P&gt;
&lt;P&gt;(But keep in mind that PROC GLM does not support the LSMESTIMATE statement.&amp;nbsp; For a better set of code, see the response by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60873"&gt;@jiltao&lt;/a&gt;&amp;nbsp;in this thread.)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=yourdata;
class factor_A;
model y=factor_A;
lsmeans factor_A;
lsmestimate factor_A 'One vs two'   1 -1 0 0 0 0,
              'Three vs five' 0 0 1 0 -1 0,        ,
              'One vs six' 1 0 0 0 0 -1/adjust=bon;     ,
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 13:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734238#M35622</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-04-16T13:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Pairwise Comparisons Using PROC GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734273#M35624</link>
      <description>&lt;P&gt;What you are asking for might not be done in PROC GLM --- In some other procedures that can also fit your ANOVA model, like PROC MIXED or PROC GENMOD, you might use the LSMESTIMATE statement with the ADJUST= option to get what you want; or use the ESTIMATE statement with the ADJUST=BON in procedures like PROC GLIMMIX or PROC GENMOD to get what you want. But PROC GLM does not have the LSMESTIMATE statement, and for the ESTIMATE statement in PROC GLM, ADJUST= option is not supported. Below is a sample syntax --&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc mixed data=yourdata;
class A;
model y=A;
lsmestimate A 'level 1 vs 2' 1 -1 0 0 0 0,
              'level 3 vs 5' 0 0 1 0 -1 0,        ,
              'level 1 vs 6' 1 0 0 0 0 -1/adjust=bon;     ,
run;&lt;/LI-CODE&gt;
&lt;P&gt;Another approach if you prefer fitting your model in PROC GLM, is to use the STORE statement in PROC GLM then use PROC PLM to do the multiple comparisons you want. For example,&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc glm data=yourdata;
class A;
model y=A;
store glmout;
run;

proc plm restore=glmout;
lsmestimate A 'level 1 vs 2' 1 -1 0 0 0 0,
              'level 3 vs 5' 0 0 1 0 -1 0,        ,
              'level 1 vs 6' 1 0 0 0 0 -1/adjust=bon;        ,
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 13:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734273#M35624</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2021-04-15T13:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Pairwise Comparisons Using PROC GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734333#M35628</link>
      <description>&lt;P&gt;Just wanted to point out that the LSMESTIMATE statement is not available in PROC GLM. Please refer to my previous post for alternative approaches.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 16:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734333#M35628</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2021-04-15T16:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Pairwise Comparisons Using PROC GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734334#M35629</link>
      <description>&lt;P&gt;Yes. Thank you! I'm not sure how to change accepted solution, though.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 16:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734334#M35629</guid>
      <dc:creator>amarikow57</dc:creator>
      <dc:date>2021-04-15T16:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Pairwise Comparisons Using PROC GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734714#M35646</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60873"&gt;@jiltao&lt;/a&gt; for pointing out the error with my code, and even better, posting a solution that did use PROC GLM.&amp;nbsp; I wish I could mark your reply as correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 12:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Specify-Pairwise-Comparisons-Using-PROC-GLM/m-p/734714#M35646</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-04-16T12:56:42Z</dc:date>
    </item>
  </channel>
</rss>

