<?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 How to perform ancova using proc mixed - step by step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-perform-ancova-using-proc-mixed-step-by-step/m-p/735379#M229089</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am having a hard time understanding the ANCOVA model and how to implement it in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am supposed to do an ANCOVA to obtain adjusted means and adjusted means differences for Y = change from baseline using treatment as a factor variable (3 categories), country as a categorical covariate (5 categories) and baseline as a continuous variable (hence the need for ANCOVA), the last two being adjustment variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to use proc mixed and not proc glm or proc reg (Although I would love to know how it's done using these models as well).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My SAS code looks something like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc mixed data = mydata;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ods output lsmeans = ls_means;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;class trt country;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model change = trt country baseline;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;lsmeans trt / pdiff cov ;&lt;/STRONG&gt;&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;Is this correct? I also learned that an ANCOVA model requires the centering of the continuous variable. Is this something that has to be done manually or is it automatically done through SAS? I read somewhere that SPSS and R do it automatically. I know that the ANCOVA model looks something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gkmzinsou_0-1618869759218.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58336i586E29C6904E427D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gkmzinsou_0-1618869759218.png" alt="gkmzinsou_0-1618869759218.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gkmzinsou_1-1618869772032.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58337iCE5BFE16E4809C33/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gkmzinsou_1-1618869772032.png" alt="gkmzinsou_1-1618869772032.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I write my model in this form(knowing that I have an extra categorical adjustment variable)? Or can I just write it as a regression model:&lt;/P&gt;&lt;P&gt;Change = Bo + B1 treat1 + B2 treat2 + B3 country1 + B4 country2 + B5 country3 + B6 country4 + B7 baseline + error (treat 3 = ref and country5 = ref)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One last thing : I am supposed to do a sequential comparison.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Treat 1 vs Treat 3&lt;/P&gt;&lt;P&gt;Treat 2 vs Treat 3&lt;/P&gt;&lt;P&gt;Treat 1 vs Treat 2&lt;/P&gt;&lt;P&gt;How do I do that in SAS? Do I use the estimate options? I'm not too sure how that works either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any and all help would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Apr 2021 14:38:53 GMT</pubDate>
    <dc:creator>gkmzinsou</dc:creator>
    <dc:date>2021-04-20T14:38:53Z</dc:date>
    <item>
      <title>How to perform ancova using proc mixed - step by step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-perform-ancova-using-proc-mixed-step-by-step/m-p/735379#M229089</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am having a hard time understanding the ANCOVA model and how to implement it in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am supposed to do an ANCOVA to obtain adjusted means and adjusted means differences for Y = change from baseline using treatment as a factor variable (3 categories), country as a categorical covariate (5 categories) and baseline as a continuous variable (hence the need for ANCOVA), the last two being adjustment variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to use proc mixed and not proc glm or proc reg (Although I would love to know how it's done using these models as well).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My SAS code looks something like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc mixed data = mydata;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ods output lsmeans = ls_means;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;class trt country;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model change = trt country baseline;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;lsmeans trt / pdiff cov ;&lt;/STRONG&gt;&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;Is this correct? I also learned that an ANCOVA model requires the centering of the continuous variable. Is this something that has to be done manually or is it automatically done through SAS? I read somewhere that SPSS and R do it automatically. I know that the ANCOVA model looks something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gkmzinsou_0-1618869759218.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58336i586E29C6904E427D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gkmzinsou_0-1618869759218.png" alt="gkmzinsou_0-1618869759218.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gkmzinsou_1-1618869772032.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58337iCE5BFE16E4809C33/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gkmzinsou_1-1618869772032.png" alt="gkmzinsou_1-1618869772032.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I write my model in this form(knowing that I have an extra categorical adjustment variable)? Or can I just write it as a regression model:&lt;/P&gt;&lt;P&gt;Change = Bo + B1 treat1 + B2 treat2 + B3 country1 + B4 country2 + B5 country3 + B6 country4 + B7 baseline + error (treat 3 = ref and country5 = ref)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One last thing : I am supposed to do a sequential comparison.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Treat 1 vs Treat 3&lt;/P&gt;&lt;P&gt;Treat 2 vs Treat 3&lt;/P&gt;&lt;P&gt;Treat 1 vs Treat 2&lt;/P&gt;&lt;P&gt;How do I do that in SAS? Do I use the estimate options? I'm not too sure how that works either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any and all help would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 14:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-perform-ancova-using-proc-mixed-step-by-step/m-p/735379#M229089</guid>
      <dc:creator>gkmzinsou</dc:creator>
      <dc:date>2021-04-20T14:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform ancova using proc mixed - step by step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-perform-ancova-using-proc-mixed-step-by-step/m-p/735488#M229129</link>
      <description>&lt;P&gt;I think the code you provided works for ANCOVA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think centering of the continuous variable is required; SAS does not do this automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PDIFF option of LSMEANS gets you the comparisons of the levels of TRT; there's no need to use LSMESTIMATE for comparing one level to another.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 11:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-perform-ancova-using-proc-mixed-step-by-step/m-p/735488#M229129</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-20T11:40:28Z</dc:date>
    </item>
  </channel>
</rss>

