<?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: Proc mixed, solution for fixed effects (comparison between regression coefficients) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120170#M33098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try fitting the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;model LW=age variable1 variable2 variable1*variable2 variable1*milk / solutions NOINT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solutions for variable1*milk will now be the slopes for each maternal breed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A second think to think about is that your LW variables are strongly autocorrelated, so that getting separate point and avariability estimates at each time point may lead to some problems.&amp;nbsp; You may wish to start considering a repeated measures model.&amp;nbsp; And of course, that could mean a time-varying covariate in milk production.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you post a very small sample of your data?&amp;nbsp; I think you may want to consider the following model, provided that age accurately indexes each of the live weights:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc mixed;&lt;/P&gt;&lt;P&gt;class age variable1 variable2 subjectid:&lt;/P&gt;&lt;P&gt;model LW = age|variable1|variable2 variable1*milk/solution noint;&lt;/P&gt;&lt;P&gt;repeated age/subject=subjectid type=sp(pow)(age1);/*I chose the spatial power structure because I was not sure if the time points were evenly spaced.&amp;nbsp; If they are, replace with ARH(1) to accommodate change in variance over time */&lt;/P&gt;&lt;P&gt;run;&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>Mon, 25 Feb 2013 18:22:36 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2013-02-25T18:22:36Z</dc:date>
    <item>
      <title>Proc mixed, solution for fixed effects (comparison between regression coefficients)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120169#M33097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing some research in animal science and I have a problem that I need help with. It might be very simple to do it manually but I would like to find a way to do it in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume&lt;/P&gt;&lt;P&gt;variable1= breed1, breed2, breed3, breed4&lt;/P&gt;&lt;P&gt;variable2=breed4, breed5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, lets assume the variable Liveweight (LW)&amp;nbsp; at a particular time t is affected by age, variable1, variable2 and you are using the variable 'milk' as a covariable for the model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your model in proc mixed goes something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LW= age variable1 variable2 variable1*variable2 variable1*milk / solutions;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On your SAS output you get your 'Solutions for fixed effects' table with the regression coefficients of 'milk" on breed1, breed2, breed3, and breed4 (b1 b2 b3 b4); your standar errors (SE), DF, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this table you know if the coefficients are different from 0 but i would like to know...How the different reg coefficient for the different breeds compare to each other or put in other words how they differ from each other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've extracted the table with the ods output statement and selected only the regression coefficient but I'm stuck there. I know that my t value is equal to the difference of lets say of b1-b2/SE of (b1-b2), after that I can look at my t values on a table and find out which ones differ from the others but doing this manually is taking me forever since I have to run the variable LW at different times (LW5, LW10, LW15... LW365).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me to find a way to do this more efficiently and correctly in SAS? Any assistance would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 05:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120169#M33097</guid>
      <dc:creator>F_Roca</dc:creator>
      <dc:date>2013-02-25T05:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, solution for fixed effects (comparison between regression coefficients)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120170#M33098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try fitting the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;model LW=age variable1 variable2 variable1*variable2 variable1*milk / solutions NOINT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solutions for variable1*milk will now be the slopes for each maternal breed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A second think to think about is that your LW variables are strongly autocorrelated, so that getting separate point and avariability estimates at each time point may lead to some problems.&amp;nbsp; You may wish to start considering a repeated measures model.&amp;nbsp; And of course, that could mean a time-varying covariate in milk production.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you post a very small sample of your data?&amp;nbsp; I think you may want to consider the following model, provided that age accurately indexes each of the live weights:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc mixed;&lt;/P&gt;&lt;P&gt;class age variable1 variable2 subjectid:&lt;/P&gt;&lt;P&gt;model LW = age|variable1|variable2 variable1*milk/solution noint;&lt;/P&gt;&lt;P&gt;repeated age/subject=subjectid type=sp(pow)(age1);/*I chose the spatial power structure because I was not sure if the time points were evenly spaced.&amp;nbsp; If they are, replace with ARH(1) to accommodate change in variance over time */&lt;/P&gt;&lt;P&gt;run;&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>Mon, 25 Feb 2013 18:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120170#M33098</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2013-02-25T18:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, solution for fixed effects (comparison between regression coefficients)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120171#M33099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data would be something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subject time&amp;nbsp; milk&amp;nbsp;&amp;nbsp;&amp;nbsp; variable1 variable2&amp;nbsp;&amp;nbsp;&amp;nbsp; LW&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 503&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 120&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 460&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 136&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 751&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 156&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 607&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 174&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 447&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 136&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 614&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 133&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 422&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 126&lt;/P&gt;&lt;P&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 528&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 142&lt;/P&gt;&lt;P&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 721&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 148&lt;/P&gt;&lt;P&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 560&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; breed5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 150&lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this dataset i'm using the ' milk at day 90' however I want to run the same LW variable (at day 90) but also with milk60 and milk40 as covariables, of course in separate models.&lt;/P&gt;&lt;P&gt;I'm interested in the regression coefficients of milk*variable1 and at some point also the milk*variable1*variable2. However I cannot manage to write a program that could tell me if this coefficients are different from each other.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 22:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120171#M33099</guid>
      <dc:creator>F_Roca</dc:creator>
      <dc:date>2013-02-25T22:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, solution for fixed effects (comparison between regression coefficients)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120172#M33100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK.&amp;nbsp; So let's do the simpler model first.&amp;nbsp; We need to predict LW at day90 as a function of milk, variable1, and variable2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data one; /* made up data that doesn't even come close to the biological data */&lt;BR /&gt;do variable1 = 1 to 3;&lt;BR /&gt; do variable2 =4 to 6;&lt;BR /&gt;&amp;nbsp; do obs = 1 to 4;&lt;BR /&gt; milk=abs(500*rannor(1));&lt;BR /&gt; lw=abs(120*rannor(1));&lt;BR /&gt; output;&lt;BR /&gt; end;&lt;BR /&gt; end;&lt;BR /&gt; end;&lt;BR /&gt; run;&lt;/P&gt;&lt;P&gt;proc mixed data=one;&lt;BR /&gt;class variable1 variable2;&lt;BR /&gt;model lw=variable1|variable2 variable1*variable2*milk/solution noint e;&lt;BR /&gt;estimate 'Slope variable1=1, variable2=4 vs variable1=1, variable2=5' variable1*variable2*milk 1 -1 0&amp;nbsp; 0 0 0&amp;nbsp; 0 0 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The F test for variable1*variable2*milk is for homogeneity of slopes across the combinations of variable1 and variable2.&amp;nbsp; If this is significant, then at least one slope is different.&amp;nbsp; To compare the slopes, the estimate statement is inserted.&amp;nbsp; A contrast statement will work as well, and does have the advantage of multiple contrasts and controlling for them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the three-way interaction with the covariate is all that I included, because at this point I am testing for equal slopes across all combinations of variable1 and variable2.&amp;nbsp; If you are only interested in the slopes within variable1 or variable2, drop back to that.&amp;nbsp; Be very careful about including more than one interaction of the covariate with the class variables, as the lower order terms do not really mean "slope".&amp;nbsp; A really good read is SAS for Mixed Models, 2nd. ed. by Littell et al., especially the chapter on analysis of covariance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this gets you started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 12:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120172#M33100</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2013-02-26T12:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, solution for fixed effects (comparison between regression coefficients)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120173#M33101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Steve that was very helpful and for sure i'll give that reference a good read.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 04:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-mixed-solution-for-fixed-effects-comparison-between/m-p/120173#M33101</guid>
      <dc:creator>F_Roca</dc:creator>
      <dc:date>2013-02-28T04:40:51Z</dc:date>
    </item>
  </channel>
</rss>

