Hello,
I am analyzing data from a multi-location trial (5 locations) to test the effectiveness of a treatment with 2 levels.
The design is RCB with 3-4 replications in every location.
I use the model below:
proc mixed data=mydata;
class location rep trt ;
model Y=trt/ddfm=kr2 residual;
random location rep(location ) trt(location );
lsmeans trt/pdiff;
estimate "Improved vs Control at loc1" trt -1 1 | trt(location ) -1 1 0 0 0 0 0 0 0 0;
estimate "Improved vs Control at loc2" trt -1 1 | trt(location ) 0 0 -1 1 0 0 0 0 0 0 ;
estimate "Improved vs Control at loc3" trt -1 1 | trt(location ) 0 0 0 0 -1 1 0 0 0 0 ;
estimate "Improved vs Control at loc4" trt -1 1 | trt(location ) 0 0 0 0 0 0 -1 1 0 0 ;
estimate "Improved vs Control at loc5" trt -1 1 | trt(location ) 0 0 0 0 0 0 0 0 -1 1 ;
estimate "Improved vs Control across locations" trt -5 5 | trt(location ) -1 1 -1 1 -1 1 -1 1 -1 1/divisor=5 ;
run;
I am interested in the trt effect across locations (that is why I used the random effects in the random statement).
The last estimate statement was used as a test to see if I would get exactly the same results with the LSMEANS.
But although the estimates are the same, the standard errors are different.
I thought they should be the same. Why the standard errors (and p-values) are different?
Does LSMEANS and ESTIMATE with random effect test something different?
Since I am interested in the trt difference across the locations (locations as random effect), which result should I choose?
Thank you
I am analyzing data from a multi-location trial (5 locations) to test the effectiveness of a treatment with 2 levels.
The design is RCB with 3-4 replications in every location.
I use the model below:
proc mixed data=mydata;
class location rep trt ;
model Y=trt/ddfm=kr2 residual;
random location rep(location ) trt(location );
lsmeans trt/pdiff;
estimate "Improved vs Control at loc1" trt -1 1 | trt(location ) -1 1 0 0 0 0 0 0 0 0;
estimate "Improved vs Control at loc2" trt -1 1 | trt(location ) 0 0 -1 1 0 0 0 0 0 0 ;
estimate "Improved vs Control at loc3" trt -1 1 | trt(location ) 0 0 0 0 -1 1 0 0 0 0 ;
estimate "Improved vs Control at loc4" trt -1 1 | trt(location ) 0 0 0 0 0 0 -1 1 0 0 ;
estimate "Improved vs Control at loc5" trt -1 1 | trt(location ) 0 0 0 0 0 0 0 0 -1 1 ;
estimate "Improved vs Control across locations" trt -5 5 | trt(location ) -1 1 -1 1 -1 1 -1 1 -1 1/divisor=5 ;
run;
I am interested in the trt effect across locations (that is why I used the random effects in the random statement).
The last estimate statement was used as a test to see if I would get exactly the same results with the LSMEANS.
But although the estimates are the same, the standard errors are different.
I thought they should be the same. Why the standard errors (and p-values) are different?
Does LSMEANS and ESTIMATE with random effect test something different?
Since I am interested in the trt difference across the locations (locations as random effect), which result should I choose?
Thank you