Solution file for additional exercise 7.1 ----------------------------------------- Data: measurements of 6 male and 6 female rat's consumption (in g) of fat (fresh or rancid). Notation: y_i = consumption for i'th rat, i=1,...,12, or y_ijk = consumption for k'th rat in gender group i and fat type group j i=f,m; j=f,r; k=1,2,3. The design would usually be considered as a block design because gender is inherent in the animals and cannot be randomised (thus, the randomisation is within gender groups and consists in randomly allocating the 6 rats of each gender to the two types of fat). Despite of gender being a blocking factor, there is probably real interest in gender and its interaction with fat type should be included in the full model. The statistical model is y_i = mu + alpha_gender(i) + beta_fat(i) + gamma_gender*fat(i) + eps_i, or y_ijk = mu + alpha_i + beta_j + gamma_ij + epsilon_ijk, depending on the chosen notation. MTB > WOpen "H:\VHM\VHM802\Data_csv\hs07_1.csv"; SUBC> FType; SUBC> CSV; SUBC> DecSep; SUBC> Period; SUBC> Field; SUBC> Comma; SUBC> TDelimiter; SUBC> DoubleQuote. Retrieving worksheet from file: ‘H:\VHM\VHM802\Data_csv\hs07_1.csv’ Worksheet was saved on 17/02/2011 MTB > Name C4 "SRES". MTB > GLM; SUBC> Response 'consum'; SUBC> Nodefault; SUBC> Categorical 'gender' 'fat'; SUBC> Terms gender fat gender*fat; SUBC> Means gender fat gender*fat; SUBC> TExpand; SUBC> TMethod; SUBC> TAnova; SUBC> TSummary; SUBC> TCoefficients; SUBC> TFactor; SUBC> TDiagnostics 0; SUBC> Rtype 2; SUBC> GFOURPACK; SUBC> SResiduals 'SRES'. General Linear Model: consum versus gender, fat Method Factor coding (-1, 0, +1) Factor Information Factor Type Levels Values gender Fixed 2 f, m fat Fixed 2 f, r Analysis of Variance Source DF Seq SS Contribution Adj SS Adj MS F-Value P-Value gender 1 3780.7 4.87% 3780.8 3780.8 2.59 0.146 fat 1 61204.1 78.90% 61204.1 61204.1 41.97 0.000 gender*fat 1 918.8 1.18% 918.8 918.8 0.63 0.450 Error 8 11666.7 15.04% 11666.7 1458.3 Total 11 77570.3 100.00% S R-sq R-sq(adj) PRESS R-sq(pred) 38.1881 84.96% 79.32% 26250 66.16% Coefficients Term Coef SE Coef 95% CI T-Value P-Value VIF Constant 597.7 11.0 (572.3, 623.2) 54.22 0.000 gender f -17.8 11.0 (-43.2, 7.7) -1.61 0.146 1.00 fat f 71.4 11.0 ( 46.0, 96.8) 6.48 0.000 1.00 gender*fat f f -8.8 11.0 (-34.2, 16.7) -0.79 0.450 1.00 Means Fitted Term Mean SE Mean gender f 580.0 15.6 m 615.5 15.6 fat f 669.2 15.6 r 526.3 15.6 gender*fat f f 642.7 22.0 f r 517.3 22.0 m f 695.7 22.0 m r 535.3 22.0 Residual Plots for consum MTB > FacPlot 'consum'; SUBC> Factors gender fat; SUBC> GMain; SUBC> GInt; SUBC> Full. Main Effects Plot for consum Interaction Plot for consum MTB > PPlot 'SRES'; SUBC> Normal; SUBC> Symbol; SUBC> FitD; SUBC> Grid 2; SUBC> Grid 1; SUBC> MGrid 1. Probability Plot of SRES The P-value for the Anderson-Darling test for normality is 0.775. Comments: --------- The analysis shows a clearly nonsignificant interaction (F=0.63), an also nonsignificant main effect of gender (F=2.59,P=0.15), and a strongly significant effect of fat type (F=42.0,P<0.001). The residuals look quite good, there is no sign of heteroscedasticity (tests for equal variance are clearly nonsignificant; not shown), and the normal plot is reasonably straight for only 12 observations (and the P-value for the normality test is large). None of the residuals are getting close to critical. Thus, there may be slight indication of larger consumption for males than females, but it is far from significant. There is clear evidence of different consumption of rancid and fresh fat, we give 95% confidence intervals: fresh: 669.2 +- 2.306*15.59 = 669.2 +- 36.0 rancid: 526.3 +- 2.306*15.59 = 526.3 +- 36.0 (the value 2.306 is the t* value (97.5 percentile) of the t(8) distribution)