I have a set of data consisting of daily expenses for dairy cows for the first 4 years after they join the milking herd (at around 2 years of age). My objective is to compare 2 different breeds of cows for these daily expenses. I'm having a problem with 1 expense variable, growing cost, which is all assigned on day 1 after first calving, so most cows have a cost of around $1,425 on day 1 with a range of roughly $900 to $1,800. A value of $0 is assigned for every day of the rest of their lives (up to a max of 1461 days). Some cows had short lifespans and so may only have 100 days of lifetime; therefore, 100 rows in the data. Other cows lived all 4 years and so have 1461 rows, but again with only the growing cost on day 1. I want to assign a weight to every day of each cow's life, such that these 2 example cows have equal weight in the analysis. I did this simply by assigning dayweight=1/lifespan. However, when I run "WEIGHT dayweight;" in the model, I get back least squares means that are way to high and nonsensical. Here is my model statement code: proc hpmixed data=have; class herd breed sire; model growcost=herd breed; random sire(breed); test herd breed/htype=3; weight dayweight; lsmeans herd breed/pdiff; run;quit; My LSmeans without the weight statement make sense--Breed 1=$1.92 per day, Breed 2=$1.77 per day, and these very closely match the raw means. However, with using the WEIGHT statement, I get Breed 1=$24.81 per day, and Breed 2=$16.50 per day. What I am doing wrong? Thanks in advance for your suggestions!
... View more