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?
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.
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.
You could consider a structural equation model; for an example, see Implementing structural equation models to observational data from feedlot production systems.
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.
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?
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
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.