Warning: You have removed one or more levels from variable " ". Refactoring for ANOVA.

380 views
Skip to first unread message

Mgt

unread,
Mar 9, 2012, 9:06:13 AM3/9/12
to ez4r
Hello everyone,

I got this warning message several times when using ezANOVA, but I
can't figure out what is wrong with my data. It does not seem to
affect the calculations (I first got it doing one Andy Field's guided
tutorials found online, so I could compare the results), but I think I
might as well be sure about it before I apply ezANOVA to my results.

From the code on this page http://egret.psychol.cam.ac.uk/statistics/R/extensions/hack_ezANOVA.R
it seems like it has something to do with the number of distinct
factors compared to their levels, but my knowledge of R code is too
shallow to fully grasp it. Does the data have to be sorted a certain
way to avoid this warning?

My data is presented this way at the moment:

Subject DV Factor1 Factor2

S1 .. 1 A
S2 .. 1 B
...
Si .. 0 A
...

I have two levels for Factor1 (between-subjects) and 5 levels for
Factor2 (within-subjects factor).

Could somebody please give me a hint on how not to get this message?

Thanks a lot,

Margot

Mike Lawrence

unread,
Mar 9, 2012, 9:31:53 AM3/9/12
to ez...@googlegroups.com
Are you saying you encounter this warning when using ez 3.0? The code
you link applies to ez 2.1.

The warning usually occurs when you have read in your data, which
automatically factorizes some columns, then you removed some rows in
your data corresponding to all the observations for at least one level
of one of your factorized variables. ez is simply warning you that the
data it is analyzing is missing data given the number of levels the
original factorization created. To eliminate the message, simply
refactor your variables, as in:

myData$var = factor(myData$var)

Mgt

unread,
Mar 9, 2012, 9:52:59 AM3/9/12
to ez4r
Hello Mike,

Thanks for your super quick answer !

I installed the ezpackage about 3 weeks ago, so I guess it is the
newest one I have. The link I found was the only return I got from
Google for this warning message, so it was all I had and I figured the
"actual" code would not be too different from it.

I actually deleted some of the levels of my factor, but as I included
it in a new data frame, I did not know it kept "memory" of it origins.

Thanks again, and sorry to have bothered you with a question that
simple,

Margot


On Mar 9, 3:31 pm, Mike Lawrence <Mike.Lawre...@dal.ca> wrote:
> Are you saying you encounter this warning when using ez 3.0? The code
> you link applies to ez 2.1.
>
> The warning usually occurs when you have read in your data, which
> automatically factorizes some columns, then you removed some rows in
> your data corresponding to all the observations for at least one level
> of one of your factorized variables. ez is simply warning you that the
> data it is analyzing is missing data given the number of levels the
> original factorization created. To eliminate the message, simply
> refactor your variables, as in:
>
> myData$var = factor(myData$var)
>
>
>
>
>
>
>
> On Fri, Mar 9, 2012 at 10:06 AM, Mgt <mgt.paster...@gmail.com> wrote:
> > Hello everyone,
>
> > I got this warning message several times when using ezANOVA, but I
> > can't figure out what is wrong with my data. It does not seem to
> > affect the calculations (I first got it doing one Andy Field's guided
> > tutorials found online, so I could compare the results), but I think I
> > might as well be sure about it before I apply ezANOVA to my results.
>
> > From the code on this pagehttp://egret.psychol.cam.ac.uk/statistics/R/extensions/hack_ezANOVA.R
Reply all
Reply to author
Forward
0 new messages