30
6.1 Topic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section 15.8] 6. 1. Variability in the completely randomized design (CRD) In the CRD it is assumed that all experimental units are uniform. This is not always true in practice, and it is necessary to develop methods to deal with such variability. When comparing two methods of fertilization, if one region of the field has much greater natural fertility than the others, a treatment effect might be incorrectly ascribed to the treatment applied to that part of the field, leading to a Type I error. For this reason, when conducting a CRD, it is always advocated to include as much of the native variability of the experiment as possible within each experimental unit (e.u.), making each e.u. as representative of the whole experiment, and the whole experiment as uniform, as possible. In actual field studies, plots are designed to be long and narrow to achieve this objective. But if the e.u. are more variable, experimental error (MSE) is larger, F (MST/MSE) is smaller, and the experiment is less sensitive. And if the experiment is replicated in a variety of situations to increase its scope the variability increases even further. This additional variability needs to be removed from the analysis so that the actual effects of the treatment can be detected. This is the purpose of blocking. 6. 2. Randomized complete block design (RCBD) 6. 2. 1. Definition The RCBD assumes that a population of experimental units can be divided into a number of relatively homogeneous subpopulations or blocks. The treatments are then randomly assigned to experimental units such that each treatment occurs equally often (usually once) in each block –i.e. each block contains all treatments. Blocks usually represent levels of naturally occurring differences or sources of variation that are unrelated to the treatments. In the analysis, the variation among blocks can be partitioned out 1

Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

  • Upload
    ngotram

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.1

Topic 6. Randomized Complete Block Design (RCBD)[ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section 15.8]

6. 1. Variability in the completely randomized design (CRD)In the CRD it is assumed that all experimental units are uniform. This is not always true in practice, and it is necessary to develop methods to deal with such variability. When comparing two methods of fertilization, if one region of the field has much greater natural fertility than the others, a treatment effect might be incorrectly ascribed to the treatment applied to that part of the field, leading to a Type I error. For this reason, when conducting a CRD, it is always advocated to include as much of the native variability of the experiment as possible within each experimental unit (e.u.), making each e.u. as representative of the whole experiment, and the whole experiment as uniform, as possible. In actual field studies, plots are designed to be long and narrow to achieve this objective. But if the e.u. are more variable, experimental error (MSE) is larger, F (MST/MSE) is smaller, and the experiment is less sensitive. And if the experiment is replicated in a variety of situations to increase its scope the variability increases even further. This additional variability needs to be removed from the analysis so that the actual effects of the treatment can be detected. This is the purpose of blocking.

6. 2. Randomized complete block design (RCBD)6. 2. 1. Definition The RCBD assumes that a population of experimental units can be divided into a number of relatively homogeneous subpopulations or blocks. The treatments are then randomly assigned to experimental units such that each treatment occurs equally often (usually once) in each block –i.e. each block contains all treatments. Blocks usually represent levels of naturally occurring differences or sources of variation that are unrelated to the treatments. In the analysis, the variation among blocks can be partitioned out of the experimental error (MSE), thereby reducing this quantity and increasing the power of the test.

6. 2. 2. Example: Consider a field trial comparing three cultivars (A, B, and C) of sugar beet with four replications (in this case, the field is divided into 12 plots; each plot is a replication / e.u.). Suppose the native level of soil nitrogen at the field site varies from high at the north end to low at the south end. In such situation, yield is expected to vary from one end of the field to the other, regardless of cultivar differences. This violates the assumption that the error terms are randomly distributed since the residuals will tend to be positive at the north end of the field and negative at the south end.

North end of field Hi N

1 2 3

4 5 6

1

Page 2: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.2

7 8 9

10 11 12South end of field Low N

One strategy to minimize the impact of this variability in native soil fertility on the analysis of treatment effects is to divide the field into four east-west blocks of three plots each.

Block North end of field Hi N

1 1 2 3

2 1 2 3

3 1 2 3

4 1 2 3South end of field Low N

Because these blocks run perpendicular to the nitrogen gradient, the soil within each of these blocks will be relatively uniform. This is the basic idea of the randomized complete block design. Remember that in the completely randomized design (CRD), each e.u. in the experiment has an equal chance of being assigned any treatment level (i.e. a single randomization is performed for the entire experiment). This is not the case in an RCBD. In the randomized complete block design (RCBD), each e.u. in a given block has the same chance of being chosen for each treatment (i.e. a separate randomization is performed for each block). Within each block, a fixed number (often 1) of e.u.'s will be assigned to each treatment level. The term "complete" refers to the fact that all treatment levels are represented in each block (and, by symmetry, that all blocks are represented in each treatment level).

After the four separate randomizations, one for each block, the field could look like this:

Block North end of field Hi N

1 B A C

2 A B C

3 A C B

4 A C BSouth end of field Low N

2

Page 3: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.3

6. 2. 3. The linear model

In the case of a single replication per block-treatment combination (like the example above), the underlying linear model that explains each observation is:

Yij = + i + j + ij.

Here, as before, i represents the effect of treatment i (i= 1,…, t) such that the average of each treatment level is . In a similar way, j represents the effect of Block j (j = 1, ..., r). , such that the average of each block is . As always, ij are the residuals, the deviations of each observation from their expected values. The model in dot notation:

And the sum of squares:

or, TSS = SST + SSB + SSE.

Since the variance of means of n observations is 2/n, the coefficients r and t (within SST and SSB respectively) ensure that all mean squares are estimates of the same 2 when there are no block or treatment effects. This is another example of partitioning of variance, made possible because the sums of squares of blocks and treatments are orthogonal to one another. This orthogonality is a direct result of the balanced presence of all treatments in each block.

6. 2. 4. ANOVAANOVA table for the RCBD (one replication per block-treatment combination).

Source df SS MS FBlocks r - 1 SSB SSB/(r-1)Treatments t - 1 SST SST/(t-1) MST/MSEError (r-1)(t-1) TSS-SST-SSB SSE/(r-1)(t-1)Total rt – 1 TSS

ANOVA table for the CRD

Source df SS MS FTreatments t - 1 SST SST/(t-1) MST/MSEError t(r - 1) TSS - SST SSE/r(t-1)Total rt – 1 TSS

3

Page 4: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.4

Due to the additional factor in the linear model, the ANOVA table for the RCBD has an additional row (Block) relative to that for the CRD.

Notice that one consequence of this is that there are fewer degrees of freedom for error in the RCBD design than in the CRD design [(r-1)(t-1) vs. t(r-1), or (r - 1) fewer degrees of freedom].

In the RCBD, these (r – 1) degrees of freedom have been partitioned from the error and assigned to the blocks.

4

Page 5: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

> 0

0

Power1 – β

distribution of the difference between two means (RCBD and CRD).

α/2

β

MSERCBD=MSECRD

df MSE: CRD > RCBDCritical F: RCBD > CRD

Rejection threshold RCBD

Rejection threshold CRD

When there are no significant differences among blocks power CRD > power RCBD

6.5

Situation 1: No differences among blocks (i.e. no block effects)

If the RCBD design were applied to an experiment in which the blocks were really no different from one another (i.e. there were no significant block effect), the MSE for the CRD and the RCBD will estimate the same error variance. However the degrees of freedom of the MSE for the RCBD will be smaller than those for the CRD and therefore the critical F value will be larger.

The larger critical value in the RCBD moves the threshold of rejection further from the mean than in the CRD. This change in the rejection threshold affects the Type II error (β) and the power of the test (1- β). Under this scenario, the probability of accepting a false null hypothesis (β) will be smaller in the CRD than in the RCBD.  In other words, the CRD would in this situation be more powerful.

Situation 2: Significant difference among blocks

Now suppose that there really are substantial differences among blocks as well as among treatments (H0

is false). In a CRD, this variation due to differences among blocks would remain in the error. This larger MSE would make the F statistic (MST/MSE) for the CRD smaller (less significant) than the F statistic for the RCBD.

Under this scenario, the RCBD would still have a larger critical F value in the table because of the lost

degrees of freedom; but this may be more than compensated by the smaller MSE. If the effect of the reduced MSE (increased F) outweighs the effect of the larger critical value

5

Page 6: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.6

(rejection threshold further from 0), the net result will be a smaller , and thus a larger power (1-) in the RCBD relative to the CRD.

Obviously, one should only use the RCBD when the variation explained by the blocks more than offsets the penalty associated with having fewer error degrees of freedom. So how can one determine when an RCBD is appropriate?  This question is answered using the concept of efficiency (introduced in Section 1.4.4.6. and further developed in section 6. 3.).

6. 2. 5. Example (from Little and Hills book)This experiment was conducted to investigate the effect of estrogen on weight gain in sheep.

The four treatments in the experiment are a factorial combinations of two separate factors: Gender of sheep (male and female) and amount of estrogen (S0 and S3). Although this experiment could be analyzed as a factorial, in this example we are treating the four treatments and four levels of a single factor (gender-estrogen combination).

Sheep from four different ranches were involved in the experiment. Anticipating that differences in herd management may affect the results, the researchers blocked by ranch. The completeness of an RCBD demanded, therefore, that each ranch volunteer four sheep to the experiment, two males and two females, providing one replication of each treatment level from each ranch.

Table 6.1 RCBD. Effect of estrogen on weight gain in sheep (lbs).

Block (=ranch) TreatmentTreatment I II III IV Total Mean

F-S0 47 52 62 51 212 53M-S0 50 54 67 57 228 57F-S3 57 53 69 57 236 59M-S3 54 65 74 59 252 63

Block Total 208 224 272 224 928Block Mean 52 56 68 56 58

Table 6.2 RCBD ANOVA

Source of Variation df SS MS F1

Totals 15 854 Blocks 3 576 192.00 24.69** Treatments 3 208 69.33 8.91** Error 9 70 7.781F (3, 9, 0.05) = 3.86

Table 6.3 CRD ANOVA

6

Page 7: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.7

Source of Variation df SS MS FTotals 15 854 Treatments 3 208 69.33 1.29 NS Error 12 646 53.831F (3, 12, 0.05) = 3.49. Lower than 3.86!

Since each treatment is present at the same level of replication within each block, differences among blocks are not the result of treatment effects. Differences among blocks are entirely independent of treatment effects and are due only to differences associated with the four ranches. Therefore, this component (SSB) can be perfectly partitioned from the total SS. Ultimately, this reduces the experimental error. To see this, compare the two tables above (Tables 6.2 and 6.3), paying close attention to the degrees of freedom and the SS in each analysis.

6. 2. 5. 2. SAS ProgramThe linear model of an RCBD contains two classification variables, treatment and block. For this experiment, we will call the treatment factor "Sex_Est" because its levels are comprised of various combinations of gender and estrogen supplements. The block variable is "Ranch." The response variable is "Gain." SAS does not know the scientific interpretation of the effects in the model, so it will simply compute F statistics for both Sex_Est and Ranch, as shown in Table 6.2 above. See the code below:data lambs; input sex_est $ @; do block = 1 to 4; input gain @; output; end;cards;f0 47 52 62 51m0 50 54 67 57f3 57 53 69 57m3 54 65 74 59;proc glm; class block sex_est; model gain=block sex_est;

run; quit;

6. 3. Relative efficiency [ST&D p. 221, and Topic 1 section 1.4.4.6]

We saw earlier that if the variation among blocks is large then we can expect the RCBD to be more sensitive to treatment effects than the CRD; conversely, if this variation is small, the CRD may be more sensitive (i.e. more powerful). The concept of relative efficiency formalizes the comparison between two experimental methods by quantifying this balance between loss of degrees of freedom and reduction in experimental error.

7

Page 8: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.8

Recall that the F statistic = MST/MSE. The experimental design primarily affects the MSE since the degrees of freedom for treatments is always (t – 1) and the variation due to treatments is independent of (i.e. orthogonal to) the variation due to blocks and the experimental error. The information per replication in a given design is:

Therefore, the relative efficiency of one design another is

In reality, we never know the true experimental error ( ); we only have an estimate of it (MSE). To pay for this lack of knowledge, a correction factor is introduced into the expressions for information (I) and relative efficiency (RE) (Cochram and Cox, 1957). The following formulas include this correction factor and give an estimate of the relative amount of information provided by two designs:

where MSEi is the mean square error from experimental design i. If this ratio is greater than 1, it means that Design 1 provides more information per replication and is therefore more efficient than Design 2. If RE1:2 = 2, for example, each replication in Design 1 provides twice as much information as each replication in Design 2. Design 1 is twice as efficient.

8

Page 9: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.9

The main problem with the approach is how to estimate MSE for the alternative design. Suppose an experiment is conducted as an RCBD. The MSE for this design is simply given by the analysis (MSERCBD). But now we wish to ask the question: What would have been the value of the MSE if the experiment had been conducted as a CRD? In fact, it was not conducted as a CRD. The treatments were not randomized according to a CRD. Because of this, one cannot just re-analyze the data as though it were a CRD and use the MSE from the analysis as a valid estimate of MSECRD.

MSECRD can be estimated, however, by the following formula (ST&D 222):

where MSB and MSE are the block and error mean squares in the original design (RCBD), and dfB, dfT, and dfe are the block, treatment, and error degrees of freedom in the original design. To obtain this formula, the total SS of the two designs are assumed equal. This equation is then expanded such that the SS are rewritten in terms of the underlying variance components of the expected MS. Simplification of the terms generates the above estimate (for a complete derivation, see Sokal & Rohlf 1995, Biometry 838-839).

From the sheep experiment, MSERCBD = 7.78 and MSBRCBD = 192.0. Therefore:

and…

Interpretation: It takes 5.51 replications in the CRD to produce the same amount of information as one replication in the RCBD. Or, the RCBD is 5.51 time more efficient than the CRD in this case. It was a very good idea to block by ranch.

6. 4. Assumptions of the modelThe model for the RCBD with a single replication per block-treatment combination is:

Yij = + i + j + ij

9

Page 10: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.10

As in the CRD, it is assumed that the residuals (ij) are independent, homogeneous, and normally distributed. Also as in the CRD, it is assumed that the variance within each treatment levels is homogeneous across all treatment levels. But now, in an RCBD without replication (i.e. with a single replication per block-treatment combination), there is a third assumption of the model: Additivity of main effects.

Recall that experimental error is defined as the variation among experimental units that are treated alike. With that in mind, consider the following schematic of our sheep experiment:

RanchTrtmt 1 2 3 4

M Est0

M Est3

F Est0

F Est3

In this experiment, while there are four reps of each level of treatment and four reps of each block, there is no true replication vis-à-vis calculation of experimental error. For example, there is only one male sheep at Ranch 1 that received no estrogen. Normally, our estimate of the experimental error would come from looking at the variation among two or more sheep treated alike (e.g. two or more sheep of the same gender, at the same ranch, receiving the same estrogen treatment). So if we have no ability to calculate the experimental error, what is the ij in our linear model?

There is an expected value for each of the 16 cells in the above diagram, given by:

Expected Yij = + i + j

In this design, we use the deviation of the observed values from their expected value as estimates of the experimental error. Technically, though, these deviations are the combined effects of experimental error and any putative block*treatment interaction. With only one replication per cell, we are unable to separate these two effects. So when we use these deviations (observed – expected) as an estimate of the experimental error, we are assuming that there are no significant block*treatment interactions (i.e. no significant non-additive effects).

Said another way, in the Yij = + i + j + ij model, the residuals are the results of experimental error and any non-additive treatment*block interactions:

ij = i*j + errorij

10

Page 11: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.11

Thus, when we use ij as estimates of the true experimental error, we are assuming that i*j = 0.

This assumption of no interaction in a two-way ANOVA is referred to as the assumption of additivity of the main effects. If this assumption is violated, all F-tests will be very inefficient and possibly misleading, particularly if the interaction effect is very large.

Example: A significant interaction term will result if the effect of the two factors A and B on the response variable Y is multiplicative rather than additive. This is one form of non-additivity.

Table 6.4. Additive and multiplicative effects

Factor A

Factor B 1= +1 2= +2 3= +3

1= +12 3 4 Additive effects1 2 3 Multiplicative effects0 0.30 0.48 Log of multiplicative effects

2= +56 7 8 Additive effects5 10 15 Multiplicative effects0.70 1.00 1.18 Log of multiplicative effects

In Table 6.4 additive and multiplicative treatment effects are shown in a hypothetical two-way ANOVA. Let us assume that the population mean is =0. Then the mean of the e.u.’s subjected to level 1 of factor A and level 1 of factor B should be 2 (1+1) by the conventional additive model. Similarly, the expected subgroup mean subjected to level 3 of factor A and level 2 of factor B is 8, since the respective contributions to the mean are 3 and 5. If the process is multiplicative rather than additive, however, as occurs in a variety of physicochemical and biological phenomena, the expected values are quite different. For treatment A3B2, the expected value is 15, the product of 3 and 5.

If multiplicative data of this sort are analyzed by a conventional ANOVA, the interaction SS will be large due to the non-additivity of the treatment effects. If this SS is embedded in the SSE, as in the case of an RCBD with one e.u. per block-treatment combination, the estimate of the experimental error will be artificially large, thereby making all F tests artificially insensitive.

In the case of multiplicative effects, there is a simple remedy. Transforming the variable by taking the log of each mean will restore additivity. The third line in each cell gives the logarithm of the expected value, assuming multiplicative relations. After the transformation, the increments are strictly additive again (1=0, 2=0.30, 3=0.48, 1=0, 1=0.70). This is a good illustration of how transformations of scale can be used to meet the assumptions of analysis of variance.

11

Page 12: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.12

6. 4. 1. Tukey’s test for non-additivityJohn Tukey devised a very clever method of testing for significant non-additive effects (i.e. interactions) in datasets that lack the degrees of freedom necessary to include such effects (i.e. interactions) directly in the model. Here's the logic behind the test:

To begin, recall that under our linear model, each observation is characterized as:

Therefore, the predicted value of each individual is given by:

In looking at these two equations, the first thing to notice is that, if we had no error in our experiment (i.e. if ), the observed data would exactly match its predicted values and a correlation plot of the two would yield a perfect line with slope = 1:

Now let's introduce some error. If the errors in the experiment are in fact random and independent (criteria of the ANOVA and something achieved by proper randomization from the outset), then will be a random variable that causes no systematic deviation from this linear relationship, as indicated in the next plot:

As this plot shows, while random error may decrease the overall strength of correlation, it will not systematically compromise its underlying linear nature.

But what happens when you have an interaction (e.g. Block * Treatment) but lack the degrees of freedom necessary to include it in the linear model (e.g. when you have only 1 replication per block*treatment combination)? In this case, the df and the variation assigned to the interaction are relegated to the error term. Under such circumstances, you can think of the error term as now containing two separate components:

B*T Interaction Effects

While the first component is random and will not affect the underlying linear correlation seen above, the second component is non-random and will cause

12

Observed vs. Predicted Values (RCBD, no error)

10

12

14

16

18

20

10 12 14 16 18 20Predicted

Obser

ved…

…Observed vs. Predicted (RCBD, with error)

10

12

14

16

18

20

10 12 14 16 18 20Predicted

Obser

ved..

..

Observed vs. Predicted (RCBD, with error and B*T)

10

12

14

16

18

20

10 12 14 16 18 20Predicted

Obser

ved..

..

Page 13: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.13

systematic deviations from linearity. Indeed, if this interaction component is too large, the observed vs. predicated correlation will become detectably non-linear, thereby violating the ANOVA assumption of random and independent error, not to mention making your F tests much less sensitive.

The plot on the following page illustrates the deviation from linearity that results when significant multiplicative effects (one kind of non-additive effect) cannot be accommodated by the model. The quadratic (i.e. non-linear) trend is unmistakable.

So, if the observed and predicted values obey a linear relationship, then the non-random Interaction Effects buried in the error term are sufficiently small to uphold our assumption of random, independent error.

Seen in this light, our test for unaccounted-for non-additivity [significant non-additive (i.e. interaction) effects] becomes a simple test for linear regression, which is what Tukey's 1-df test is. It is a regression of the observed values with the squares of the predicted values. Why the squares? Because, as mentioned before when talking about contrasts for trends, to test if a relationship is linear, (as opposed to a higher power relationship), one tests for a quadratic effect, and if it is significant concludes that the relationship is not linear.

This test is easily implemented using SAS:

Data Lambs;Input Sex_Est $ @@;

Do Ranch = 1 to 4;Input Gain @@;Output;

End;Cards;F0 47 52 62 51M0 50 54 67 57F3 57 53 69 57M3 54 65 74 59;Proc GLM Data = Lambs;

Class Sex_Est Ranch;Model Gain = Ranch Sex_Est;Output out = LambsPR p = Pred r = Res;

Proc GLM Data = LambsPR; * This is the Tukey 1 df test;Class Sex_Est Ranch;Model Gain = Ranch Sex_Est Pred*Pred;

Run;Quit;

Output from the 2nd Proc GLM (the Tukey 1 df test):

Source DF Type III SS Mean Square F Value Pr > FRanch 3 0.73506585 0.24502195 0.03 0.9927Sex_Est 3 0.29808726 0.09936242 0.01 0.9981Pred*Pred 1 3.41880342 3.41880342 0.41 0.5395 NS

13

Page 14: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.14

The Tukey test is NS (p = 0.5395 > 0.05); therefore, we fail to reject the null hypothesis of additivity and we are justified in using the MSE as a valid estimate of the true experimental error.

Please note: This test is necessary ONLY when there is one observation per block-treatment combination. If there are two or more replications per block-treatment combination, the block*treatment interaction can be tested directly in an exploratory model.

6. 4. 2. Diagnostic checking of the ModelDiscrepancies of many different kinds between the tentative model and the observed data can be detected by studying residuals. These residuals, the third value in each cell in the table below, are the quantities remaining after the systematic contributions associated with the assumed model (in this case treatments and blocks) are removed (See ST&D 213-214).

Table 6.5 Yield of penicillin from four different protocols (A – D). Blocks are different stocks of an important reagent. The numbers below each observation (O) are the predicted values (P = Grand Mean + Treatment effect + Block effect) and the residuals (R).

Block

Treatment Block

Mean

Block

EffectA B C D

Stock 1 O: 89P: 90R: -1

O: 88P: 91R: -3

O: 97P: 95R: 2

O: 94P: 92R: 2

92 +6

Stock 2 O: 84P: 81R: 3

O: 77P: 82R: -5

O: 92P: 86R: 6

O: 79P: 83R: -4

83 -3

Stock 3 O: 81P: 83R: -2

O: 87P: 84R: 3

O: 87P: 88R: -1

O: 85P: 85R: 0

85 -1

Stock 4 O: 87P: 86R: 1

O: 92P: 87R: 5

O: 89P: 91R: -2

O: 84P: 88R: -4

88 2

Stock 5 O: 79P: 80R: -1

O: 81P: 81R: 0

O: 80P: 85R: -5

O: 88P: 82R: 6

82 -4

Treatment mean 84 85 89 86 Mean=86

Treatment effect -2 -1 3 0

SAS programThis experiment, organized as an RCBD, has one replication per block-treatment combination. Therefore, in addition to testing for normality and variance homogeneity

14

Page 15: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.15

of residuals, one must also test for non-additivity of block and treatment effects. The SAS code for such an analysis:

Data Penicillin;Do Block = 1 to 4;

Do Trtmt = 1 to 4;Input Yield @@;Output;

End;End;Cards;89 88 97 9484 77 92 7981 87 87 8587 92 89 8479 81 80 88;Proc GLM Data = Penicillin;

Class Block Trtmt;Model Yield = Block Trtmt;Output out = PenPR p = Pred r = Res;

Proc Univariate Data = PenPR normal; * Testing for normality of residuals;

Var Res;Proc GLM Data = Penicillin; * Testing for variance homogeneity (1 way ANOVA);

Class Trtmt;Model Yield = Trtmt;Means Trtmt / hovtest = Levene;

Proc Plot Data = PenPR; * Generating a plot of predicted vs. residual values;

Plot Res*Pred = Trtmt;Proc GLM Data = PenPR; * Testing for nonadditivity;

Class Block Trtmt;Model Yield = Block Trtmt Pred*Pred;

Run; Quit;

The OUT option after MODEL creates a new data set, named ‘PenPR’ in this example, that includes the original variables plus the predicted (‘Pred’) and residual (‘Res’) variables.

This dataset meets all assumptions: normality, variance homogeneity, and additivity:

Tests for Normality

Test --Statistic--- -----p Value------

Shapiro-Wilk W 0.967406 Pr < W 0.6994 NS

Levene's Test for Homogeneity of Yield VarianceANOVA of Squared Deviations from Group Means

Sum of Mean Source DF Squares Square F Value Pr > F

Trtmt 3 922.2 307.4 0.39 0.7620 NS Error 16 12618.8 788.7

15

Page 16: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.16

Tukey's 1 df test for nonadditivity

Source DF Type III SS Mean Square F Value Pr > F

Block 3 28.29215818 9.43071939 0.28 0.8365Trtmt 3 28.26814524 9.42271508 0.28 0.8367Pred*Pred 1 26.46875000 26.46875000 0.79 0.3901 NS

Finally, consider the plot of predicted vs. residual values:

In this example, no particular pattern is observed in the residuals. This observation parallels the normal distribution of the residuals, the homogeneous variances of the residuals among treatments, and a non-significant Tukey’s test for non-additivity.

6.4.3 The plot of residual vs. predicted valuesAs demonstrated in the above example, when the assumptions of the model are met, no particular pattern will be seen in the scatterplot of residual vs. predicted values. As different assumptions are violated, patterns will begin to emerge; and the characteristics of those patterns can provide information as to what strategies (e.g. data transformations) should be pursued.

For example, in some cases, the plot of the residuals versus the predicted values will show a curvilinear relationship with positive residuals for low and high values of Y and negative residuals for intermediate values. This sort of pattern suggests multiplicative block and treatment effects that might be eliminated by a suitable transformation of the response variable.

In other cases, the plot of the residuals versus the predicted values presents a funnel-like appearance. This indicates that the variance increases as the value of the response increases (a situation that is common when the variance is a constant percentage of the mean).

16

Page 17: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.17

Another useful plot to consider is the scatterplot of residuals vs. the sequence in which the data was collected. Such a plot can reveal patterns of systematic variation during the data collection (e.g. increasing variation with time as the operators get tired).

17

Page 18: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.18

6.5 Example of nesting within an RCBDThe following dataset was created assuming that each sheep was weighed two separate times at the end of the experiment (i.e. two measurements (subsamples) were taken on each experimental unit). The subsample values were created such that their averages yield the values of each experimental unit in the original dataset:

Data Lambs;Input Sex_Est $ Ranch Animal Gain @@;

Cards;f0 1 1 46 f0 2 1 51 f0 3 1 61 f0 4 1 50m0 1 1 49 m0 2 1 53 m0 3 1 66 m0 4 1 56f3 1 1 56 f3 2 1 52 f3 3 1 68 f3 4 1 56m3 1 1 53 m3 2 1 64 m3 3 1 73 m3 4 1 58

f0 1 1 48 f0 2 1 53 f0 3 1 63 f0 4 1 52m0 1 1 51 m0 2 1 55 m0 3 1 68 m0 4 1 58f3 1 1 58 f3 2 1 54 f3 3 1 70 f3 4 1 58m3 1 1 55 m3 2 1 66 m3 3 1 75 m3 4 1 60;Proc GLM Data = Lambs Order = Data;

Class Ranch Sex_Est Animal;Model Gain = Ranch Sex_Est Animal(Ranch*Sex_Est);Random Animal(Ranch*Sex_Est);Test h = Sex_Est e = Animal(Ranch*Sex_Est);

*In nested models, specify the correct error term in all contrasts and mean comparisons;

Contrast 'sex' Sex_Est 1-1 1 -1/ e = Animal(Ranch*Sex_Est);Contrast 'estrogen' Sex_Est 1 1-1 -1/ e = Animal(Ranch*Sex_Est);Contrast 'interaction' Sex_Est 1-1-1 1/ e = Animal(Ranch*Sex_Est);Means Sex_Est / Tukey e = Animal(Ranch*Sex_Est);

*Below is a Tukey test with the incorrect error for comparison;Means Sex_Est / Tukey;

Proc Varcomp Method = Type1;Class Ranch Sex_Est Animal;Model Gain = Ranch Sex_Est Animal(Ranch*Sex_Est);

Run; Quit;

Now that there are subsamples, the experimental unit (Animal) must appear in the model. As with all experimental units, the label "Animal" is simply an ID. To specify a particular animal in the experiment, the Ranch (i.e. block) and the level of Sex_Est (i.e. treatment) must be specified. Hence the syntax:

Animal(Ranch*Sex_Est)

The ID "Animal" only has meaning within specific Block-Treatment combinations. Animals are random samples from larger populations; hence Animal(Ranch*Sex_Est) is declared as a random variable.

18

Page 19: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.19

As in the CRD, it is important to note that the error term to test differences among treatments is the variance among experimental units (MSEE). Thus Animal(Ranch*Sex_Est) must be declared as the error term for each hypothesis tested regarding treatment means, whether the overall F test or subsequent contrasts or mean comparisons. If the error term is not specified, SAS will test every hypothesis using the variance among subsamples (MSSE).

Output (compare to output of the original experiment with no subsamples)Overall ANOVA

Sum ofSource DF Squares Mean Square F Value Pr > F

Model 15 1708.000000 113.866667 56.93 <.0001Error 16 32.000000 2.000000Corrected Total 31 1740.000000

Partitioning of model effects (automatic wrong F tests for treatment and block)

Source DF Type III SS Mean Square F Value Pr > F

Ranch 3 1152.000000 384.000000 192.00 <.0001Sex_Est 3 416.000000 138.666667 69.33 <.0001Animal(Ranch*Sex_Es) 9 140.000000 15.555556 7.78 0.0002

Correct F test for treatment

Tests of Hypotheses Using the Type III MS for Animal(Ranch*Sex_Es) as an Error Term

Source DF Type III SS Mean Square F Value Pr > FSex_Est 3 416.0000000 138.6666667 8.91 0.0046 **

Note that 8.91 is exactly the same as in the previous analysis (Topic 6.2.5, Table 6.2) using the average of the two subsamples)

Correct contrastsContrast DF Contrast SS Mean Square F Value Pr > F

sex 1 128.0000000 128.0000000 8.23 0.0185 *estrogen 1 288.0000000 288.0000000 18.51 0.0020 **interaction 1 0.0000000 0.0000000 0.00 1.0000 NS

Correct Tukey means separation Minimum Significant Difference 6.1563

Tukey Grouping Mean N Sex_Est

A 63.000 8 m3 B A 59.000 8 f3 B A 57.000 8 m0 B 53.000 8 f0Incorrect Tukey means separation Minimum Significant Difference 2.023

Tukey Grouping Mean N Sex_Est

A 63.0000 8 m3 B 59.0000 8 f3 B 57.0000 8 m0 C 53.0000 8 f0

Type 1 Analysis of Variance

Source Expected Mean SquareRanch Var(Error) + 2 Var(Animal(Ranch*Sex_Es)) + 8 Var(Ranch)Sex_Est Var(Error) + 2 Var(Animal(Ranch*Sex_Es)) + 8 Var(Sex_Est)Animal(Ranch*Sex_Es) Var(Error) + 2 Var(Animal(Ranch*Sex_Es))

19

Page 20: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

f0 m0 f3 m3Block 1

Block 2

Block 3

Block 4

2

6.20

Error Var(Error)

Type 1 Estimates

Variance Component Estimate %

Var(Ranch) 46.05556 65.6Var(Sex_Est) 15.38889 21.9Var(Animal(Ranch*Sex_Es)) 6.77778 9.7Var(Error) 2.00000 2.8

The only reason to analyze this dataset as a nested RCBD is to calculate these variance components. If you do not need these variance components, simply average the subsamples for each

experimental unit and analyze it as a simple RCBD.

As with the CRD, this variance component information can be used together with cost information to determine the optimum allocation of resources among subsamples and experimental units. *Remember: In nested models specify the correct error term in all mean comparisons;

EXAMPLE LAMBS RCBD with 2 reps per cell no subsample32 animals distributed in 4 blocks. We randomly assign 8 animals to the four treatments in each block. When we have more than one rep per block/treatment combination we include the interaction Block*Treatment in an exploratory model. If the interaction is significant, transform the data and then exclude from the model. No need to perform a Tukey's test for non-additivity.

data lambs;input sex_est $ block gain @@;cards;f0 1 46 f0 2 51 f0 3 61 f0 4 50m0 1 49 m0 2 53 m0 3 66 m0 4 56f3 1 56 f3 2 52 f3 3 68 f3 4 56m3 1 53 m3 2 64 m3 3 73 m3 4 58

f0 1 48 f0 2 53 f0 3 62 f0 4 52m0 1 51 m0 2 55 m0 3 68 m0 4 58f3 1 58 f3 2 54 f3 3 70 f3 4 58m3 1 55 m3 2 66 m3 3 75 m3 4 60

proc glm data=lambs order=data; class block sex_est; model gain= block sex_est block*sex_est; * Exploratory model;

proc glm data=lambs order=data; class block sex_est; model gain= block sex_est; *final model output out=check p= pred r= resi; contrast 'sex' sex_est 1 -1 1 -1; contrast 'estrogen' sex_est 1 1 -1 -1; contrast 'interaction' sex_est 1 -1 -1 1; means sex_est/tukey; *Example of mean comparisons in an RCBD;

20

Page 21: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.21

proc univariate data=check normal; var resi;

proc glm data=lambs; *Homogeneity of 2 LEVENE only one-way ANOVA; class sex_est; model gain= sex_est; means sex_est/ HOVTEST = LEVENE;run; quit;

Output LAMB 2 RepsANOVA Dependent Variable: gainExploratorySource DF SS MS F Value Pr > FModel 15 1700.5 113.4 59.47 <.0001Error 16 30.5 1.9Corrected Total 31 1731.0Source DF SS MS F Value Pr > Fblock 3 1132.1 377.4 198.0 <.0001sex_est 3 426.1 142.0 74.5 <.0001block*sex_est 9 142.3 15.8 8.3 0.0002

FinalSource DF SS MS F Value Pr > FModel 6 1558.2 259.7 37.6 <.0001Error 25 172.8 6.9Corrected Total 31 1731.0Source DF SS MS F Value Pr > Fblock 3 1132.1 377.4 54.6 <.0001sex_est 3 426.1 142.0 20.6 <.0001Still significant in spite of large block*sex_est interaction

Contrast DF SS MS F Value Pr > Fsex 1 132.0 132.0 19.10 0.0002estrogen 1 294.0 294.0 42.54 <.0001interaction 1 0.03 0.03 0.00 0.9469

Tukey's Studentized Range (HSD) Test for gainMinimum Significant Diff. 1.97Grouping Mean N sex_estA 63.000 8 m3B 59.000 8 f3B 57.000 8 m0 C 52.875 8 f0

Tests for NormalityTest --Statistic--- -----p Value------Shapiro-Wilk W 0.978499 Pr < W 0.7549 OK

Levene's Test for Homogeneity of Variance Sum of MeanSource DF Squares Square F Value Pr > Fsex_est 3 3181.5 1060.5 0.54 0.6567 OKError 28 54660.5 1952.2

21

Page 22: Topic 6: Two-way designs: Randomized Complete … · Web viewTopic 6. Randomized Complete Block Design (RCBD) [ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section

6.22

22