warnings in anova

Hey guys I'm trying to conduct an anova with:

"group" as factor (1,2,3)
and "SI_ZI" (difference scores for Symptom intensity)
note: scores can be negative

the code:
anova_1 <- aov(df$group~df$SI_Z1)

the warnings (I'm sorry its in German but the words are equal to the englisch ones):

Warnmeldungen:
1: In model.response(mf, "numeric") :
Benutzung von type="numeric" wird für eine faktorielle Zielgröße ignoriert
2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors

However I tried to summarize the anova

summary(anova_1)
Fehler in levels(x) :
nur Nullen dürfen mit negativen Indizes gemischt werden

Does anybody understand what is wrong?

Thanks you in advance,
Laura

First thing to note would be that when you're using a data frame for a function such as aov(), you can pass the data frame as the data= argument, and just use the variable names.

Secondly, can you check that you are using the correct variable names as in your description, you say "SI_ZI", but in your code example, you use SI_Z1.

Finally, and this might be the real problem, I think your variable are the wrong way round in your formula for aov(). The numeric should be first and the factor should be second.

Try:

anova_1 <- aov(SI_ZI ~ group, data=df)
1 Like

You are right! Thanks so much!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.