top of page

#### One-Way Analysis of Variance

KEY:

ds = dataset you are currently using.

â€‹

DV = dependent variable of interest

â€‹

IV = independent variable of interest

Subject = name of subject number column

â€‹

XYXY = dummy name for a variable, matrix, or data frame into which you are moving information.

## One-way ANOVA: Between-subjects data

_____________________________

XYXY<-aov(DV ~ IV, data=ds)

summary(XYXY)

_____________________________

## One-way ANOVA: Within-subjects data

The difference from between-subjects is inclusion of Subject as an error component. This controls for the fact that the same people are being used in both conditions. This is why Subject needs to be factored (see above).

_____________________________

XYXY <-aov(DV ~ IV + Error(Subject / (IV)), data = ds)

summary(XYXY)

_____________________________

bottom of page