<?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, defining data structure for desired comparison (Random effect and subject) in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903518#M44818</link>
    <description>&lt;P&gt;One approach might be to just use one observation for each Pen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2023 16:20:58 GMT</pubDate>
    <dc:creator>jiltao</dc:creator>
    <dc:date>2023-11-16T16:20:58Z</dc:date>
    <item>
      <title>Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903247#M44804</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exp details: 24 pens, 3 feed types (800, 400, 100), 8 replicates, RCBD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The purpose is to evaluate a preference for feed type (800, 400, 100).&lt;/P&gt;&lt;P&gt;To make the comparisons, three "treatments" were created (A = 800 vs 100, B= 800 vs 400, C =400 vs 100), the A,B, C treatments were used to allocate 2 of the 3 feeds to 1 pen in a RCBD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For 5 days, a known amount of feed was added to each feeder/pen, and after 24 h the feed was weighed back to determine the feed disappearance.&amp;nbsp; Preference was defined as&amp;nbsp; ((disappearance of ___ feed (800, 400, 100; respectively))/ Total feed disappearance (combined total of the 2 feeders/pen)*100).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Giving the proportion of of each feed /pen/day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the proposal (was proved to me...), the Statistical Analysis is suppose to be "...preference test as the fixed effect and replicate as the random effect. LSmean and means are to be separated using pdiff with Tukey's adjustment with pen as the EU." IMHO this somewhat lacking and not very descriptive.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CODE:&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;PEN&lt;/TD&gt;&lt;TD&gt;DIET&lt;/TD&gt;&lt;TD&gt;Treatment&lt;/TD&gt;&lt;TD&gt;Rep&lt;/TD&gt;&lt;TD&gt;Feed&lt;/TD&gt;&lt;TD&gt;pref1&lt;/TD&gt;&lt;TD&gt;pref2&lt;/TD&gt;&lt;TD&gt;pref3&lt;/TD&gt;&lt;TD&gt;pref4&lt;/TD&gt;&lt;TD&gt;pref5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;800&lt;/TD&gt;&lt;TD&gt;68.7500&lt;/TD&gt;&lt;TD&gt;57.6471&lt;/TD&gt;&lt;TD&gt;67.8571&lt;/TD&gt;&lt;TD&gt;57.9545&lt;/TD&gt;&lt;TD&gt;78.9157&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;31.2500&lt;/TD&gt;&lt;TD&gt;42.3529&lt;/TD&gt;&lt;TD&gt;32.1429&lt;/TD&gt;&lt;TD&gt;42.0455&lt;/TD&gt;&lt;TD&gt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;43.9153&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;800&lt;/TD&gt;&lt;TD&gt;92.5926&lt;/TD&gt;&lt;TD&gt;57.7465&lt;/TD&gt;&lt;TD&gt;65.5172&lt;/TD&gt;&lt;TD&gt;73.9130&lt;/TD&gt;&lt;TD&gt;59.0278&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;400&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;7.4074&lt;/TD&gt;&lt;TD&gt;42.2535&lt;/TD&gt;&lt;TD&gt;34.4828&lt;/TD&gt;&lt;TD&gt;26.0870&lt;/TD&gt;&lt;TD&gt;40.9722&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;....&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Proc Print;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;%macro model_loop;&lt;BR /&gt;%let yvar1 = pref1;&lt;BR /&gt;%let yvar2 = pref2;&lt;BR /&gt;%let yvar3 = pref3;&lt;BR /&gt;%let yvar4 = pref4;&lt;BR /&gt;%let yvar5 = pref5;&lt;/P&gt;&lt;P&gt;%do i=1 %to 5 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc Mixed data=Exp200 NOBOUND ASYCOV method=REML;&lt;BR /&gt;Title "&amp;amp;&amp;amp;yvar&amp;amp;i";&lt;BR /&gt;class Pen Trt Rep Feed;&lt;BR /&gt;model &amp;amp;&amp;amp;yvar&amp;amp;i = Feed/ddfm=Kenwardroger;&lt;BR /&gt;random Rep / subject=Pen;&lt;BR /&gt;lsmeans Feed/pdiff adjust=tukey;&lt;BR /&gt;store out=work.glm&amp;amp;&amp;amp;yvar&amp;amp;i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc plm restore=work.glm&amp;amp;&amp;amp;yvar&amp;amp;i;&lt;BR /&gt;Title "&amp;amp;&amp;amp;yvar&amp;amp;i PLM";&lt;BR /&gt;lsmeans Feed/ pdiff lines adjust=tukey;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%mend model_loop;&lt;BR /&gt;%model_loop;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I'm having is a failure to converge . I have a feeling that it has to do with the specification of the subject.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess I don't have a super specific question. I just don't feel like this is the correct way to analyze the data and looking for advice.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&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, 15 Nov 2023 17:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903247#M44804</guid>
      <dc:creator>Laser_Taco_</dc:creator>
      <dc:date>2023-11-15T17:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903338#M44809</link>
      <description>&lt;P&gt;It seems to me that for every Pen, you have two observations. The values for these two observations for each of Pref1-Pref5 always add up to 100. That might be a problem. You might want to reconsider how you want to arrange your data and set up your model.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jill&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 21:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903338#M44809</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2023-11-15T21:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903364#M44814</link>
      <description>Hi Jill,&lt;BR /&gt;&lt;BR /&gt;Thank you for the response. I also think that is the issue.&lt;BR /&gt;&lt;BR /&gt;Since these values are percentages that add to 100% (when combined), they aren't independent.&lt;BR /&gt;&lt;BR /&gt;Any idea or suggestion on how I can re-arrange?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Kyle</description>
      <pubDate>Wed, 15 Nov 2023 21:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903364#M44814</guid>
      <dc:creator>Laser_Taco_</dc:creator>
      <dc:date>2023-11-15T21:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903518#M44818</link>
      <description>&lt;P&gt;One approach might be to just use one observation for each Pen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 16:20:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903518#M44818</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2023-11-16T16:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903588#M44821</link>
      <description>Thank you again for the response. How might only using 1 or the observations impact the interpretation or the results?&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Nov 2023 00:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903588#M44821</guid>
      <dc:creator>Laser_Taco_</dc:creator>
      <dc:date>2023-11-17T00:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903663#M44828</link>
      <description>&lt;P&gt;I hope I understand this correctly. Each pen is randomly assigned to one of 3 treatments (A, B, C). Thus, a pen will have one value. I don't see the advantage of calculating a value for each as a proportion. Have you considered fitting the raw consumption values (which should be independent), and then calculating the ratios from the least squares means?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other point to consider is that ratios probably do not yield normally distributed residuals, as the cut-offs at 0 and 1 may be a problem. If you are going to analyze the proportions as the dependent variable, a beta distribution for the values may be more appropriate. That would mean shifting to GLIMMIX or GEE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And last, failure to converge. That very likely can be fixed by adding MAXITER= and MAXFUNC= options to the PROC MIXED statement, provided there are no other issues. Check both the .log and .lst file for notes, warnings and notifications that indicate that the algorithm has difficulties other than slow convergence.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 14:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903663#M44828</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2023-11-17T14:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903676#M44829</link>
      <description>Hello @stevendenham,&lt;BR /&gt;Thank you for your response!&lt;BR /&gt;&lt;BR /&gt;Yes, you are correct. There are 3 pens/block (i used the word "Rep" in my initial post) with 8 blocks in total.&lt;BR /&gt;&lt;BR /&gt;The reason I have two values for each pen is due to the different consumptions from the two feeders in each pen. If I were to use only 1 value from the pen, I am unsure how I would differentiate the consumption between the two feeders within the pen (800 v 100 etc.).&lt;BR /&gt;&lt;BR /&gt;To your point on proportions, I also considered this and agree especially with a handful of cases were the consumption for the feeders within a pen are 0 and 1, respectively. Admittedly, I am a bit unfamiliar with GLIMMIX and GEE, but should the code look something like this:&lt;BR /&gt;&lt;BR /&gt;Proc GLIMMIX data=Exp200 ;&lt;BR /&gt;class Pen Trt Block Feed;&lt;BR /&gt;model y= Feed / ddfm=KR;&lt;BR /&gt;random block/ subject=Pen; **Unsure if " /subject=pen" is necessary**&lt;BR /&gt;lsmeans Feed/pdiff lines adjust=tukey;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;As for the failure to converge, I was able to get it to converge (with no errors) by removing the NOBOUND option, but the Cov Parm Estimate for Block/subject=pen was zero which is odd.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Kyle&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Nov 2023 16:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903676#M44829</guid>
      <dc:creator>Laser_Taco_</dc:creator>
      <dc:date>2023-11-17T16:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903966#M44838</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;hi Kyle&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/460063"&gt;@Laser_Taco_&lt;/a&gt;&amp;nbsp;,&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Just a few things that occurred to me over the weekend. In GLIMMIX, for ratios you should probably specify a distribution, and change the method to LAPLACE with tech=nrridg. So perhaps something like this:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRIKE&gt;&lt;CODE class=" language-sas"&gt;Proc GLIMMIX data=Long_version method=laplace;&lt;BR /&gt;nloptions maxiter=1000 tech=nrridg;
class Pen Trt diet Block Feed instance;
model y=Trt Feed instance Feed*instance/dist=beta ddfm=KR;
random instance/subject=pen*diet  type=ar(1);
random feed/subject=pen type=chol;
random block;
lsmeans Feed/pdiff lines adjust=tukey;
run;&lt;/CODE&gt;&lt;/STRIKE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRIKE&gt;The first thing to do is to re-arrange the data into a long format, where there is one dependent value in each observation (here it is y). The other variables in each line would be pen, trt, diet (although this looks completely confounded with feed), block, feed and instance, which is indexed from 1 to 5. So instead of:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRIKE&gt;PEN&lt;/STRIKE&gt;&lt;/TD&gt;
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R&gt;
&lt;TD&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;100&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;31.2500&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;42.3529&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;32.1429&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;42.0455&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRIKE&gt;21.0843&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;You would have (for the first pen, and all other pens would follow this pattern:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;TABLE width="394px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;PEN&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="30px"&gt;&lt;STRIKE&gt;DIET&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="30px"&gt;&lt;STRIKE&gt;Treatment&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;Rep&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="30px"&gt;&lt;STRIKE&gt;Feed&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="30px"&gt;&lt;STRIKE&gt;instance&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="30px"&gt;&lt;STRIKE&gt;y&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="30px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="30px"&gt;&lt;STRIKE&gt;800&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="30px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="30px"&gt;&lt;STRIKE&gt;0.6875&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="34px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="34px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="34px"&gt;&lt;STRIKE&gt;800&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="34px"&gt;&lt;STRIKE&gt;2&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="34px"&gt;&lt;STRIKE&gt;0.576471&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="30px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="30px"&gt;&lt;STRIKE&gt;800&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="30px"&gt;&lt;STRIKE&gt;0.678571&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="30px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="30px"&gt;&lt;STRIKE&gt;800&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="30px"&gt;&lt;STRIKE&gt;4&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="30px"&gt;&lt;STRIKE&gt;0.579545&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px"&gt;&lt;STRIKE&gt;800&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px"&gt;&lt;STRIKE&gt;5&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px"&gt;&lt;STRIKE&gt;0.789157&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="30px"&gt;&lt;STRIKE&gt;100&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="30px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="30px"&gt;&lt;STRIKE&gt;0.3125&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="34px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="34px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="34px"&gt;&lt;STRIKE&gt;100&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="34px"&gt;&lt;STRIKE&gt;2&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="34px"&gt;&lt;STRIKE&gt;0.423529&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="30px"&gt;&lt;STRIKE&gt;100&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="30px"&gt;&lt;STRIKE&gt;0.321429&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px" height="30px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px" height="30px"&gt;&lt;STRIKE&gt;100&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px" height="30px"&gt;&lt;STRIKE&gt;4&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px" height="30px"&gt;&lt;STRIKE&gt;0.420455&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.3125px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="46.5875px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="85.7px"&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="45.975px"&gt;&lt;STRIKE&gt;100&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="71.3625px"&gt;&lt;STRIKE&gt;5&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;TD width="66.625px"&gt;&lt;STRIKE&gt;0.210843&lt;/STRIKE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;STRIKE&gt;&amp;nbsp;And so on. Note that all of the y values have been rescaled to the (0, 1) interval. So now there are two levels of feed for each pen and five levels of instance for each pen by diet combination.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;If I were better informed about how to use it, I might recommend PROC COPULA for the analysis, but that is only based on what the examples look like.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;I thought I had a way to address this, but so long as each pref within a treatment is such that the values for the two diets within a treatment sum to 1, all of the above will have some major issues due to lack of independence. If the preference response was converted to a ratio or some other type of value, so that a single value is obtained per pen at each preference measurement (time), you should be able to improve the analysis.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 17:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/903966#M44838</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2023-11-20T17:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/904016#M44840</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if I understand what you mean by "&lt;SPAN&gt;converted to a ratio or some other type of value, so that a single value is obtained per pen at each preference measurement (time), you should be able to improve the analysis.".&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I understand that having multiple responses from the same pen is my issue here. For converting the values to a ratio, each value per diet/pen is already a ratio == Diet__ :Total Consumed.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 21:18:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/904016#M44840</guid>
      <dc:creator>Laser_Taco_</dc:creator>
      <dc:date>2023-11-20T21:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mixed, defining data structure for desired comparison (Random effect and subject)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/904100#M44842</link>
      <description>&lt;P&gt;Rather than a ratio of each component to the total you might consider a ratio of consumption of the feed with the larger feed level to the smaller feed level for each pen. You get a single value that is indexed by the variable 'Treatment'. Or consider the difference in consumption calculated in much the same way. That might even be better as it is much more likely to collectively have residuals that are distributed normally. The lsmeans by treatment are then a measure of how much more was consumed of the higher valued feed - which is a clear measure of preference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 13:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-defining-data-structure-for-desired-comparison-Random/m-p/904100#M44842</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2023-11-21T13:46:05Z</dc:date>
    </item>
  </channel>
</rss>

