1

Unit 9

1."Perform a one-way ANOVA on the six Diets. Use Fisher's LSD method to find the pattern of differences."

The results of the one-way ANOVA are as follows:

For stacked data

MTB > name c1 'WtGain"

MTB > set c1

DATA> 73 102 118 104 81 107 100 87 117 111

DATA> 90 76 90 64 86 51 72 90 95 78

DATA> 98 74 56 111 95 88 82 77 86 92

DATA> 107 95 97 80 98 74 74 67 89 58

DATA> 94 79 96 98 102 102 108 91 120 105

DATA> 49 82 73 86 81 97 106 70 61 82

DATA> end

MTB > name c2 'Diet'

MTB > set c2

DATA> (1:6)10

DATA> end

MTB > onew c1 c2

One-way ANOVA: WtGain versus Diet

Source DF SS MS F P

Diet 5 4613 923 4.30 0.002

Error 54 11586 215

Total 59 16199

S = 14.65 R-Sq = 28.48% R-Sq(adj) = 21.85%

(CIs as shown below.)

For unstacked data with appropriate column names:

One-way ANOVA: Beef/High, Beef/Low, Cereal/High, Cereal/Low, Pork/High, ...

Source DF SS MS F P

Factor 5 4613 923 4.30 0.002

Error 54 11586 215

Total 59 16199

S = 14.65 R-Sq = 28.48% R-Sq(adj) = 21.85%

Individual 95% CIs For Mean Based on

Pooled StDev

Level N Mean StDev -+------+------+------+------

Beef/High 10 100.00 15.14 (------*------)

Beef/Low 10 79.20 13.89 (------*------)

Cereal/High 10 85.90 15.02 (------*------)

Cereal/Low 10 83.90 15.71 (------*------)

Pork/High 10 99.50 10.92 (------*------)

Pork/Low 10 78.70 16.55 (------*------)

-+------+------+------+------

70 80 90 100

The p-value for the for diet factor is .002, indicating that diet is signficant at the 5% level. Performing

By hand Fisher's LSD is LSD = t*[2MSD/n]1/2 = 2.005[215/5]1/2 = 13.15, where t* = 2.005 is based on 54 df. Notice that, within rounding error, the width of each CI in the Minitab printout below is double the LSD.
For example, in the first CI below: |33.93 – 7.67|/2 = 13.13.

Fisher LSD comparisons among the 6 diets results in the following:

Fisher 95% Individual Confidence Intervals

All Pairwise Comparisons

Simultaneous confidence level = 64.68%

Beef/High subtracted from:

Lower Center Upper ------+------+------+------+--

Beef/Low -33.93 -20.80 -7.67 (------*-----)

Cereal/High -27.23 -14.10 -0.97 (------*------)

Cereal/Low -29.23 -16.10 -2.97 (------*------)

Pork/High -13.63 -0.50 12.63 (------*-----)

Pork/Low -34.43 -21.30 -8.17 (-----*------)

------+------+------+------+--

-20 0 20 40

Beef/Low subtracted from:

Lower Center Upper ------+------+------+------+--

Cereal/High -6.43 6.70 19.83 (-----*------)

Cereal/Low -8.43 4.70 17.83 (-----*------)

Pork/High 7.17 20.30 33.43 (-----*------)

Pork/Low -13.63 -0.50 12.63 (------*-----)

------+------+------+------+--

-20 0 20 40

Cereal/High subtracted from:

Lower Center Upper ------+------+------+------+--

Cereal/Low -15.13 -2.00 11.13 (------*------)

Pork/High 0.47 13.60 26.73 (------*-----)

Pork/Low -20.33 -7.20 5.93 (-----*------)

------+------+------+------+--

-20 0 20 40

Cereal/Low subtracted from:

Lower Center Upper ------+------+------+------+--

Pork/High 2.47 15.60 28.73 (------*-----)

Pork/Low -18.33 -5.20 7.93 (-----*------)

------+------+------+------+--

-20 0 20 40

Pork/High subtracted from:

Lower Center Upper ------+------+------+------+--

Pork/Low -33.93 -20.80 -7.67 (------*-----)

------+------+------+------+--

-20 0 20 40

The differences that do not contain 0 and are, thus, significant at the 5% confidence level are the following:

Diet 1 vs. Diets 2, 3, 4, 6

Diet 2 vs. Diet 5

Diet 3 vs. Diet 5

Diet 4 vs. Diet 5

Diet 5 vs. Diet 6

This result may be graphically represented as:

6 2 4 3 5 1

2."Find a complete set of 5 orthogonal contrasts corresponding to Kind (2 df: meats vs. cereal, beef vs. pork), Amount (1 df: high vs low), and Interaction (2 df). Partition the one-way SS(Diet) from Problem 1 into 5 corresponding parts. Test each of these contrasts as pre-chosen."

Contrast

1. Meat vs. Cerealc1 = (1, 1, -2, -2, 1, 1)

2. Beef vs. Porkc2 = (1, 1, 0, 0, -1, -1)

3. High vs. Lowc3 = (1, -1, 1, -1, 1, -1)

4. Interaction1c4 = (1, -1, 0, 0, -1, 1).

5. Interaction 2c5 = (1, -1 , -2 , 2 , 1, -1)

Prove orthogonality:

Contrasts 1 vs. 2:(1)(1) + (1)(1) + (-2)(0) + (-2)(0) + (1)(-1) +(1)(-1) = 1+1+0+0-1-1 = 0

Contrasts 2 vs. 3:(1)(1) + (1)(-1) + (0)(1) + (0)(-1) + (-1)(1) + (-1)(-1) = 1-1+0+0-1+1 = 0

Contrasts 3 vs. 4:(1)(1) + (-1)(-1) + (1)(0) + (-1)(0) + (1)(-1) + (-1)(1) = 1+1+0+0-1-1= 0

Contrasts 4 vs. 5:(1)(1) + (-1)(-1) + (0)(-2) + (0)(2) + (-1)(1) + (1)(-1) = 1+1+0+0-1-1=0

K1 = 12 + 12+ -22+ -22+ 12+ 12 = 1+1+4+4+1+1 = 12

K2 = 12 + 12+ 02+ 02+ -12+ -12 = 1+1+0+0+1+1 = 4

K3 = 12 + -12+ 12+ -12+ 12+ -12 = 1+1+1+1+1+1 = 6

K4 = 12 + -12+ 02+ 02+ -12+ 12 = 1+1+0+0+1+1 = 4

K5 = 12 + -12+ -22+ 22+ 12+ -12 = 1+1+4+4+1+1 = 12

n = 10

H1 = (1)(100.0) + (1)(79.2) + (-2)(85.9) + (-2)(83.9) + (1)(99.5) + (1)(78.7) = 17.8

H2 = (1)(100.0) + (1)(79.2) + (0)(85.9) + (0)(83.9) + (-1)(99.5) + (-1)(78.7) = 1.0

H3= (1)(100.0) + (-1)(79.2) + (1)(85.9) + (-1)(83.9) + (1)(99.5) + (-1)(78.7) = 43.6

H4 = (1)(100.0) + (-1)(79.2) + (0)(85.9) + (0)(83.9) + (-1)(99.5) + (1)(78.7) = 0.0

H5 = (1)(100.0) + (-1)(79.2) + (-2)(85.9) + (2)(83.9) + (1)(99.5) + (-1)(78.7) = 37.6

Q1 = 10*17.82/12 = 264.0

Q2 = 10*1.02/4 = 2.5

Q3 = 10*43.62/6 = 3168.3

Q4 = 10*0.0 2/4 = 0

Q5 = 10*37.62/12 = 1178.1

SS(Diet) = Q1 + Q2 + Q3 + Q4 + Q5 = 264.0 + 2.5 + 3168.3 + 0 + 1178.1 = 4612.9

Note that this is approximately equal to the SS(Factor) = 4613 from the ANOVA output.

From the ANOVA, MSE = 215 and DF(Error) = 54. The contrasts will be compared to F*(.05,1,54) = 4.02.

Testing the contrasts:

Q1/MSE = 264.0/215 = 1.23

Q2/MSE = 2.5/215 = .01

Q3/MSE = 3168.3/215 = 14.74

Q4/MSE = 0/215 = 0

Q5/MSE = 1178.1/215 = 5.48

Two contrasts are significant (Q/MSE > F*): High vs. Low, and the interaction between High/Low and Meat/Cereal.

3."Perform a two-way ANOVA with Kind (3 levels), Amount (2 levels) and interaction. Show the connection between the components of your five contrasts and the SSs in the two-way ANOVA table."

MTB > name c3 'Source'

MTB > set c3

DATA> (1:3)20

DATA> end

MTB > name c4 'Level'

MTB > set c4

DATA> 3(1:2)10

DATA> end

MTB > anova c1 = c3|c4

The results of the ANOVA are as follows (where indexes have been given names, rather than numbers as above):

ANOVA: Response versus Kind, Amount

Factor Type Levels Values

Kind fixed 3 Beef, Cereal, Pork

Amount fixed 2 High, Low

Analysis of Variance for Response

Source DF SS MS F P

Kind 2 266.5 133.3 0.62 0.541

Amount 1 3168.3 3168.3 14.77 0.000

Kind*Amount 2 1178.1 589.1 2.75 0.073

Error 54 11586.0 214.6

Total 59 16198.9

S = 14.6477 R-Sq = 28.48% R-Sq(adj) = 21.85%

Expected Mean

Square for

Each Term

(using

Variance Error restricted Unrestricted model gives no

Source component term model) coefficients, same F-ratios

1 Kind 4 (4) + 20 Q[1]

2 Amount 4 (4) + 30 Q[2]

3 Kind*Amount 4 (4) + 10 Q[3]

4 Error 214.6 (4)

Consistent with the contrast calculations, High vs. Low is significant with a p-value of .000 and Beef vs. Pork vs. Cereal is not significant, with a p-value of .541. The interaction term is "nearly" significant with a p-value of .073.

One of the interaction contrasts tested above was significant; the other is not. The borderline result for interaction here results from considering ("averaging") both contrasts together. Beef and Pork behave almost identically at both levels. The prior knowledge that Beef and Pork may more similar than either is to Cereal allows for formation of a significant contrast.

The interaction plots are shown below.

(Broken line traces for Beef and Pork against Level are almost identical.)


Incidentally, note that a normality plot of the residuals does not indicate that the null hypothesis of normality should be rejected, with a p-value of .434 for the Anderson-Darling test.:

4."Test the ad hoc contrast that compares the average of beef and pork at high levels with the average of the other four diets. Is this contrast significant at the 5% level?"

This is pretty clearly a contrast inspired by the data. It seems unlikely someone would wonder before seeing the data about this particular fusion of Kinds and Amounts.

Based on the factor Diets (6 levels, DF=5), this contrast would be (2, -1, -1, -1, 2, -1)

K = 22 + -12+ -12+ -12+ 22+ -12 = 4+1+1+1+4+1 = 12

H = (2)(100.0) + (-1)(79.2) + (-1)(85.9) + (-1)(83.9) + (2)(99.5) + (-1)(78.7) = 71.3

n = 10

Q = 10*71.32/12 = 4236.4

Q/MSE = 4236.4/214.6 = 19.74

Since Q/MSE > (t – 1) F*(.05, 5,54) = 5(2.38607) = 11.93, this contrast is significant at the 5% level.

Copyright © 2005, 2008 by Bruce E. Trumbo. All rights reserved. Intended primarily for use in Stat 6305 at CSU East Bay.
This is a draft. Corrections and suggestions appreciated: .
Based in part on notes provided by Elizabeth Ellinger.