top of page

One-Way Analysis of Variance


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)



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)



bottom of page