Presentation is loading. Please wait.

Presentation is loading. Please wait.

Factorial Experiments Analysis of Variance (ANOVA) Experimental Design.

Similar presentations


Presentation on theme: "Factorial Experiments Analysis of Variance (ANOVA) Experimental Design."— Presentation transcript:

1 Factorial Experiments Analysis of Variance (ANOVA) Experimental Design

2 Dependent variable Y k Categorical independent variables A, B, C, … (the Factors) Let –a = the number of categories (levels) of A –b = the number of categories (levels) of B –c = the number of categories (levels) of C –etc.

3 Random Effects and Fixed Effects Factors

4 A factor is called a fixed effects factors if the levels of the factor are a fixed set of levels and the conclusions of any analysis is in relationship to these levels. If the levels have been selected at random from a population of levels the factor is called a random effects factor The conclusions of the analysis will be directed at the population of levels and not only the levels selected for the experiment

5 Example - Random Effects In this Example a Taxi company is interested in comparing the effects of three brands of tires (A, B and C) on mileage (mpg). Mileage will also be effected by driver. The company selects b = 4 drivers at random from its collection of drivers. Each driver has n = 3 opportunities to use each brand of tire in which mileage is measured. Dependent –Mileage Independent –Tire brand (A, B, C), Fixed Effect Factor –Driver (1, 2, 3, 4), Random Effects factor

6 Comments The ANOVA Table will be the same for performing tests with respect to Source, SS, df and MS. The differences will occur in the denominator of the F – ratios. The denominators of the F ratios are determined by evaluating Expected Mean Squares for each effect.

7 Example: 3 factors A, B and C fixed SourceEMSF A B C AB AC BC ABC Error

8 Example: 3 factors A, B, C – all are random effects SourceEMSF A B C AB AC BC ABC Error

9 Example: 3 factors A fixed, B, C random SourceEMSF A B C AB AC BC ABC Error

10 Example: 3 factors A, B fixed, C random SourceEMSF A B C AB AC BC ABC Error

11 Rules for determining Expected Mean Squares (EMS) in an Anova Table 1.Schultz E. F., Jr. “Rules of Thumb for Determining Expectations of Mean Squares in Analysis of Variance,”Biometrics, Vol 11, 1955, 123-48. Both fixed and random effects Formulated by Schultz [1]

12 1.The EMS for Error is  2. 2.The EMS for each ANOVA term contains two or more terms the first of which is  2. 3.All other terms in each EMS contain both coefficients and subscripts (the total number of letters being one more than the number of factors) (if number of factors is k = 3, then the number of letters is 4) 4.The subscript of  2 in the last term of each EMS is the same as the treatment designation.

13 5.The subscripts of all  2 other than the first contain the treatment designation. These are written with the combination involving the most letters written first and ending with the treatment designation. 6.When a capital letter is omitted from a subscript, the corresponding small letter appears in the coefficient. 7.For each EMS in the table ignore the letter or letters that designate the effect. If any of the remaining letters designate a fixed effect, delete that term from the EMS.

14 8.Replace  2 whose subscripts are composed entirely of fixed effects by the appropriate sum.

15 Example - Random Effects In this Example a Taxi company is interested in comparing the effects of three brands of tires (A, B and C) on mileage (mpg). Mileage will also be effected by driver. The company selects at random b = 4 drivers at random from its collection of drivers. Each driver has n = 3 opportunities to use each brand of tire in which mileage is measured. Dependent –Mileage Independent –Tire brand (A, B, C), Fixed Effect Factor –Driver (1, 2, 3, 4), Random Effects factor

16 The Data

17 Asking SPSS to perform Univariate ANOVA

18 Select the dependent variable, fixed factors, random factors

19 The Output The divisor for both the fixed and the random main effect is MS AB This is contrary to the advice of some texts

20 The Anova table for the two factor model (A – fixed, B - random) SourceSSdfMSEMSF ASS A a -1MS A MS A /MS AB BSS A b - 1MS B MS B /MS Error ABSS AB (a -1)(b -1)MS AB MS AB /MS Error ErrorSS Error ab(n – 1)MS Error Note: The divisor for testing the main effects of A is no longer MS Error but MS AB. References Guenther, W. C. “Analysis of Variance” Prentice Hall, 1964

21 The Anova table for the two factor model (A – fixed, B - random) SourceSSdfMSEMSF ASS A a -1MS A MS A /MS AB BSS A b - 1MS B MS B /MS AB ABSS AB (a -1)(b -1)MS AB MS AB /MS Error ErrorSS Error ab(n – 1)MS Error Note: In this case the divisor for testing the main effects of A is MS AB. This is the approach used by SPSS. References Searle “Linear Models” John Wiley, 1964

22 Crossed and Nested Factors

23 The factors A, B are called crossed if every level of A appears with every level of B in the treatment combinations. Levels of B Levels of A

24 Factor B is said to be nested within factor A if the levels of B differ for each level of A. Levels of B Levels of A

25 Example: A company has a = 4 plants for producing paper. Each plant has 6 machines for producing the paper. The company is interested in how paper strength (Y) differs from plant to plant and from machine to machine within plant Plants Machines

26 Machines (B) are nested within plants (A) The model for a two factor experiment with B nested within A.

27 The ANOVA table SourceSSdfMSFp - value ASS A a - 1MS A MS A /MS Error B(A)B(A)SS B(A) a(b – 1)MS B(A) MS B(A) /MS Error ErrorSS Error ab(n – 1)MS Error Note: SS B(A ) = SS B + SS AB and a(b – 1) = (b – 1) + (a - 1)(b – 1)

28 Example: A company has a = 4 plants for producing paper. Each plant has 6 machines for producing the paper. The company is interested in how paper strength (Y) differs from plant to plant and from machine to machine within plant. Also we have n = 5 measurements of paper strength for each of the 24 machines

29 The Data

30 Anova Table Treating Factors (Plant, Machine) as crossed

31 Anova Table: Two factor experiment B(machine) nested in A (plant)

32 ANOVA Table for 3 factors crossed EffectSSdf ASS A (a – 1) BSS B (b – 1) CSS C (c – 1) ABSS AB (a – 1) (b – 1) ACSS AC (a – 1) (c – 1) BCSS BC (b – 1) (c – 1) ABCSS ABC (a – 1) (b – 1) (c – 1) ErrorSS Error abc(n – 1)

33 ANOVA Table for 3 nested factors B nested in A, C nested in B EffectSSdf ASS A (a – 1) B(A)B(A)SS B(A) a(b – 1) C(AB)SS C(AB) ab(c – 1) ErrorSS Error abc(n – 1) Note: SS B(A) = SS B + SS AB and a(b – 1) = (b – 1) + (a – 1)(b –1) Also SS C(AB) = SS C + SS AC + SS BC + SS ABC and ab(c – 1) = (c – 1) + (a – 1)(c –1) + (b – 1)(c –1) + (a – 1)(b –1)(c –1)

34 Also in nested designs Factors may be fixed effect factors or random effect factors Levels of the factor are a fixed set of levels Levels of the factor are chosen at random from a population of levels This effects the divisor in the F ratio for testing the effect

35 Other experimental designs Randomized Block design Latin Square design Repeated Measures design

36 The Randomized Block Design

37 Suppose a researcher is interested in how several treatments affect a continuous response variable (Y). The treatments may be the levels of a single factor or they may be the combinations of levels of several factors. Suppose we have available to us a total of N = nt experimental units to which we are going to apply the different treatments.

38 The Completely Randomized (CR) design randomly divides the experimental units into t groups of size n and randomly assigns a treatment to each group.

39 The Randomized Block Design divides the group of experimental units into n homogeneous groups of size t. These homogeneous groups are called blocks. The treatments are then randomly assigned to the experimental units in each block - one treatment to a unit in each block.

40 Example 1: Suppose we are interested in how weight gain (Y) in rats is affected by Source of protein (Beef, Cereal, and Pork) and by Level of Protein (High or Low). There are a total of t = 3  2 = 6 treatment combinations of the two factors (Beef -High Protein, Cereal-High Protein, Pork-High Protein, Beef -Low Protein, Cereal-Low Protein, and Pork-Low Protein).

41 Suppose we have available to us a total of N = 60 experimental rats to which we are going to apply the different diets based on the t = 6 treatment combinations. Prior to the experimentation the rats were divided into n = 10 homogeneous groups of size 6. The grouping was based on factors that had previously been ignored (Example - Initial weight size, appetite size etc.) Within each of the 10 blocks a rat is randomly assigned a treatment combination (diet).

42 The weight gain after a fixed period is measured for each of the test animals and is tabulated on the next slide:

43 Randomized Block Design

44 Example 2: The following experiment is interested in comparing the effect four different chemicals (A, B, C and D) in producing water resistance (y) in textiles. A strip of material, randomly selected from each bolt, is cut into four pieces (samples) the pieces are randomly assigned to receive one of the four chemical treatments.

45 This process is replicated three times producing a Randomized Block (RB) design. Moisture resistance (y) were measured for each of the samples. (Low readings indicate low moisture penetration). The data is given in the diagram and table on the next slide.

46 Diagram: Blocks (Bolt Samples)

47 Table Blocks (Bolt Samples) Chemical123 A10.112.211.9 B11.412.912.7 C9.912.311.4 D12.113.412.9

48 The Model for a randomized Block Experiment i = 1,2,…, tj = 1,2,…, b y ij = the observation in the j th block receiving the i th treatment  = overall mean  i = the effect of the i th treatment  j = the effect of the j th Block  ij = random error

49 The Anova Table for a randomized Block Experiment SourceS.S.d.f.M.S.Fp-value TreatSS T t-1MS T MS T /MS E BlockSS B n-1MS B MS B /MS E ErrorSS E (t-1)(b-1)MS E

50 A randomized block experiment is assumed to be a two-factor experiment. The factors are blocks and treatments. The is one observation per cell. It is assumed that there is no interaction between blocks and treatments. The degrees of freedom for the interaction is used to estimate error.

51 The Anova Table for Diet Experiment

52 The Anova Table forTextile Experiment

53 If the treatments are defined in terms of two or more factors, the treatment Sum of Squares can be split (partitioned) into: –Main Effects –Interactions

54 The Anova Table for Diet Experiment terms for the main effects and interactions between Level of Protein and Source of Protein

55 Repeated Measures Designs

56 In a Repeated Measures Design We have experimental units that may be grouped according to one or several factors (the grouping factors) Then on each experimental unit we have not a single measurement but a group of measurements (the repeated measures) The repeated measures may be taken at combinations of levels of one or several factors (The repeated measures factors)

57 Example In the following study the experimenter was interested in how the level of a certain enzyme changed in cardiac patients after open heart surgery. The enzyme was measured immediately after surgery (Day 0), one day (Day 1), two days (Day 2) and one week (Day 7) after surgery for n = 15 cardiac surgical patients.

58 The data is given in the table below. Table: The enzyme levels -immediately after surgery (Day 0), one day (Day 1),two days (Day 2) and one week (Day 7) after surgery

59 The subjects are not grouped (single group). There is one repeated measures factor - Time – with levels –Day 0, –Day 1, –Day 2, –Day 7 This design is the same as a randomized block design with –Blocks = subjects

60 The Anova Table for Enzyme Experiment The Subject Source of variability is modelling the variability between subjects The ERROR Source of variability is modelling the variability within subjects

61 Example : (Repeated Measures Design - Grouping Factor) In the following study, similar to example 3, the experimenter was interested in how the level of a certain enzyme changed in cardiac patients after open heart surgery. In addition the experimenter was interested in how two drug treatments (A and B) would also effect the level of the enzyme.

62 The 24 patients were randomly divided into three groups of n= 8 patients. The first group of patients were left untreated as a control group while the second and third group were given drug treatments A and B respectively. Again the enzyme was measured immediately after surgery (Day 0), one day (Day 1), two days (Day 2) and one week (Day 7) after surgery for each of the cardiac surgical patients in the study.

63 Table: The enzyme levels - immediately after surgery (Day 0), one day (Day 1),two days (Day 2) and one week (Day 7) after surgery for three treatment groups (control, Drug A, Drug B)

64 The subjects are grouped by treatment –control, –Drug A, –Drug B There is one repeated measures factor - Time – with levels –Day 0, –Day 1, –Day 2, –Day 7

65 The Anova Table There are two sources of Error in a repeated measures design: The between subject error – Error 1 and the within subject error – Error 2

66 Tables of means DrugDay 0Day 1Day 2Day 7Overall Control118.6377.8860.5055.7578.19 A103.2568.2552.0051.5068.75 B103.3869.3854.1351.5069.59 Overall108.4271.8355.5452.9272.18

67


Download ppt "Factorial Experiments Analysis of Variance (ANOVA) Experimental Design."

Similar presentations


Ads by Google