BookmarkSubscribeRSS Feed
ghannah5
Calcite | Level 5

Hello,

I am analysing the interaction of lunar phases on feed intake(DMINT), water intake(WI), milk yield(MY) and body weight (Live_wgt) on cattle. I have data from 2012-2016. There are +-200 cows. The cows are divided into two genetic groups (C and S), then they are subdivided into 2 feeding type groups (XB and XH). I am trying to see if there is a significant interaction between LunarPhase and the 4 variables or could this interaction be an effect of the variables on each other.  My data is unbalanced, so proc mixed was seen as a more useful procedure. There are fixed effects: Eartag (animal ID),  Date, Parity(LactNo) Days in milk (DIM) Season, Year, system (Genetic group*feeding type), and Weight (live_wgt).  With focusing on feed intake (DMINT) as an example, I have been using the code;

 

proc mixed data=MYdata PLOTS (maxpoints=9000);

class EARTAG Date LunarPhase Season DIM Year Lactno System Live_weight;

model DMINT=LunarPhase DIM Season*Year Lactno System Live_weight/ s;

random EARTAG*Lactno;

run;

 

Now my question is that when I am trying to look at the relationship and add MY to my model it says that there is an error issue. How do I make this code work, what am I doing wrong, what procedure could I use to fix this?

10 REPLIES 10
Rajesh3
Obsidian | Level 7

If I am understanding you correctly, you are trying to add 'MY' next to 'DMINT' in the model statement. If this is the case, the syntax is wrong. You need to use different models for different outcomes: feed intake(DMINT), water intake(WI), milk yield(MY) and body weight (Live_wgt). The outcomes need to be continuous. In other words, you cannot simultaneously examine the effect of lunar phase / other interactions on all outcomes at once. 

 

Thanks,

Rajesh.

ghannah5
Calcite | Level 5
Basically I know through literature that milk yield is effected by DMINT
and LunarPhase has an effect with DMINT. So how would I include that in my
model? Or should I just create another model in order to analyse this
relationship between DMINT and MY?
Rajesh3
Obsidian | Level 7

Yeah. You would need to use two different models for your hypotheses.

 

One would be MY=DMINT (Hypothesis: DMINT has an effect on MY). I think you already have the second one.

 

Thank you,

Rajesh. 

Pepeta
Calcite | Level 5
I have conducted a study on checking the effect of of 4 stocking rates (1 animal per pen, 2 animals per pen, 4 Animals per pen and 8 animals per pen) on feed intake. I had 3 feeds offered at the same quantity on a pen with same space on 4 periods. I wamt to know how stocking rate affected feed intake of each feed. Periods are repeated measures and grouping of animals is random, I have animal Identies for each period . How can I go about the commands.
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

If you have a new question, I recommend starting a new thread. If you tap into an old thread, especially if it has already been answered, people may overlook your question.

 

Do you have intake data for each of the 3 feeds for each animal for each period, or do you have intake data for each of the 3 feeds for each pen for each period?

 

Was the amount of feed provided in the pen with 8 animals the same absolute quantity as the amount in the pen with 1 animal, or was it 8 times the amount? Did each pen eat appreciably less than the amount of each feed provided, or did the amount of feed provided impose some sort of constraint on consumption? For example, the pen ate all of its favorite feed and then moved to a less favored feed.

 

Are you pondering feed preference (in other words, preferential consumption of some feeds over others) as a consequence of stocking rate, as opposed to total consumption as a consequence of stocking rate? Do you plan to analyze consumption/preference of each feed separately? Or are you looking at compositional consumption (in other words, joint consumption of the three feeds, which might be thought of as diet allocation)?

 

How many pens did you have for each stocking rate?

 

In this study, pen is the experimental unit for stocking rate. It is not uncommon for people to think of animal as the experimental unit, but that is an incorrect assumption. Consequently, any measurements that you have on individual animals within a pen should be considered to be subsamples rather than true replicates. Plus, typically in studies like this, you have consumption by pen and not by individual animal within a pen.

 

Once we have a better understanding of your study, we can help you with your code. But you'll need to show what you've tried so far to give us something to work from.

 

And I have to ask, without intending to be mean but intending to point out the importance of planning ahead, Why did you not think about analysis before you collected your data? (You are definitely not alone in that approach, but it really is not in anyone's best interest.)

 

I hope this provides some clarity. Please follow up as need be.

 

 

Pepeta
Calcite | Level 5
I am looking at diet selection the proportion of each feed consumes. The feeds were provided ad libitum they were offered in the morning and feeders were filled up in the evening to ensure adlibitum availability. There was one pen per stocking rate.
The commands i wrote are as follows:

DATA Pepeta;
Input ........period treatment initial body weight group animalID proportionEaten feed;
Cards;
.
.
.
;
run;
Proc sort;
by feed;
Proc mixed data = Pepeta;
Class period animlID treat;
Model proportionEaten = treat Initial body weight;
By feed;
Eandom group (anImalID);
Repeated period:;.lsmeans treat/pdiff adjust=Tuckey;
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

You say that there was one pen per stocking rate. To clarify, does that mean that you had 4 pens in total, and 1 + 2 + 4 + 8 = 15 animals?

SteveDenham
Jade | Level 19

This is going to sound harsh, but you have no ability to estimate the error around the experimental unit with only one observation per unit.  Unless I misunderstood your design, you have a total of four pens, each with a different number of animals. Any results you get by considering animal as the experimental unit are likely to be suspect.

Additionally, your response variable is a proportion, not an amount, so the variable likely has a beta distribution (ratio of two random variables) rather than a distribution with normal random errors (Gaussian). Consider modeling amount of each feed type per head per day.

 

But the real issue is replication.  Unless you replicate the experimental units, your analysis is going to be suspect.  This was the point @sld made.

 

SteveDenahm

SteveDenham
Jade | Level 19

Sheesh.  Always read before hitting send.

I said: "you have no ability to estimate the error around the experimental unit with only one observation per unit."

I should have said: you have no ability to estimate the error associated with treatment effects based on the pen as the experimental unit with only one pen per treatment.

 

And an answer to @sld 's question would really help us help you.

 

SteveDenham

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 1951 views
  • 2 likes
  • 5 in conversation