<<

Overview: Completely randomized designs (CRDs) Factors, Factorials, and

STAT:5201

Week 2: Lecture 1

1 / 44 Completely Randomized Design (CRD)

Simplest design set-up EUs are are randomly assigned to treatments Easiest to do Easiest to analyze Often sufficient for the goals Example (One-factor study CRD) DayLength (short/long) is the only factor in the study. We have eight hamsters (EUs). We use a random number table to assign the short DayLength to 4 hamsters and the long DayLength to 4 hamsters. NI Enzyme level is recorded at the end of the study.

2 / 44 Completely Randomized Design (CRD)

A completely randomized design (CRD) has * N units * g different treatments P * ni observations in each treatment where ni = N − If all groups have an equal n observations it is a balanced design * Completely of EUs to treatments

Completely random assignment that every possible group of units into g groups with the given sizes is equally likely.

Example (One-factor study CRD) In this balanced single factor study, hamsters have equal probability of being assigned to either of the 2 treatments which are the levels of the DayLength factor or long or short... g = 2, n1 = n2 = 4, N = 8.

3 / 44 Completely Randomized Design (CRD)

Example (CRD single factor ) The number of times a rod was used to remove entrapped air from a concrete sample was used as the design variable in an experiment. The response variable was compressive strength of the concrete. Three runs were done on each of 4 levels of the factor Rodding Level (10,15,20,25). This was a CRD as the 12 runs were randomly assigned to the treatments in a balanced fashion, run shown in parentheses.

Rodding Level Compressive Strength 10 1530(1) 1530(4) 1440(9) 15 1610(3) 1650(7) 1500(8) 20 1560(6) 1730(10) 1530(12) 25 1500(2) 1490(5) 1510(11)

Montgomery, Applied Stat and Prob Engrs (2011)

4 / 44 Completely Randomized Design (CRD)

Example (CRD single factor experiment - SAS)

5 / 44 Completely Randomized Design (CRD)

Example (CRD single factor experiment - SAS)

6 / 44 Completely Randomized Design (CRD)

Example (CRD single factor experiment - SAS) SAS plot using coding from Dean et al. page 54

7 / 44 Completely Randomized Design (CRD)

Example (CRD single factor experiment - SAS) Another option for plotting

8 / 44 Completely Randomized Design (CRD)

Example (CRD single factor experiment - SAS) Diagnostic plots (automatically generated from model fit): 1) check constant [violated] 2) check normality

9 / 44 Completely Randomized Design (CRD)

In the single factor experiment, the usual items of interest...

Is there evidence that some means are different? If at least some are different, which are different from each other? Any pattern in the differences? Estimates/confidence intervals of means and differences. In some special cases, variability may be of interest.

10 / 44 Completely Randomized Design (CRD)

A completely randomized design can have more than one factor.

Example (CRD two-factor experiment) Besides DayLength (short/long), researchers are interested in a Climate (cold/warm) effect. The combination of these two factors give four treatment groups to this study. As a CRD, we will randomly assign the 8 hamsters to the 4 treatment groups (placing 2 hamsters in each treatment group).

11 / 44 Completely Randomized Design (CRD)

It can be useful to perceive a CRD two-factor study as a single factor study where the single factor, or “superfactor”, has levels coinciding with the crossing of the two factors. Example (CRD two-factor experiment) This two-factor CRD study could also be perceived as a single “superfactor” experiment...

You might think of it this way when you’re doing the , or for reasons of convenience that may come-up later.

In CRDs, there is no blocking or nesting. Given the treatment group, the observations are independent.

12 / 44 Multifactor

In an experiment, factors can be either... * controlled * controlled for * left uncontrolled * held fixed

If we have the ability to choose and set the levels of a factor, then this factor can be controlled. * Choosing dosage levels of a drug (10ml, 20ml, 30ml,...) * Choosing the temperature at which to run a process (250◦, 300◦,...) * Choosing day length exposure (short, long)

13 / 44 Multifactor Experiments

Sometimes we want to include a factor in our study because it is likely to be a large source of variation, but we don’t have the power to “assign” the levels. The, we instead control for the factor. * Sex * Age * Genetic background, family group * Income level

Only factors having relatively small effects on the response should be left uncontrolled. Randomization should take care of these small effects in that our results won’t be biased. And obviously, factors having small effects that we are unaware of are left uncontrolled.

Holding a factor fixed is an option, but it means you’ve narrowed the scope of your experiment.

14 / 44 Multifactor Experiments

Factors of interest can be called “Primary factors”.

Other factors may be included in the study as they are known to be a large source of variation in the response, but not of primary interest. These factors can be called “Nuisance Factors”.

For example, we are interested in comparing two drugs or drug brand (primary factor) but we know that age group (nuisance factor) may also be related to the response, but I’m not really interested in detecting an age effect or estimating an age effect.

15 / 44 Multifactor Experiments

When deciding if a factor is a primary factor or not, I might ask a client: Do you want a formal p-value comparing the different levels of of the factor? In other words, do you want to be able to say... ‘We found Drug A to be significantly different than Drug B...’ If so, then drug effect is a primary factor.

Only nuisance factors, not primary factors, are used as blocking factors. This is because we’re not interested in how the response changes from one “nuisance block’ to the next. We’re really interested in how the response changes from one treatment to the next within a block.

A factor that is used as a blocking factor is usually confounded with other nuisance factors, and that means any observed differences between the blocks could be due to something other than the block itself (e.g. what ‘looked’ like an age effect was actually a day effect).

16 / 44 Factorial Exeriments

Factorials are the simplest kind of multifactor experiment. * design consists of two or more factors * there is no blocking * there is no nesting * CRD set-up, assigning treatments to EUs Example (Two-factor factorial, 2x2 factorial) Revisiting our earlier example, we have 4 treatments from the combinations of DayLength (short/long) and Climate (cold/warm) and 8 EUs, with 2 EUs randomly assigned to each treatment as a CRD.

17 / 44 Plots

Interaction Plots or Profile Plots Constructed by plotting the cell means for each combination of factors, such that the levels of one factor are shown on the horizontal axis and the levels of the other factor (the trace factor) are represented by separate lines.

When you have two factors, either one can be used as the factor along the x-axis. Often, one of the two possible plots seems better for interpretation purposes. 18 / 44 Interaction Plots

Interaction Plots or Profile Plots Interaction plots make it easy to see information in the quickly... *Which treatment gives the highest response? Lowest response?

If the lines are parallel, then the effects of the two factors are said to be ‘additive’ or ‘main effect only’ and there is no interaction.

If the lines are not parallel, then we say the two factors interact or there is interaction between the factors. So, there’s a more complicated story there.

If we have additive effects (no interaction present), then the effects of a factor are the same for all levels of the other factor.

If there is interaction, then the effects of a factor are different at differing levels of the other factor.

19 / 44 Possible Interaction Plots - two factors

Interaction Plots or Profile Plots Suppose we have two factors A and B and each has two levels as low and high in a factorial CRD experiment.

There are a number of possible observed interaction plots.

20 / 44 Possible Interaction Plots - two factors

Interaction Plots or Profile Plots Parallel lines. No interaction is present.

The effect of factor B is essentially the same for all levels of factor A. We say the effects of these factors are additive effects.

21 / 44 Possible Interaction Plots - two factors

Interaction Plots or Profile Plots Non-parallel lines. Interaction is present.

The effect of factor B depends on the level of factor A. On the left, the effect of factor B is much larger when factor A is set at ‘high’. On the right, the effect of factor B is not only larger when factor A is set at ‘high’, but it’s in the opposite direction!

NOTE: The cell means give us an idea about interaction, but we need to formally test for an interaction in our modeling, and not rely on a graphic suggestion. 22 / 44 Interaction Plots - three factors

Higher orders of interaction

The previous discussion has focused on 2-way interaction. But you can have a 3-way, 4-way, 5-way, ... interaction as well.

These interactions quickly become difficult to interpret, and difficult to deal with (without partitioning the data into subsets).

Often, we hope (or maybe just assume) that these higher order interactions are not present. But if we are able to test for them, we should.

23 / 44 ,.,-(

Jk... f nv:"'0J of;.. C-U/JA ; sYL l-i.o.

ca.+<- .. • ao BJ yfi/A., c.. 3-wq( 1 i--w4/'1 a4!tl. f{{ldj ft; cltff,ea# -fo w,-!h ( b1ed/d

/Ja_ /J:, ) ij/.eUr I ( fn /ud'- fhJ <21._Q Interaction Plots - three factors vw-f Higher orders of interaction Three-way interaction exists if the two-way interaction differs across the levels of a third variable. Example (Three factor factorial, 2x2x2 or 23 factorial) Consider a three-factor factorial CRD with factors A, B, and C each with a low or high level. There are 8 treatments.

L H L H A A 2-v..Jr:.c.y ==t No 3-wCly

24 / 44 Interaction Plots - three factors

Higher orders of interaction

Example (Three factor factorial) Another possibility...pss.s;b;(;f.J ... C -k

L 1-1 L I-( A 4

f)&l-.s. 2-Wf/,_'/ 'J:.;J:,.,._.J.;Ok.. di.rd.s

25 / 44 Blocking

As we move away from completely randomized designs to more complex designs, the first design we will consider is the randomized complete (RCBD). To block an experiment is to divide, or partition, the experimental units into groups called blocks. A block of units is a set of units that are homogeneous in some sense. To form blocks, we organize EUs into groups having similar characteristics. EUs Possible Blocking factor patients age (11-20, 21-30, ..., 81-90) patients family patients the hospital giving the care factory workers shift (early, late, night) field plots location/soil composition skin patches two patches from same person 26 / 44 Blocking

Other ways to form a block: * Physically divide an object into parts, like a manufacturing setting. * Repeat testing of the same object under the different conditions (like when you give both drugs to the same person).

Best case scenario is when we have enough EUs in a block to observe all treatments (complete block). Otherwise, we have an incomplete block.

A RCBD utilizes , where we randomly assign the EUs to treatments within a block. Thus, if there are r blocks, then we will do r restricted randomizations, one for each block, to assign the EUs to the treatments within block.

27 / 44 Blocking

Example (Randomized Complete Block Design) Drugs A, B, C, and D are to be compared. We have formed blocks based on age, and we have 4 patients in each of 6 age blocks. We are not interested in testing for an age effect (it is a nuisance factor) as we are most interested in comparing treatments. Within each block, we randomly assign a unique drug to the 4 patients.

28 / 44 Blocking

Remember, don’t use a primary factor of interest for blocking. A blocking factor should be a nuisance factor. Something that is a source of variation for the response but is not of great interest.

We don’t use a factor of interest as a block because we confound numerous nuisance factors together in a block.

EXAMPLE: Possible nuisance factors are lab assistant & day of week.

Plan - Complete all asst. 1 runs on Monday, complete all asst. 2 runs on Tuesday, etc. If there was a large block effect, then blocking was useful, and I’m not interested in knowing if it was the assistant or the day (or something else) that had a big impact.

29 / 44 Blocking

Blocked designs are not completely randomized designs. They use a restricted randomization.

Blocking is a variance reduction technique.

Block-to-block variability is still in the data, but we essentially remove this variability when comparing treatments (because we see all treatments within a block).

Blocking is most useful when there is wide variability across blocks. We don’t usually test for a block effect because we EXPECT a large difference across blocks, that’s exactly why we’re using it, and it’s a nuisance factor anyway.

In general, we assume there is no interaction between the block and the treatment. We assume the treatment effect (i.e. differences between the treatments) is the same for all blocks.

30 / 44 Blocking

By comparing treatments within a block, we remove the block-to-block variability from our treatment comparison analysis.

Blocking is a powerful tool and should be used if possible to control for any ‘nuisance’ variation that is thought to be large.

31 / 44 Randomized Complete Block Design (RCBD)

RCBD... Uses ‘restricted randomization’, performed within each block. * g treatments * g EUs per block * r blocks * rg = N total units

It’s like r single- CRDs glued together.

The RCBD is used to increase power and precision of an experiment by decreasing the error variance used in testing.

32 / 44 RCBD

Example (Randomized Complete Block Design) Here, we revisit the golden hamster example and perceive the 4 treatments as a single ‘superfactor’ created from the combination of DayLength and Climate, and we include a nuisance factor Litter (similar to ‘family’) to be used as a blocking factor.

We expect large litter-to-litter variability due to genetics. From each of L litters, we have 4 hamsters.

Treatments: A) cold/short B) cold/long C) warm/short D) warm/long

33 / 44 RCBD

Example (CRD vs. RCBD)

See handout on CRD and RCBD for litter example.

34 / 44 Fixed effects vs. Random effects

Sometimes the levels of a factor are random. Then this is a random factor and it has random effects.

For example, when we randomly choose the litters in our hamster experiment, the factor Litter has random levels, usually numbered as 1,2,3,... and they were chosen from a large population of possible litters. If we repeated the hamster experiment, and again randomly chose litters, the litters from the first experiment would be different than the litters from the second experiment (again, random levels).

When the levels of a factor are fixed values then it is a fixed factor and has fixed effects. For example, when you have levels of ‘circle’ and ‘square’ for the factor Shape, if you repeated the experiment, you would have the same two shapes (they were not randomly chosen). Primary factors usually have fixed effects.

35 / 44 Random effects

Example (Random factor ‘Litter’) The litters in the experiment are a random draw from the large population of litters available.

Example (Random factor ‘Day’) The days in your experiment are a random draw (in theory) from the large population of days available.

The variability among the litters or the days in the examples above are meant to represent the general variability among these units in the given population. We model random effects and fixed effects differently. Again, primary factors (i.e. factors of interest) are usually fixed effects.

36 / 44 Fixed effects vs. Random effects

The name of the factor does not tell you whether or not it is has random effects. Consider the factor called School. Example (School as a fixed effect) There are 3 schools in a study labeled A,B,C. These are the only schools presently of interest. We want to know if the response is significantly different between these schools (A vs B, A vs C, B vs C). If we repeated the experiment, we would use these same three schools again.

Example (School as a random effect) Three schools are randomly chosen from all available schools. We will label them as s1, s2, and s3. The variability in the response among s1, s2, and s3 is meant to represent the variability among all schools. If we repeated the experiment and randomly chose schools again, we would not use these same three schools.

37 / 44 Random effects

If we have a random factor with random effects, what do we wish to estimate? For the school random effect, we want to make a statement about all schools using a random sample of school.

Typically, we want to estimate the general variability among units, 2 such as σschool .

Blocking factors, in general, have random effects, but we will start the course by considering them as fixed, but change this later as we move into the random effects topic.

38 / 44 Real Experiment - Cotton Spinning Experiment

Example (Dean, Section 2.3, p. 13) Objective - To understand how the degree of twist (i.e. turns per inch) and the type of guide (i.e. ‘flyer’) affect breakage.

Factors of interest: 1) twist (1.63, 1.69, 1.78, 1.90) 2) flyer (1=ordinary, 2=special)

Response variable: breaks per pound

The full crossing of the factors of interest would include 8 treatment groups, but two were thrown-out based on results from a pilot study (ordinary/1.63, and special/1.90).

39 / 44 Real Experiment - Cotton Spinning Experiment

Example (Dean, Section 2.3, p. 13) What are some other sources of variation in the breakage rate?

1) Quality of material (roving below) 2) Environmental conditions 3) Operator 4) Machine

40 / 44 Real Experiment - Cotton Spinning Experiment

Example (Dean, Section 2.3, p. 13) What design might they use? • Completely randomized design • Randomized complete block design (chosen design, data below) •

41 / 44 Real Experiment - Cotton Spinning Experiment

Example (Dean, Section 2.3, p. 13) The data is available in a SAS data file from the author’s website.

42 / 44 Real Experiment - Cotton Spinning Experiment

Example (Dean, Section 2.3, p. 13) In this analysis, I first created more meaningful names for the treatment groups by creating a new variable called ‘trt’ as below.

43 / 44 Real Experiment - Cotton Spinning Experiment

Example (Dean, Section 2.3, p. 13) Then I generated a plot specifying a unique symbol for each of the 13 blocks.

44 / 44