<?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: Simple regression for animal feeding trial - help in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915884#M45445</link>
    <description>&lt;P&gt;Thank you very much for your help, and apologies for the delay in replying. I took some time to review the documentation for MIXED and GLIMMIX. I ended up analyzing two ways.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first one with effect of AB, CHALLENGE and the SUPPL dose:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=CHICKS; BY VAR;&lt;BR /&gt;PROC GLIMMIX DATA=CHICKS; BY VAR;&lt;BR /&gt;CLASS DAY PEN AB CHALLENGE SUPPL;&lt;BR /&gt;MODEL VALUE = DAY|SUPPL AB CHALLENGE;&lt;BR /&gt;RANDOM DAY / SUBJECT=PEN TYPE = unr residual;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second one with just the effect of TRT and the interaction with DAY&lt;BR /&gt;&lt;BR /&gt;PROC SORT DATA=CHICKS; BY VAR;&lt;BR /&gt;PROC GLIMMIX DATA=CHICKS; BY VAR;&lt;BR /&gt;CLASS DAY PEN TRT;&lt;BR /&gt;MODEL VALUE = DAY|TRT;&lt;BR /&gt;RANDOM DAY / SUBJECT=PEN TYPE = unr residual;&lt;BR /&gt;SLICE DAY*TRT / sliceby=DAY lines ADJUST=tukey;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you see anything glaringly wrong with this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2024 16:56:41 GMT</pubDate>
    <dc:creator>sb16031</dc:creator>
    <dc:date>2024-02-13T16:56:41Z</dc:date>
    <item>
      <title>Simple regression for animal feeding trial - help</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/913009#M45314</link>
      <description>&lt;P&gt;Hi Folks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I apologize in advance if this is a newbie question, I'm still relative unfamiliar with SAS and overall I don't have a super strong statistics background. I'm trying to analyze an animal feeding trial that someone else executed. Here is the study description:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There are a number of birds, housed in 14 blocks.&lt;/LI&gt;&lt;LI&gt;Each block contains a number of pens, for a total of 120 pens.&lt;/LI&gt;&lt;LI&gt;Each pen contains 6-8 birds (the number is variable, as some may die during the trial).&lt;/LI&gt;&lt;LI&gt;The variables that were measured at each time point were BW (body weight) and FI (cumulative feed intake); these are calculated pen-wise: for BW, all birds in the pen are weighed and the total weight is divided by the number of birds; the same is done for FI.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;The trial length was 43 days, and measurement were taken at day 0,14,21,28,43&lt;/LI&gt;&lt;LI&gt;There were 8 treatments:&lt;UL&gt;&lt;LI&gt;T1 is a control (no disease, no supplements);&lt;/LI&gt;&lt;LI&gt;T2 the birds were challenged with a disease;&lt;/LI&gt;&lt;LI&gt;T3 the birds were challenged and also received a commercial antibiotic;&lt;/LI&gt;&lt;LI&gt;T4 the birds were challenged and received no antibiotic, but instead a supplement at a rate of 0.125 g/ton;&lt;/LI&gt;&lt;LI&gt;T5 is the same as TR4 but the rate was 0.250 g/ton;&lt;/LI&gt;&lt;LI&gt;T6 as above, but rate was 0.5 g/ton;&lt;/LI&gt;&lt;LI&gt;T7 same as above but the rate was 0.75 g/ton;&lt;/LI&gt;&lt;LI&gt;T8 same as above but rate was 1 g/ton.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;All of the treatments have the same number of PENs&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I have set up the dataset to be the following way:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;PEN&lt;/TD&gt;&lt;TD&gt;BLOCK&lt;/TD&gt;&lt;TD&gt;TRT&lt;/TD&gt;&lt;TD&gt;DAY&lt;/TD&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;TD&gt;CHALLENGE&lt;/TD&gt;&lt;TD&gt;SUPPL&lt;/TD&gt;&lt;TD&gt;VAR&lt;/TD&gt;&lt;TD&gt;VALUE&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;T4&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;0.125&lt;/TD&gt;&lt;TD&gt;BW&lt;/TD&gt;&lt;TD&gt;43&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;T4&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;0.125&lt;/TD&gt;&lt;TD&gt;BW&lt;/TD&gt;&lt;TD&gt;33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&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;T4&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;0.125&lt;/TD&gt;&lt;TD&gt;FI&lt;/TD&gt;&lt;TD&gt;525&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where DAY is the number of days elapsed, AB is whether they're receiving antibiotic or not (only T3 received it), CHALLENGE is whether they were challenged or not (all except T1 were challenged), and SUPPL is the amount of supplement received (0 for T1-T3, increasingly higher for T4-T8).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way I see this, it's a simple linear regression, where I'm trying to model the effect of the supplement overall and by day. I tried running a proc GLM as highlighted below:&lt;/P&gt;&lt;PRE&gt;ods graphics on;
PROC SORT DATA=CHICKS; BY VAR CHALLENGE SUPPL;
PROC GLM DATA=CHICKS PLOTS=DIAGNOSTICS; BY VAR;
CLASS DAY AB CHALLENGE SUPPL;
MODEL VALUE = DAY SUPPL DAY*SUPPL AB CHALLENGE;
LSMEANS DAY SUPPL DAY*SUPPL/PDIFF=all;
RUN;
ods graphics off;
QUIT;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I don't think this is the best approach, for several reasons:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I don't know how to model the RANDOM effect of the block (or if I should at all)&lt;/LI&gt;&lt;LI&gt;I'm not modeling the REPEATED measures (the same birds were measured over time from the same PEN).&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;The time points are unequally spaced, and I think PROC GLM doesn't like that.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Is there a better way to do this? Thank you in advance for all your feedback.&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>Thu, 25 Jan 2024 17:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/913009#M45314</guid>
      <dc:creator>sb16031</dc:creator>
      <dc:date>2024-01-25T17:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Simple regression for animal feeding trial - help</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/913126#M45322</link>
      <description>&lt;P&gt;You have a lot going here, but I'll try to point you in the right direction. To answer your first two questions - you have repeated measurements on the same units (i.e., pens) over time, and you need to account for the (likely) case that those repeated measurements will be correlated. If you were to use the model you have presented (ordinary linear regression), you would be implicitly assuming that all of your observations are independent, with no correlation among observations. Because of your study design, you cannot make that assumption. There are lots of ways to specify a model that accounts for correlation among measurements, and you should start by reading the documentation for PROC MIXED and PROC GLIMMIX. To answer your third question - it should not be a problem that the measurements are unequally spaced.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 14:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/913126#M45322</guid>
      <dc:creator>Mike_N</dc:creator>
      <dc:date>2024-01-26T14:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Simple regression for animal feeding trial - help</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915884#M45445</link>
      <description>&lt;P&gt;Thank you very much for your help, and apologies for the delay in replying. I took some time to review the documentation for MIXED and GLIMMIX. I ended up analyzing two ways.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first one with effect of AB, CHALLENGE and the SUPPL dose:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=CHICKS; BY VAR;&lt;BR /&gt;PROC GLIMMIX DATA=CHICKS; BY VAR;&lt;BR /&gt;CLASS DAY PEN AB CHALLENGE SUPPL;&lt;BR /&gt;MODEL VALUE = DAY|SUPPL AB CHALLENGE;&lt;BR /&gt;RANDOM DAY / SUBJECT=PEN TYPE = unr residual;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second one with just the effect of TRT and the interaction with DAY&lt;BR /&gt;&lt;BR /&gt;PROC SORT DATA=CHICKS; BY VAR;&lt;BR /&gt;PROC GLIMMIX DATA=CHICKS; BY VAR;&lt;BR /&gt;CLASS DAY PEN TRT;&lt;BR /&gt;MODEL VALUE = DAY|TRT;&lt;BR /&gt;RANDOM DAY / SUBJECT=PEN TYPE = unr residual;&lt;BR /&gt;SLICE DAY*TRT / sliceby=DAY lines ADJUST=tukey;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you see anything glaringly wrong with this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915884#M45445</guid>
      <dc:creator>sb16031</dc:creator>
      <dc:date>2024-02-13T16:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Simple regression for animal feeding trial - help</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915898#M45446</link>
      <description>&lt;P&gt;This looks like you are on the right track. On quick review, I have two thoughts. First, consider whether you want to include a random intercept in the model. It's not necessarily required, just think about whether you expect random variation in the outcome variable at baseline, and whether you want to capture that variation in your model. Second, I can't tell exactly how your data is structured, but you might need to modify the subject= argument in the random statement. If it's the case that each pen has its own unique identifier, then what you have looks fine. But if the pen numbers are nested within block, i.e., there is a pen numbered 1 in block 1, block 2, etc., then consider subject = pen(block).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 18:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915898#M45446</guid>
      <dc:creator>Mike_N</dc:creator>
      <dc:date>2024-02-13T18:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Simple regression for animal feeding trial - help</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915927#M45447</link>
      <description>&lt;P&gt;Thank you for your very prompt feedback! To answer your questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) At the beginning of the trial, the birds are weighed and allocated to the treatments in a way that ensures no significant differences in BW at day 1. So at least the BW variable should be okay. There could be an inherent feed intake effect at baseline, but they're also genetically homogenous so barring any strange circumstance, they should be identical on that front too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) The pens are indeed unique, i.e. Block 1 has pens 1-8, Block 2 has pens 9-16, etc. I think the block variable is there for when studies have non-unique identifiers for pens, but that's not the case in this particular study.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I were to include a random intercept, would that be:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RANDOM int DAY/ SUBJECT=PEN TYPE = unr residual;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;or just&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RANDOM int / SUBJECT=PEN TYPE = unr residual;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 20:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915927#M45447</guid>
      <dc:creator>sb16031</dc:creator>
      <dc:date>2024-02-13T20:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Simple regression for animal feeding trial - help</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915931#M45448</link>
      <description>&lt;P&gt;You can specify the random effects either way; a single RANDOM statement that contains both int and day, or with a separate RANDOM statement for each effect.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 20:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simple-regression-for-animal-feeding-trial-help/m-p/915931#M45448</guid>
      <dc:creator>Mike_N</dc:creator>
      <dc:date>2024-02-13T20:58:01Z</dc:date>
    </item>
  </channel>
</rss>

