Statistical Consulting Topics RCBD with a covariate Goal: to determine the optimal level of feed additive to maximize the average daily gain of steers. VARIABLES Y = Average Daily Gain of steers for 160 days FACTOR = Diet (4 levels: 0, 10, 20, 30) BLOCK = Barn (8 levels, 4 animals in each barn) COVARIATE = initial weight BLOCK is random, and the other terms are fixed. We will assume a linear relationship between the covariate, or initial weight (iwt), and the response, average daily gain (adg). There were 32 steers altogether, randomly assigned to barns. Diet levels were randomly assigned to animals within each barn. The animals were individually fed over the 160 days. 1
We have 8 observations on each level of Diet (one from each barn). Observations within a barn are correlated. In this set-up, we get to compare treatments within a block (or barn) after accounting for the initial weight. adg 0.5 1.0 1.5 2.0 2.5 diet 0 diet 10 diet 20 diet 30 350 400 450 500 iwt Y ij = α i + β i x ij + b j + ɛ ij (1) where b j iid N(0, σ 2 b ) and ɛ ij iid N(0, σ 2 ɛ ) for i = 1, 2, 3, 4 and j = 1, 2,..., 8 α i intercept of i th diet β i slope of i th diet x ij iwt of the steer on diet i in block j b j random block effect 2
The non-common slope model SAS code for model with separately fit lines for diets: proc mixed data=gain; class trt blk; model adg=trt iwt iwt*trt/solution ddfm=satterth; **Subset of output follows** Covariance Parameter Estimates Cov Parm Estimate blk 0.2593 Residual 0.04943 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F trt 3 17.4 0.87 0.4751 iwt 1 17.6 10.69 0.0044 iwt*trt 3 17.4 0.93 0.4467 3
The common slope model SAS code for model with parallel lines for diets: proc mixed data=gain; class trt blk; model adg=trt iwt/solution ddfm=satterth; **Subset of output follows** Covariance Parameter Estimates Cov Parm Estimate blk 0.2408 Residual 0.05008 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F trt 3 20 10.16 0.0003 iwt 1 21.1 11.13 0.0031 4
The model with parallel lines is complex enough to capture the relationship between the variables. Solution for Fixed Effects Standard Effect trt Estimate Error DF t Value Pr> t Intrcpt 0.8011 0.3557 27 2.25 0.0326 trt 0-0.5521 0.1148 20-4.81 0.0001 trt 10-0.06857 0.1190 20.1-0.58 0.5708 tr 20-0.08813 0.1163 20-0.76 0.4574 trt 30 0.... iwt 0.002780 0.000833 21.1 3.34 0.0031 Parameters for the common slope model Thus, the common slope is 0.00278, and the intercepts are 0.2490, 0.7325, 0.7130, 0.8011, respectively. Because trt was significant, at least one of the lines is different from the others. 5
Though I ve plotted all 4 fitted lines below, some may not be significantly different from each other. adg 0.5 1.0 1.5 2.0 2.5 diet 0 diet 10 diet 20 diet 30 350 400 450 500 I ts common in an ANCOVA to report and compare the treatment groups at the average value of the covariate (shown above with dotted line). /*Get mean of covariate.*/ proc means data=gain; var iwt; Analysis Variable : iwt iwt N Mean Std Dev Minimum Maximum 32 389.5937500 62.5299203 308.0000000 499.00000 6
proc mixed data=gain; class trt blk; model adg=trt iwt/ solution ddfm=satterth; lsmeans trt/adjust=tukey at iwt=389.6; Least Squares Means Standard Effect trt iwt Estimate Error DF t Value Pr > t trt 0 389.60 1.3320 0.1907 9.02 6.98 <.0001 trt 10 389.60 1.8155 0.1914 9.13 9.49 <.0001 trt 20 389.60 1.7960 0.1908 9.04 9.41 <.0001 trt 30 389.60 1.8841 0.1923 9.29 9.80 <.0001 Differences of Least Squares Means Standard Effect trt trt iwt Estimate Error DF t Value trt 0 10 389.60-0.4835 0.1129 20-4.28 trt 0 20 389.60-0.4639 0.1121 19.9-4.14 trt 0 30 389.60-0.5521 0.1149 20-4.81 trt 10 20 389.60 0.01956 0.1122 19.9 0.17 trt 10 30 389.60-0.06857 0.1191 20.1-0.58 trt 20 30 389.60-0.08813 0.1164 20-0.76 7
Differences of Least Squares Means Effect trt _trt Pr > t Adjustment Adj P trt 0 10 0.0004 Tukey-Kramer 0.0019 trt 0 20 0.0005 Tukey-Kramer 0.0026 trt 0 30 0.0001 Tukey-Kramer 0.0006 trt 10 20 0.8634 Tukey-Kramer 0.9981 trt 10 30 0.5713 Tukey-Kramer 0.9382 trt 20 30 0.4577 Tukey-Kramer 0.8725 Diet 0 is statistically significantly different than the others. I should note that the LSMEANS statement would have compared the treatments at the average value of the covariate even without specifically asking for it. proc mixed data=gain; class trt blk; model adg=trt iwt/ solution ddfm=satterth; lsmeans trt/adjust=tukey; 8
If you ask for the LSMEANS of trt at iwt=0, you ll get the estimated intercepts: proc mixed data=gain; class trt blk; model adg=trt iwt/ solution ddfm=satterth; lsmeans trt/adjust=tukey at iwt=0; Standard Effect trt iwt Estimate Error DF t Value Pr > t trt 0 0.00 0.2490 0.3806 27 0.65 0.5185 trt 10 0.00 0.7325 0.3935 26.9 1.86 0.0737 trt 20 0.00 0.7130 0.3858 26.9 1.85 0.0756 trt 30 0.00 0.8011 0.3584 27 2.24 0.0339 9
Dose-Response Curve Because the levels of the factor of interest actually represents a quantitative value, we can model this with a trend or dose-response curve (rather than doing pairwise comparisons of the four levels). The relationship between the covariate and adg is still linear, but the relationship between diet level and adg can be fit with a polynomial. adg(lsmean at x=389.6) 1.4 1.5 1.6 1.7 1.8 1.9 0 5 10 15 20 25 30 trt 10
proc mixed data=gain; class trt blk; model adg=trt iwt/solution ddfm=satterth; estimate linear trt -3-1 1 3; estimate quad trt -1 1 1-1; estimate cubic trt -1 3-3 1; Estimates Standard Label Estimate Error DF t Value Pr > t linear 1.6367 0.3641 20 4.49 0.0002 quad 0.3954 0.1649 20 2.40 0.0264 cubic 0.6108 0.3538 19.9 1.73 0.0998 The results suggest a quadratic is sufficient for modeling the trend. The quadratic model proc mixed data=gain; class blk; model adg=trt trt*trt iwt/solution ddfm=satterth; 11
adg(lsmean at x=389.6) 1.4 1.5 1.6 1.7 1.8 1.9 0 5 10 15 20 25 30 trt But, perhaps a threshold model or piece-wise linear might also work well. We would need more levels of the additive to get at comparing such models. 12