51
Basic Blocking Gary W. Oehlert School of Statistics University of Minnesota October 16, 2014

Basic Blocking

  • Upload
    votram

  • View
    243

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Basic Blocking

Basic Blocking

Gary W. Oehlert

School of StatisticsUniversity of Minnesota

October 16, 2014

Page 2: Basic Blocking

Variance Reduction Design

We now begin a new phase of the course where we move awayfrom completely randomized designs.

Power increases and margin of error decreases if N is larger or if σ2

is smaller.

It costs resources to make N bigger.

This part of the course is about making σ2 smaller.

Page 3: Basic Blocking

Blocking

The principal tool in variance reduction design is blocking.

A block is a homogeneous subset of units. Prior to running theexperiment, we know these units are similar in some way that weexpect will make them likely to have similar responses.

Similar soil, similar instrument calibration, similar batch of rawmaterial, similar operators, similar genetics, similar environmentalconditions, similar socio-economic background, similar somethingor other.

Page 4: Basic Blocking
Page 5: Basic Blocking
Page 6: Basic Blocking

Blocking will be some form of repeating the experiment (or part ofit) separately and independently in each block.

This restricts the randomization of treatments to units.

With apologies to Woodward, Bernstein, and Deep Throat:

Follow the randomization!

Different designs correspond to different randomizations, andexamining the randomization can allow you to discern the design.

Page 7: Basic Blocking

Randomized Complete Block design

The RCB is the progenitor of all block designs.

We have:

g treatments

g units per block

r blocks

rg = N total units

Within each block, randomly and independently assign the gtreatments to the g units.

It’s like r single-replication CRDs glued together.

Page 8: Basic Blocking

Notes:

This is a complete block design because every treatmentoccurs in every block.

The treatments could have factorial structure.

Consider blocking when you can identify a source of variabilityprior to experimentation.

Blocking is done at the time of randomization; it is notimposed later.

The randomization in an experiment could identify it as RCB.

Page 9: Basic Blocking

Model:yij = µ = αi + βj + εij

i = 1, . . . , g ; j = 1, . . . , r

We think that units in some blocks might respond high, units inothers might respond low, but within a block units are morehomogeneous (less variable) than randomly chosen units from theuniverse of units.

For a two-factor treatment design, we would use the model:

yijk = µ = αi + βj + αβij + γk + εijk

i = 1, . . . , a; j = 1, . . . , b; k = 1, . . . , r

Page 10: Basic Blocking

The model assumes that treatments have the same effect in everyblock, i.e., treatments and blocks are additive.

Assuming additivity does not make additivity true; transformationof the response can sometimes improve additivity.

Because there is only a single observation for each treatment ineach block, we cannot distinguish between random error and anypotential interaction between treatments and blocks.

From a practical perspective, it doesn’t matter much whether wethink of blocks as fixed or random.

From a theoretical perspective, blocks are probably random inmost situations.

Page 11: Basic Blocking

Why does RCB work? Here are a couple points of view.

Make comparisons within blocks (thus small variance), and thencombine across blocks.

Treatment totals all contain the same block totals, so block effectscancel out when comparing treatment totals (and similarly fortreatment averages).

Block to block variability is still in the totality of variability in thedata, but we contrive to make it disappear when comparingtreatments.

Page 12: Basic Blocking

Do not test blocks!

Note that blocks are in the nature of the units. There ought to bebig differences between blocks.

We did not assign blocks to units. Blocks were not randomlyassigned, so there is no randomization test for blocks.

The software does not know any better than to test blocks, butnow you do!

For unbalanced data, always look at treatments adjusted for blocks(i.e., blocks are always in the base model for any treatment factor).For balanced data, blocks and treatments are orthogonal.

Page 13: Basic Blocking

Relative efficiency

How well did blocking work? Should we use blocking in our nextsimilar experiment?

“Testing” the block effect is not what matters. What matters ishow large the error variance would have been if we had notblocked.

Relative efficiency answers the following question: using the sameuniverse of units, by what factor would we need to increase oursample size to get the same power in a CRD that we would achieveusing the RCB?

Page 14: Basic Blocking

This is mostly an issue of how the error variance changes, butthere is also a minor effect due to the fact that fitting blocks usesup degrees of freedom for error.

(In CRD, bigger σ2 hurts, but larger dferror helps; usually the firstfactor dominates.)

We first estimate what error variance would have been if we hadused a CRD instead of RCB, then we make a minor df adjustment.

Page 15: Basic Blocking

We estimate σ2RCB by MSE or residual variance in the RCB

analysis.

We estimate σ2CRD via

σ̂2CRD =

dfblocksMSblocks + [dfTrt + dferror ]MSE

dfblocks + dfTrt + dferror

=(r − 1)MSblocks + [(g − 1) + (r − 1)(g − 1)]MSE

(r − 1) + (g − 1) + (r − 1)(g − 1)

This is an average of MSE and MSBlock weighted by df, but weuse df error plus df treatments as the weight for MSE. Typicallythis estimate is less than the MSE you would get if you just leftblocks out of the model.

Page 16: Basic Blocking

The df adjustment is less obvious. Let νRCB = (r − 1)(g − 1) bethe error df in the RCB analysis. Let νCRD = rg − g be the errordf if you had not blocked.

The estimated relative efficiency of RCB to CRD is

ERCB:CRD =νRCB + 1

νRCB + 3

νCRD + 3

νCRD + 1

σ̂2CRD

σ̂2RCB

If this ratio is 1.7, then you would need 1.7 times as many units ina CRD to achieve the same power as an RCB.

Page 17: Basic Blocking

Latin Squares

An RCB is an effective way to block on one source of extraneousvariation; what if you have two sources of extraneous variation?

Light and drainage in garden flower trials; gender and bloodpressure in cardiac trials; driver and environmental conditions inMPG trials

Think back to why RCB designs work; we want to get thatcancellation of block effects to happen simultaneously for twoblocking factors.

Page 18: Basic Blocking

The Latin Square design is the classical design for blocking on twosources of variation.

There are g2 units visualized as a square. Those units in the samerow are all in the same block based on the first extraneous sourceof variation. Those units in the same column are all in the sameblock based on the second extraneous source of variation.

The g treatments are randomized so that each treatment occursonce in each row and once in each column.

Treatments are represented by Latin letters, thus Latin Squares.

Page 19: Basic Blocking

A B C D

B A D C

C D A B

D C B A

If you ignore columns, a Latin Square is an RCB in rows. If youignore rows, a Latin Square is an RCB in columns.

Randomization is often done more like this. Take a square from atable of squares (back of the book). Randomly permute the rowsand the columns. Randomly assign treatments to the letters. Notas random as the ”randomize subject to” description, but generallygood enough and a lot simpler.

Page 20: Basic Blocking

Model:yijk = µ+ αi + βj + γk + εijk

i, j, and k all run from 1 to g.

Note: we only observe g2 of the g3 i, j, k combinations.

We are again assuming additivity in a major way, and we mightneed to transform to achieve additivity.

For unbalanced data, treatments adjusted for all blocking factors.

Page 21: Basic Blocking

What if we need more data to achieve acceptable power?

In addition, if you think of rows and columns as fixed effects, wehave (g − 1)(g − 2) degrees of freedom for error. That might notbe very many.

Latin Squares are often replicated, i.e., we use more than onesquare with the same set of treatments.

However, we need to consider how the replication is done.

Page 22: Basic Blocking

Suppose that we have r squares to study g treatments. All squareswill have row blocks and column blocks. The issue is whether thesquares have the same row blocks or different row blocks; similarlyfor columns.

Example: three squares (r = 3) for g = 4 treatments; 48 totalunitsTreatments: gasoline additivesResponse: particulate emissionsRow blocks: driversColumn blocks: cars

Page 23: Basic Blocking

Option 1: every square uses different drivers and different cars.

yijk` = µ+ αi + βj + γk(j) + δ`(j) + εijk`

This is mean plus treatment plus square plus car-nested-in-squareplus driver-nested-in-square plus error.

There are (g-1) df for treatments, (r-1) df for squares, r(g-1) df forcars within square, r(g-1) df for drivers within square.

Page 24: Basic Blocking

Cars 1–4D

rive

rs1–

4 A B C D

B A D C

C D A B

D C B ACars 5–8

Dri

vers

5–8 A B C D

B C D A

C D A B

D A B CCars 9–12

Dri

vers

9–12 D C A B

A B D C

C D B A

B A C D

Page 25: Basic Blocking

Option 2: every square uses the same cars but different drivers.

yijk` = µ+ αi + βj + γk + δ`(j) + εijk`

This is mean plus treatment plus square plus car plusdriver-nested-in-square plus error.

There are (g-1) df for treatments, (r-1) df for squares, (g-1) df forcars, r(g-1) df for drivers within square.

Page 26: Basic Blocking

Cars 1–4D

rive

rs1–

4 A B C D

B A D C

C D A B

D C B A

Dri

vers

5–8 A B C D

B C D A

C D A B

D A B C

Dri

vers

9–12 D C A B

A B D C

C D B A

B A C D

Page 27: Basic Blocking

Option 3: every square uses the same drivers but different cars.

yijk` = µ+ αi + βj + γk(j) + δ` + εijk`

This is mean plus treatment plus square plus car nested in squareplus driver plus error.

There are (g-1) df for treatments, (r-1) df for squares, r(g-1) df forcars within square, (g-1) df for drivers.

Page 28: Basic Blocking

Cars 1–4

Dri

vers

1–4 A B C D

B A D C

C D A B

D C B A

Cars 5–8A B C D

B C D A

C D A B

D A B C

Cars 9–12D C A B

A B D C

C D B A

B A C D

Page 29: Basic Blocking

Option 4: every square uses the same drivers and the same cars.

yijk` = µ+ αi + βj + γk + δ` + εijk`

This is mean plus treatment plus square plus car plus driver pluserror.

There are (g-1) df for treatments, (r-1) df for squares, (g-1) df forcars, (g-1) df for drivers.

Page 30: Basic Blocking

Cars 1–4D

rive

rs1–

4

Page 31: Basic Blocking

A very common example is the cross over design.

In a cross over, one of the blocking factors is time period, and theother blocking factor is subject. Each subject has each treatment,but some get one treatment first, others have another treatmentfirst, and so on.

To replicate these designs, we generally get a new set of subjects,but the period effects are assumed to be the same for all squares.

Page 32: Basic Blocking

We can also compute the relative efficiency of a Latin Squarerelative to an RCB should we consider not using one of theblocking factors. For example, if we consider not using rows, then

We estimate σ2LS by MSE in the Latin Square analysis.

We estimate σ2RCB via

σ̂2RCB =

dfrowsMSrows + [dfTrt + dferror ]MSE

dfrows + dfTrt + dferror

Page 33: Basic Blocking

Let νLS be the error df in the LS analysis. Let νRCB be the error dfif you had not blocked on rows.

The estimated relative efficiency of LS to RCB is

ELS :CRD =νLS + 1

νLS + 3

νRCB + 3

νRCB + 1

σ̂2RCB

σ̂2LS

If this ratio is 1.7, then you would need 1.7 times as many units ifyou had run a RCB instead of an LS.

Page 34: Basic Blocking

Generalizations

There are many possible generalizations of these blocking designs.

The Generalized Randomized Complete Block design is analogousto an RCB except each block has 2g or 3g etc. units and eachtreatment is assigned to 2 or 3 etc. units within each block.

In this case, the standard approach is to model blocks as randomand include a random block by treatment interaction term.

Page 35: Basic Blocking

The carry over design, or design balanced for residual effects, is aLatin Square where, in addition to the usual requirements, we alsohave that each treatment follows each other treatment exactlyonce.

This is useful when one of the blocking factors is time period, andthe effect of one treatment could carry over into the next timeperiod.

For example, a toxic drug might not only suppress the response inthe period where it is given, it could also suppress the response inthe following period.

The model contains an additional factor with g+1 levels “followstreatment 1” up to “follows treatment g” and the final level of“used first.”

Page 36: Basic Blocking

If you have three blocking factors, then you can use a Graeco-Latinsquare.

Latin letters are treatments, Greek letters indicate third blockingfactor. Each treatment occurs once in each row, once in eachcolumn, and once with each Greek letter.

A α B γ C δ D β

B β A δ D γ C α

C γ D α A β B δ

D δ C β B α A γ

No 6 by 6 GL square.

Model has additive treatment and (three) blocking factors.

Page 37: Basic Blocking

Incomplete Blocks

Complete block designs like RCB and LS are set up with everytreatment occurring in every block.

Sometimes, there are only k units in a block, and k < g . Then wemust use an incomplete block design.

Three different eye drops to study relief from irritation. There islarge subject to subject variability, so block on subject, but onlytwo eyes per subject.

Six different processes for extracting avocado oil. There is largefruit to fruit variability, so block on fruit, but each fruit is onlylarge enough to test four processes.

Page 38: Basic Blocking

Incomplete block designs are inherently less efficient than completeblock designs on a per unit basis with equal variances. Example:

AB

AC

CB

versusABC

ABC

In the complete block, unit 1 - unit 2 and unit 4 - unit 5 bothestimate A - B and both have variance 2σ2

comp.

In the incomplete block, unit 1 - unit 2 and unit 3 - unit 4 + unit5 - unit 6 both estimate A - B and have variances 2σ2

incomp and

4σ2incomp

We prefer complete blocks if σ2comp = σ2

incomp, but often

σ2comp > σ2

incomp, and that can be where incomplete blocks arepreferred.

Page 39: Basic Blocking

For example, suppose fruit to fruit variance in oil concentration is10, but quarter to quarter within a fruit variance is 1.

The relative efficiency of a BIBD with six treatments in blocks ofsize four is .9.

Without blocking, variance of a pairwise difference in means is10( 1

n + 1n ) = 20

n .

With a BIBD, variance of a pairwise difference in means is1( 1

.9n + 1.9n ) = 2.22

n .

Here the reduced variance achievable with the BIBD overcomes theloss due to relative efficiency of the BIBD to the RCB.

Page 40: Basic Blocking

Balanced Incomplete Block design

The basic prototype of all incomplete block designs is the BIBD.Here we have:

g treatments

b blocks

k units per block

each treatment used r times

bk total units

bk = rg

In addition, each pair of treatments occurs together in the samenumber of blocks. λ = r(k − 1)/(g − 1).

Page 41: Basic Blocking

AB

AC

CB

versusAB

AB

CC

Both have g=3, k=2, r=2, b=3, but left side is BIBD and rightside is not.

Page 42: Basic Blocking

Notes:

If λ = r(k − 1)/(g − 1) is not a whole number, then no BIBDfor that set of parameters.

Treatments could have factorial structure.

Also balanced in the sense that variance of α̂i − α̂j does notdepend on i,j.

A BIBD always exists for any g > k pair; simply take allcombinations. There are tables for smaller values of b and r.

Randomize by randomly assigning the treatments to thetreatment “numbers,” and then randomly assigning treatmentnumbers to units within their blocks.

Page 43: Basic Blocking

Model:yij = µ+ αi + βj + εij

For RCB, it didn’t really matter if blocks were fixed or random.For BIBD, it does matter.

If we assume blocks are fixed, we get the intrablock analysis. Allestimates are based on differences from within blocks.

If we assume blocks are random, then there is some informationabout the treatments in block totals; this leads to the interblockrecovery analysis.

Page 44: Basic Blocking

Interblock recovery provides slightly more precise estimates in caseswhere it is appropriate (i.e., when blocks are random), but largeblock variance relative to units-within-blocks variance means theimprovement is often negligible.

Interblock recovery used to be a complicated process (old school),but with lmer(), interblock recovery is not much extra effort.

Page 45: Basic Blocking

Intrablock is just treatments adjusted for fixed blocks; let R do thework.

If you could do RCB with same variance as BIBD, then

EBIBD:RCB =g(k − 1)

(g − 1)k

is the relative efficiency. The effective sample size is rE

Var(∑

i

wi α̂i ) = σ2∑

i

w2i

rE

SSTrt =∑

i

rE α̂2i

Page 46: Basic Blocking

Interblock recovery is a combination of the intrablock estimateswith estimates based on regressing block totals on the treatmentsappearing in blocks—the raw interblock estimates.

The error variance in this regression is a combination of σ2incomp

plus the block to block variance (which is often much bigger thanσ2

incomp). Raw interblock estimates have greater variability thanintrablock estimates, often much greater.

Interblock recovery combines these two, but the combination isusually pretty close to the intrablock estimates.

If you assume random blocks and use lmer, you get the interblockrecovery analysis.

Page 47: Basic Blocking

Youden Squares

These are always amusing, because Youden squares are not square.

Consider a situation with two blocking factors, but one of thefactors can only have blocks of size g − 1 instead of g .

Take a Latin square and delete one row (or column) obtaining a gby g-1 arrangement.

This is a Youden square. It is RCB for one blocking factor andBIBD for the other blocking factor.

Page 48: Basic Blocking

A B C D

B A D C

C D A B

Intrablock analysis is just treatments after both blocking factors.

You can do interblock recovery if the short (incomplete) blocks arerandom.

Page 49: Basic Blocking

Other incomplete block designs

There are many other kinds of incomplete block designs (includingonly designs in text):

Partially balanced incomplete block designs

Cyclic designs

Lattice designs

Alpha designs

Most of these are motivated by trying to get good properties froma smaller design than a BIBD. E.g., the smallest BIBD with g=12and k=7 has 132 blocks.

Most of these have N=gr=bk but relax the equal pair occurrencerequirement of BIBD in some way.

Page 50: Basic Blocking

PBIBD was an early competitor. Treatments are in associateclasses, e.g., 2 classes.

Pairs of treatments that are first associates occur together λ1

times; second associates occur together λ2 times. All treatmentshave the same number of first associates and second associates.

In addition, pick a pair of ith associates and let ρijk be the number

of treatments that are jth associates of one member of the pairand kth associates of the other member of the pair. This numbercannot depend on the original pair chosen.

Evidently, generating or verifying a PBIBD is a bit fiddly, and someof the later designs are competitors based on ease of construction.

Page 51: Basic Blocking

From a data analysis perspective, we still do intrablock astreatments adjusted for fixed block effects, and we can getinterblock recovery if we have random block effects.

The difference is that there are “simple” formulae allowing handcalculations for BIBD, and the formulae get progressively lesssimple or non-existent as we move to more complex designs. In theend, it’s all R anyway.