0

I have some issues trying to conduct an Anova for a repeated survey.

This is my data basis: 40 participants from 3 school classes and I wanted to know how motivated the pupils were for learning a certain subject at two different points of time.

Now I wanted to conduct an ANOVA in order to find out whether there are significant differences in the motivation of these three groups (i.e. classes). However, I cannot seem to figure it out.

I've tried the following:

> anova.rm <- ezANOVA(daten.long, dv=.(motivation),
+ wid=.(id), within=.(time) )

Warnung: "time" will be treated as numeric. 
Warnung: There is at least one numeric within variable, therefore aov() will be used for computation and no assumption checks will be obtained.
> anova.rm
$ANOVA
     Effect DFn DFd        F         p p<.05       ges
1 time   1   2 3.887892 0.1873993       0.6603199

--> In this one-factored analysis the motivation is already related to the class, but it doesn't give me any information whether there are any differences between the groups if I do a post hoc-test (such as Fishers Least Significance Difference or the pairwise.t.test)

Therefore, I've tried to use the multifactorial variance analysis:

> anova.mixed <- ezANOVA(daten.long, dv=.(motivation), wid=.(id), within=.(time), between=.(class))

Warnung: "time" will be treated as numeric.
Warnung: "class" will be treated as numeric.
Warnung: There is at least one numeric within variable, therefore aov() will be used for computation and no assumption checks will be obtained.
> anova.mixed

$ANOVA
            Effect DFn DFd           F         p p<.05        ges

1           class   1   1  0.05304433 0.8558908       0.04881692

2           time    1   1 16.05556143 0.1556988       0.34263494

3      class:time   1   1  7.25926249 0.2262510       0.19071808

Same problem for this try. I have no idea whether I'm on the right track to get to the point if there are any significant differences between my groups at the two points of time.

I'm thankful for your help and advice! :)

Tim
  • 4,790
  • 4
  • 33
  • 41
  • `exANOVA()` is not a function in base R, be sure to list all packages that you are using. Also be sure to include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data so we can run the code ourselves to see what's going on. – MrFlick Dec 12 '16 at 21:25
  • Thanks for your quick reply. I've used the package "tidyr" to transform my data from wide to long and "ez" for the Anova. This is my data basis (the motivation is already referred to the classes and the mean). id motivation.1 motivation.2 class a 7.2 7.2 1 b 4.857143 6.5 2 c 6.666667 8.666667 3 (This is a table but I cannot seem to get the format right here... sorry!) Does is nevertheless work as a basis? – user7287270 Dec 12 '16 at 21:41
  • It looks like both your `class` and `time` variables are treated as continuous. That is probably not what you want. If you have, for example, Class A, B, C, and they are coded as 1, 2, 3 (a numeric variable), you will have 1 degree of freedom in the ANOVA when you really want 2 degrees of freedom (3 classes minus 1). To fix this, do this: `daten.long$class <- factor(daten.long$class)`. Also check this for your `time` variable. – David Dec 13 '16 at 00:40
  • Thank you so much, @David! With these two additional commands factorising class and time, I've managed to run it :) – user7287270 Dec 13 '16 at 18:33

0 Answers0