Download Two-way analysis of variance (ANOVA) and more Lecture notes Mathematics in PDF only on Docsity! 1 Statistical Analysis 8: Two-way analysis of variance (ANOVA) Research question type: Explaining a continuous variable with 2 categorical variables What kind of variables? Continuous (scale/interval/ratio) and 2 independent categorical variables (factors) Common Applications: Comparing means of a single variable at different levels of two conditions (factors) in scientific experiments. Example: The effective life (in hours) of batteries is compared by material type (1, 2 or 3) and operating temperature: Low (-10˚C), Medium (20˚C) or High (45˚C). Twelve batteries are randomly selected from each material type and are then randomly allocated to each temperature level. The resulting life of all 36 batteries is shown below: Table 1: Life (in hours) of batteries by material type and temperature Temperature (˚C) Low (-10˚C) Medium (20˚C) High (45˚C) M at er ia l ty p e 1 130, 155, 74, 180 34, 40, 80, 75 20, 70, 82, 58 2 150, 188, 159, 126 136, 122, 106, 115 25, 70, 58, 45 3 138, 110, 168, 160 174, 120, 150, 139 96, 104, 82, 60 Source: Montgomery (2001) Research question: Is there difference in mean life of the batteries for differing material type and operating temperature levels? In analysis of variance we compare the variability between the groups (how far apart are the means?) to the variability within the groups (how much natural variation is there in our measurements?). This is why it is called analysis of variance, abbreviated to ANOVA. This example has two factors (material type and temperature), each with 3 levels. Hypotheses: The 'null hypothesis' might be: H0: There is no difference in mean battery life for different combinations of material type and temperature level And an 'alternative hypothesis' might be: H1: There is a difference in mean battery life for different combinations of material type and temperature level If the alternative hypothesis is accepted, further analysis is performed to explore where the individual differences are. Loughborough University Mathematics Learning Support Centre Coventry University Mathematics Support Centre 2 Steps in SPSS (PASW): Data need to be arranged in SPSS in a particular way to perform a two-way ANOVA. The dependent variable (battery life) values need to be in one column, and each factor needs a column containing a code to represent the different levels. In this example Material has codes 1 to 3 for material type in the first column and Temp has codes 1 for Low, 2 for Medium and 3 for High operating temperatures. The battery life (Life) is entered in the third column – see screen to the left. Note carefully how the data are entered. The raw data file for this example is available on W:\EC\STUDENT\ MATHS SUPPORT CENTRE STATS WORKSHEETS\battery.sav Then choose: Analyze > General Linear Model > Two-Way ANOVA… Transfer the outcome variable (Life in this example) into the Dependent Variable box, and the factor variables (Material and Temp in this case) as the Fixed Factor(s) Click on Model… and select Full factorial to get the 'main effects' from each of the two factors and the 'interaction effect' of the two factors. [It is possible to build a Custom model, if you prefer] Continue Click on Plots…, and choose Temp for Horizontal Axis and Material in Separate Lines (see right) Click Add and Continue Click on Post Hoc… and select Material and Temp Check Tukey (or post hoc test of choice) Continue Click on Options… and choose to Display Means for Material, Temp and Material*Temp Check Descriptive statistics and Homogeneity tests (see right) Continue and OK