Analysis of Covariance Comparison of Head-Lengths for Trout from 2 Lakes Source: C. McC. Mottley (1941). “The Covariance Method of Comparing the Head-Lengths of Trout From Different Environments,” Copeia, Vol.1941, #3, pp.154-159. Analysis of Covariance • Goal: To Compare 2 or More Group/Treatment Means for One Variable, after controlling for one or more concomitant variables/Covariates • Procedure: Fit a Regression Model Relating Response to Group (Using Dummy Variables) and Covariate(s) • Adjusted Means: Fitted Values from regression for each group evaluated at common value(s) of covariate(s), typically at the mean value(s) • Treatments can be combinations of factors in a Factorial Structure • Model: Yij i 1 X 1ij X 1.. k X kij X k .. eij Example – Fale Trout Heads from 2 Lakes (Environments) • • • • • • • Units: Female Fish Sampled from Lakes Response Variable: Head Length (mm) Groups: Environments (Kootenay Lake, Wilson Lake) Covariate: Standard-Length (mm) Samples: n1 = 50 from Kootenay, n2 = 10 from Wilson Transformation: Base10 logarithms of Head-Length and Fish-Length Taken for Biological Reasons Summary Statistics: Lake Head Mean Head SD Fish Mean Fish SD Correlation Kootenay 1.7939 0.1761 2.4488 0.1731 0.9884 Wilson 1.7431 0.0750 2.3821 0.0806 0.9814 Overall 1.7854 0.1642 2.4377 0.1628 0.9875 T-test – Ignoring Covariate Step 1 : Test for Equal Variance ( 0.05) : H 0 : 12 22 T .S . : Fobs H A : 12 22 S12 (0.1761) 2 1 2 5 . 519 0.181 S 2 (0.0750) 2 Fobs Decision Rule : Conclude Variances are Equal (Do not reject H 0 ) unless : Fobs F.025, 49,9 3.475 12 22 1 F.025,9, 49 2.387 12 22 Fobs Conclude variances differ, Do not Pool Variances and use degrees of freedom (Satterthw aite) : 2 df 2 S12 S 22 (0.1761) 2 (0.0750) 2 n n 50 10 2 1 (0.0750) 2 10 S12 n1 S 22 n2 (0.1761) 2 50 50 1 10 1 n1 1 n2 1 (.001182) 2 32.6 32 4.29268E - 08 T-test – Ignoring Covariate Step 2 : Test for Equal Means ( 0.05) : H 0 : 1 2 H A : 1 2 T .S . : tobs y1 y 2 S12 S 22 n1 n2 1.7939 - 1.7431 (0.1761) 2 (0.0750) 2 50 10 R.R. : tobs t.025,32 2.04 P - value : 2 P t 1.47 .1513 Do not conclude means differ. 0.0508 1.47 0.0344 Note : z.025 1.96 Note : 2 P z 1.47 2(.0708) .1416 Adjusting for Body Length Model : Yij i X ij X .. eij 1 K ij 2Wij 3 X ij X .. eij i 1,2 j 1,..., ni where : Yij Log 10 (Head Length) for jth fish from Lake i K ij 1 if Kootenay Lake (i 1), 0 otherwise Wij 1 if Wilson Lake (i 2), 0 otherwise X ij Log 10 (Body Length) for jth fish from Lake i X .. 2.4377 Wilson Kootenay BodyLng Coefficients 1.7988 1.7827 1.0021 Standard Error 0.00818 0.00363 0.02073 t Stat 219.9 491.3 48.3 P-value 0.0000 0.0000 0.0000 Adjusted Means • Goal: Compare Means Head Lengths after adjusting for Body Lengths • Start with the Unadjusted Mean, and Subtract off the product of the slope from the regression and the difference between the group mean and the overall mean for the covariate. Effect of adjustment (assuming positive slope): – Adjust down for groups with high levels of covariate – Adjust up for groups with low levels of covariate Y Adj i ^ Y i. X i. X .. Trout Head-Length Data Y 1. 1.7939 X 1. 2.4488 Y 2. 1.7431 X 2. 2.3821 ^ 1.0021 X .. 2.4377 Y Adj 1. 1.7939 1.0021(2.4488 2.4377) 1.7828 Y Adj 2. 1.7431 1.0021(2.3821 2.4377) 1.7988 Plot of Regression and Means (Adjusted and Unadjusted) 2.2000 2.1000 Head Length 2.0000 Wilson Kootenay Wilson-Unadj Kootenay-Unadj Wilson-Adj Kootenay-Adj 1.9000 1.8000 1.7000 1.6000 1.5000 2.25 2.3 2.35 2.4 2.45 2.5 Body Length 2.55 2.6 2.65 2.7 2.75 Testing for Lake Effect, Controlling for Body Length • • • • Null Hypothesis: No difference in mean head lengths for 2 lakes, controlling for Body Length (12) Alternative Hypothesis: Lake Means Differ (1≠2) Step 1: Fit Full Model Under HA and obtain SSE(F), dfE(F) Step 2: Place Restriction under H0 and fit model forcing 12 and obtain SSE(R) and dfE(R) : Reduced Model : Yij 1Wij 1 K ij 3 X ij X .. eij Yij 1 Wij K ij 3 X ij X .. eij 1U ij 3 X ij X .. eij where : U ij Wij K ij Then : The test Statistic is : Fobs SSE ( R) SSE ( F ) df ( R) df ( F ) E E MSE ( F ) Trout Head Size Data ANOVA for Full Model: Regression Residual Total ANOVA for Reduced Model: df 3 57 60 SS 192.8131702 0.037372459 192.8505427 df SS MS 2 192.8111 96.40553 Residual 58 0.03949 0.000681 Total 60 192.8505 Regression MS 64.27105674 0.000655657 SSE ( R) SSE ( F ) 0.03949 0.03737 df ( R) df ( F ) .00212 58 57 E E TS : Fobs 3.23 MSE ( F ) 0.000656 .000656 RR : Fobs F.05,1,57 4.010 P - Value : PF 3.23 .0776