# Part 2: Analysis of Variance

This section deals mainly with inferential statistic concerning the mean of a distribution. Does the new training program work better than the one currently in use? Are boys really better than girls at mathematics? Although neither question ends with 'on average,' that is what the statistical tests will tell us.

### The *t*-test

This module describes tests of population means when there are one or two groups. The *t*-test is used when we want to test means and we admit ignorance of both the population mean and population variance. The module covers the single-sample *t*, the independent samples *t*, the dependent *t*, the notion of *effect size*, and estimating power of the *t*-test.

There are PowerPoint slides and R code for this module. Also there are voiceover slideshows - one for the varieties of t-test, and the second for effect sizes and power.

### Null Hypothesis Statistical Tests (NHST)

There is a controversy about null hypothesis significance testing in psychology. Is what we do by convention a bad idea? My reading of the literature suggests that NHST is not bad in and of itself, but it is often misunderstood and misapplied, leading to faulty inferences. In this module, we cover some of the common misunderstandings and attempt to rectify them.

PowerPoint slides.

### One-way ANOVA

This is an introduction to one-way ANOVA, analysis of variance with one independent variable. We cover the model or equation that we let stand for the data, some assumptions of the model needed to make the probability calculations work out, and example application using computational formulas. We show the typical F table and ANOVA summary table that you may want to present in your research write-up. Finally, we show how to use SAS to compute power for one-way ANOVA designs. You don't need to know much of anything to use SAS for power calculation, so I still teach it, even though the rest of the course uses R.

PowerPoint file for one-way ANOVA. R code for running one-way ANOVA on the caffeine data.

### Comparing Cell Means: Planned comparisons and post hoc tests

Here you will find planned comparisons (contrasts) among cell means and the Tukey post hoc test. Typically such comparisons take place in experimental designs where differences among particular cells (or combinations of them) are of interest or where all possible comparisons among cells are desired.

Powerpoint slides. R code for planned comparisons, and R code for the Tukey Honestly Significant Difference post hoc test.

### Factorial ANOVA

Factorial ANOVA is analysis of variance with more than one independent variable, or factor. In this module, we cover the analysis of independent groups designs (totally *between* designs in which each participant sees only one cell or treatment combination). We briefly discuss problems of missing data and model specification.

PowerPoint slides. Analysis of a two-factor experiment using R. Series of voiceover slideshows for factorial ANOVA: one, two, three, four and five.

### Random-effects and Repeated Measures ANOVA

In psychology, most experiments consider the independent variables to contain all the levels of interest to the experiments (i.e., the variable is considered *fixed*). Sometimes, however, the levels of the independent variable are sampled from a larger population, in which case, the independent variable is considered *random*. For example, if **psychotherapist** is included in a model, it is likely that the therapists in the study are only a sample of those of interest. In such a case, the variable would be considered random. On the other hand, if the researcher is interested in which of two **therapies** is more effective, and those therapies are the only ones of interest, then the variable would be considered fixed. *Repeated measures* designs are more common in psychology. In such designs, the participant provides data for every level of one or more factors. If the design is factorial and the participant provides data for every cell, the design is said to be *within*. If the participant provides data for all levels of only some, but not all, of the factors, then the design is said to be *mixed*. In this module we cover both within and mixed designs.

PowerPoint slides. R code for single factor repeated measures (drugs on reaction time). R code for a mixed design, two factors with one repeated (dial shape and calibration effects on errors in the choice of stove-top controls).