Hello, I would like to help for analyzing of database in dairy farms (Longitudinal analysis).
In my database, I have daily milk production for 115 days. However, some cows stop producing milk at 20d, 35d, 80 days (random days). Therefore, as time go on, naturally the cows production less milk until to stop completely the milk prodution.
Ex: On the first day I have 1000 cows producing milk. At the end of the 115 days, only 150 cows remain producing milk.
My greatest doubt occurs when an animal stops producing milk. As the cows are removed of the database (cows stop producing milk) the average from this moment changes (increases) causing to curve error (because the cows less productive stop the production).
How can I solve it?
PROC GLIMMIX DATA=Dairy.Cows;
CLASS ID Group Time;
MODEL MilkProduction = Group Time Group*Time / DDFM=KENWARDROGER DIST=GAUSSIAN ;
RANDOM Time / RESIDUAL TYPE=UN SUBJECT=ID(Group);
RUN;
![Data_Base.JPG Data_Base.JPG](https://communities.sas.com/t5/image/serverpage/image-id/27620i3656A93CB9ED5BD2/image-size/large?v=v2&px=999)