Lecture 7 - One Way, Factorial Repeated Measures and Mixed Factorial ANOVA PDF
Document Details

Uploaded by CommodiousApostrophe6548
University of York
Tags
Summary
This document presents a lecture on research design and statistics, specifically covering one-way, factorial repeated measures, and mixed factorial ANOVA. It includes a helpful decision tree for choosing the appropriate statistical test based on various factors.
Full Transcript
Research Design and Statistics Lecture 7: One-way and Factorial repeated measures ANOVA And mixed factorial ANOVA Overview OVERVIEW One-way repeated ANOVA Rationale of Repeated measures ANOVA One way & Two way Benefits Partitioning Variance Inter...
Research Design and Statistics Lecture 7: One-way and Factorial repeated measures ANOVA And mixed factorial ANOVA Overview OVERVIEW One-way repeated ANOVA Rationale of Repeated measures ANOVA One way & Two way Benefits Partitioning Variance Interpretation Assumptions to be met Main effect and interactions Mixed Model ANOVA Interpretation Main effects Interaction effects Decision tree - our learning framework 1. What sort of CONTINUOUS (CONT) CATEGORICAL (CAT) measurement? 2. How many predictor TWO variables? ONE TWO (or more) ONE (or more) 3. What type of predictor CONT CAT CONT CAT BOTH CAT CONT CAT CONT BOTH variable? 4. How many levels of MORE THAN categorical predictor? TWO TWO 5. Same (S) or Different (D) participants for each S D S D S D BOTH D D predictor level? independent ANOVA Multiple regression 6. Meets assumptions t-test (independent) measures ANVOA One-way repeated measures ANOVA t-test (dependent) Factorial repeated Factorial ANOVA for parametric tests? Factorial mixed Correlation or Independent Regression YES ANCOVA One-way Pearson ANOVA Logistic Regression Logistic Regression Logistic Regression Log-linear analysis Chi-Squared test Mann-Whitney Kruskal-Wallis Spearman Friedman Willcoxon NO Last week: More than two means - ANOVA In the case here, we have Outcomei = (model) + errori three means and the model accounts for the three Yi = bo + b1X1i + b2X2i + ei levels of a categorical variable with dummy Yi = (bo + b1X1i + b2X2i) + ei variables. Repeated measures: updating the model Outcomei = (model) + errori Yi = bo + b1X1i + ei Ygi = (bo + u0i) + (b1+ u1i)Xgi + egi This looks far more complicated than before! Repeated measures: updating the model Ygi = (bo + u0i) + (b1+ u1i)Xgi + egi We effectively have a model for each b1 participant with the values of u tweaking the bo model to account for individual differences in the baseline mean and the change in mean associated with the predictor(s) g denotes the condition and i the participant g=1 g=2 Repeated measures ANOVA Ygi = (bo + u0i) + (b1+ u1i)Xgi + egi This model is general and b1 flexible, but the ANOVA bo approach applies a more limited model that is simpler, but less flexible. g=1 g=2 Repeated measures ANOVA This model is general and flexible, but the ANOVA approach applies a more b1 limited model that is simpler bo (phew), but less flexible. It relies on a new assumption, which is called, Sphericity g=1 g=2 Sphericity Sphericity is best thought of as the homogeneity of the the variances of the differences between conditions. The table on the right has three conditions - A,B,C - and three differences between those conditions - A-B, A-C, B-C. Computing the variance of the differences shows that they are roughly equivalent In turn this means the assumption of Sphericity is met SPSS uses Mauchly’s test to test for Sphericity and then offers If it isn’t there are ways to correct the corrections to the ANOVA if there are significant departures from the ANOVA so type 1 errors are not assumption. We will come back to that later. increased How we attribute variance in repeated measures designs As we have before, we compute F ratios to understand whether or not the effects of interest are significant For a one-way ANOVA the effect of interest is the condition We can attribute the variances to the following sources as shown in the diagram to the right 1. Within participant variability (think of this as how the outcome changes for individuals) 2. Between participant variation is expected, but not the variation we are interested in explaining. This is useful because in a nutshell accounting for it separately allows our sensitivity to the effects were are interested in to be increased. Note that in the independent ANOVA the between participants variation is the variation that contained the variation we were interested in. How we attribute variance in repeated measures designs We can now consider how the within participants variation is split down further to understand what the important F ratios will be 1. Within participant variability (think of this as how the outcome changes for individuals) is split between: a. The variation within participants caused by the effect of the conditions we used in the experiment. This is the variation that we model. b. The error or residuals that cannot be explained by our model and the between subjects variation. Variation is captured by the sum of squares To compute F ratios we will first compute sum of squares. We have the following: SST SSB SSW SSM SSR The total sum of squares, SST SST = s2grand(N-1) Here the total sum of squares is computed as the square of the standard deviation of all scores, using the grand mean as the ‘reference’ This makes sense as there is no model other than one mean degrees of freedom, df = N-1 The within-participant sum of squares, SSw SSw = s2p1(n-1) + s2p2(n-1) + … + s2pN(n-1) Here the within-participant sum of squares is computed as the square of the standard deviation of each participant’s scores multiplied by the number of conditions minus 1, summed over all participants. degrees of freedom is the number of participants multiplied by the number of conditions minus 1; df = N(n-1) The model sum of squares, SSM SSM = Σng(xg - xgrand)2 Here the model sum of squares is computed as the square of the differences between the mean of the participant scores for each condition and the grand mean multiplied by the number of participants tested, summed over all conditions. degrees of freedom is the number of conditions minus 1; df = n-1 The residual sum of squares, SSR SSR = SSW - SSM Here we make use of the idea that all variation within participants is made up of the variation we explain with the model and the residual. So, the residual sum of squares is simply the difference between the within- participant sum of squares and the sum of squares for the model. degrees of freedom follows the same relationship; df = N(n-1) - n-1 = (N-1)(n-1) The residual sum of squares, SSR SSR = SSW - SSM Here we make use of the idea that all variation within participants is made up of the variation we explain with the model and the residual. So, the residual sum of squares is simply the difference between the within- participant sum of squares and the sum of squares for the model. degrees of freedom follows the same relationship; df = N(n-1) - n-1 = (N-1)(n-1) Mean Sums of Squares MSM = SSM / dfM MSR = SSR / dfR F ratio for the ANOVA (model) FA = MSM / MSR Example to demonstrate one-way RM ANOVA, the use of contrasts and post hoc tests - Field Chapter 15 8 Celebrities ate four different ‘foods’ The outcome was the time to retch All participants ate all the foods The table has seven columns; 1 - the participant ID (1-8) 2 - 5 are the columns of times to retch for eating the the stick insect, kangaroo testicle, fish eye and witchetty grub 6 and 7 give the mean and square of This table is formatted in a way that could be used in the standard deviation SPSS in terms of each row being data for each participant Analyze -> General Linear Model -> Repeated Measures Window pops up in which we need to define the ‘Within subject Factor’ 1. Give it a meaningful name e.g. ‘Animal’, for the food eaten 2. Specify the number of levels. Here we have four different levels of the factor ‘Animal’, so we enter 4 3. Then click the ‘Add’ button Analyze -> General Linear Model -> Repeated Measures We now need to press the ‘Define’ button. This prompts us to assign the data (stored in columns) to the levels of the factor In a one-way design this is relatively straightforward, but we may want to ensure that if we have a factor in which there is a clear incremental order to the factor and/or a control condition, the order of the entry may offer a time saver later on in terms of specifying The columns of data appear in a list and they are contrasts. highlighted to transfer them into the list labeled Within-subject variables Analyze -> General Linear Model -> Repeated Measures We now need to press the ‘Define’ button. This prompts us to assign the data (stored in columns) to the levels of the factor In a one-way design this is relatively straightforward, but we may want to ensure that if we have a factor in which there is a clear incremental order to the factor and/or a control condition, the order of the entry may offer a time saver later on in terms of specifying The columns of data appear in a list and they are contrasts. highlighted to transfer them into the list labeled Within-subject variables Contrasts If we have hypotheses that some conditions will have effects greater than others, or we want to specifically compare some but not all conditions, we can set up contrast Clicking on the Contrasts button will take us to another window to specify the contrasts we want Contrasts The default is Polynomial, but the list of options is available and can be changed. For example, a simple contrast comparing all conditions vs the first (or last) level of the factor can be specified Highlighting the Factor allows the ‘Contrast’ drop down to be selected to specify the contrast. Custom contrasts can be specified using SPSS syntax - see Field Chapter 15 Post hoc tests To access post hoc tests We need to click on ‘EM Means’ Post hoc tests Selectin EM Means takes us to another window. Where we need to select the ‘Animal’ factor and put it in the ‘Display Means for’ list We then click the ‘Compare Main Effects’ button and specify the confidence interval adjustment A conservative approach is to use the Bonferroni method Outputs - Assumptions Assumptions Mauchly’s test of sphericity A significant effect means that corrections need to be made later on Those corrections are listed in the main ANOVA output table Outputs - Tests of Within-Subjects Effects A table with 5 columns of numbers, which are: 1. The sum of squares 2. The degrees of freedom 3. The mean sum of squares 4. The F ratio 5. The Significance value, We are interested in the top half of the table that has p four rows. Each row reports degrees of freedom and the associated p value for situations where Sphericity can be assumed and 3 corrections for when it can’t Effect size You can use the Mean Sum of Squares from this table, but will also need to compute the total sum of squares which is not in this table! The nice thing, however, is that SPSS give an eta squared value! This isn’t shown in this output table, but will, in general appear if you’ve selected the correct options in SPSS Decision tree - our learning framework 1. What sort of CONTINUOUS (CONT) CATEGORICAL (CAT) measurement? 2. How many predictor TWO variables? ONE TWO (or more) ONE (or more) 3. What type of predictor CONT CAT CONT CAT BOTH CAT CONT CAT CONT BOTH variable? 4. How many levels of MORE THAN categorical predictor? TWO TWO 5. Same (S) or Different (D) participants for each S D S D S D BOTH D D predictor level? independent ANOVA Multiple regression 6. Meets assumptions t-test (independent) measures ANVOA One-way repeated measures ANOVA t-test (dependent) Factorial repeated Factorial ANOVA for parametric tests? Factorial mixed Correlation or Independent Regression YES ANCOVA One-way Pearson ANOVA Logistic Regression Logistic Regression Logistic Regression Log-linear analysis Chi-Squared test Mann-Whitney Kruskal-Wallis Spearman Friedman Willcoxon NO Decision tree - our learning framework 1. What sort of CONTINUOUS (CONT) CATEGORICAL (CAT) measurement? 2. How many predictor TWO variables? ONE TWO (or more) ONE (or more) 3. What type of predictor CONT CAT CONT CAT BOTH CAT CONT CAT CONT BOTH variable? 4. How many levels of MORE THAN categorical predictor? TWO TWO 5. Same (S) or Different (D) participants for each S D S D S D BOTH D D predictor level? independent ANOVA Multiple regression 6. Meets assumptions t-test (independent) measures ANVOA One-way repeated measures ANOVA t-test (dependent) Factorial repeated Factorial ANOVA for parametric tests? Factorial mixed Correlation or Independent Regression YES ANCOVA One-way Pearson ANOVA Logistic Regression Logistic Regression Logistic Regression Log-linear analysis Chi-Squared test Mann-Whitney Kruskal-Wallis Spearman Friedman Willcoxon NO Factorial designs: Two or more within-subjects predictors Just like independent measure designs there can be more than one categorical predictor. When all participants take part in all combinations of those predictors, we have a repeated measures factorial design and can use an ANOVA to test for significant main effects and interactions A two-way design Here we have a table of data with nine data columns corresponding to three levels of two variables - that is, a 3 by 3 design. The variables are the type of drink (Beer - Wine - Water) and the type of imagery used in the advertisement (positive - negative - neutral) The outcome is how much the participant likes the beverage on a scale from -100 (dislike very much) to 100 (like very much) A two-way design Setting up the analysis now means that we have to specify two factors Both factors have three levels A two-way design Defining the factor combinations has to be done correctly Labeling the columns for each variable with the combination of variable levels can help E.g. Beer + dead bodys specifies the first level of the variable drink and the second level of the variable imagery When SPSS asks for the data for the first level of drink and second level of imagery, denoted and (1,2), we know which column of data to select. Output: two-way design As with one-way ANOVAS, contrasts can be set up as too can post hoc tests The main ANOVA table however is where we can start Here the five columns we are familiar with are shown, but now for the two main effects and the interaction Mixed factorial designs One way to think about this is having a repeated measures design applied more than once to different groups of individuals. All participants take part in all conditions, but participants can be divided by some other variable, either manipulated by the experimenter or that is a feature of the participants, e.g. male or female Decision tree - our learning framework 1. What sort of CONTINUOUS (CONT) CATEGORICAL (CAT) measurement? 2. How many predictor TWO variables? ONE TWO (or more) ONE (or more) 3. What type of predictor CONT CAT CONT CAT BOTH CAT CONT CAT CONT BOTH variable? 4. How many levels of MORE THAN categorical predictor? TWO TWO 5. Same (S) or Different (D) participants for each S D S D S D BOTH D D predictor level? independent ANOVA Multiple regression 6. Meets assumptions t-test (independent) measures ANVOA One-way repeated measures ANOVA t-test (dependent) Factorial repeated Factorial ANOVA for parametric tests? Factorial mixed Correlation or Independent Regression YES ANCOVA One-way Pearson ANOVA Logistic Regression Logistic Regression Logistic Regression Log-linear analysis Chi-Squared test Mann-Whitney Kruskal-Wallis Spearman Friedman Willcoxon NO A two-way design Here we have a table of data with nine data columns corresponding to three levels of two variables - that is, a 3 by 3 design. The variables are the type of drink (Beer - Wine - Water) and the type of imagery used in the advertisement (positive - negative - neutral) The outcome is how much the participant likes the beverage on a scale from -100 (dislike very much) to 100 (like very much) But we also have males and females The repeated measures analysis has the option to add a between-subjects factor If we had an appropriate male/female coding variable, we could select it to go into the Between-subjects Factors box Once that’s done, the same general approach can be followed to examine main effects and interactions NOTE: it will now be equally important to examine Between-Subjects and Within- Subjects tables for the effects Factorial Designs Independent factorial design: There are several independent variables or predictors and each has been measured using different entities (between groups). We discuss this design today [see Field Chapter 14]. Repeated-measures (related) factorial design: Several independent variables or predictors have been measured, but the same entities (participants) have been used in all conditions [see Field Chapter 15]. Mixed design: Several independent variables or predictors have been measured; some have been measured with different entities, whereas others used the same entities [see Field Chapter 16]. Next week Non-parametric tests Decision tree - our learning framework 1. What sort of CONTINUOUS (CONT) CATEGORICAL (CAT) measurement? 2. How many predictor TWO variables? ONE TWO (or more) ONE (or more) 3. What type of predictor CONT CAT CONT CAT BOTH CAT CONT CAT CONT BOTH variable? 4. How many levels of MORE THAN categorical predictor? TWO TWO 5. Same (S) or Different (D) participants for each S D S D S D BOTH D D predictor level? independent ANOVA Multiple regression 6. Meets assumptions t-test (independent) measures ANVOA One-way repeated measures ANOVA t-test (dependent) Factorial repeated Factorial ANOVA for parametric tests? Factorial mixed Correlation or Independent Regression YES ANCOVA One-way Pearson ANOVA Logistic Regression Logistic Regression Logistic Regression Log-linear analysis Chi-Squared test Mann-Whitney Kruskal-Wallis Spearman Friedman Willcoxon NO