Missing data after cleaning NA on ezAnova

Hi, i'm trying to do a ezAnova on my data, but it's not supporting NA data. So i try to use multiple way to clean NA value but ezAnova still saying me that they are missing value..

#I see where the NA are in COMPLETOKOK
#I try to delete NA value
vraimentcomplet<-COMPLETOKOK[complete.cases(COMPLETOKOK), ]
#No NA value anymore
#Not working...
anova<-ezANOVA(data= vraimentcomplet ,dv=value, wid=Sujet , within = .(Tache, variable), type=3, return_aov=T)

#I also try
vraimentcomplet<-COMPLETOKOK %>%
filter_all(~ !is.na(.))

And it's still not working...

Data are here:

Can some one explain me why I can run my ezAnova, or give me an other way to clean NA please?

vraimentcomplet %>% drop_na() -> newfile

Thank you @Chuck, but it not working.
when i do

data = vraimentcomplet
, x = .(variable)
, y = .(Sujet)
, col = .(Tache)
data = vraimentcomplet[!is.na(vraimentcomplet$value),]
, x = .(variable)
, y = .(Sujet)
, col = .(Tache)
I still see some missing value that not allow me to run the ezanova..

Try this before doing the anova.

vraimentcomplet %>% drop_na() -> vraimentcomplet

Warning: Converting "Sujet" to factor for ANOVA.
Warning: Converting "Tache" to factor for ANOVA.
Warning: Converting "variable" to factor for ANOVA.
Error in ezANOVA_main(data = data, dv = dv, wid = wid, within = within, :
One or more cells is missing data. Try using ezDesign() to check your data.

I still get error message...

With the caveat that I haven't ever run a model with ezANOVA(), but I think this error message has to do with your factors not being crossed and doesn't have anything to do with missing values in your response variable.

Crossed factors means that every level of one of your factors is present with every level of the other in your dataset. From skimming through your dataset, I don't think your two within factors are crossed. So when ezANOVA() tries to fit an interaction with those variables it can't/won't do so.

You can check which combinations of the two factors that aren't present in your dataset (i.e., check which cells is missing data) using, e.g., table().

Here's an example of checking if the two factors are crossed using the mtcars dataset. If cyl and gear were crossed then all combinations of these would have at least one observation. You can see that there are no 4 gear cars with 8 cylinders; these factors aren't crossed.

with(mtcars, table(cyl, gear) )
cyl  3  4  5
  4  1  8  2
  6  2  4  1
  8 12  0  2
1 Like

Ok i try, and i get this

So all factor should be crossed.. But I have different value so you think it's the reason of the error?

Hmm, this table doesn't look like it comes from the same dataset you linked to in COMPLETEOKOK.

In the linked dataset the variable column values have names that start with word_read and send_read, etc. and so LECTM and LECTPH are associated with different variable groups. You must have edited this at some point?

Can you give a small example of the dataset you are using for the analysis? It can help folks help you if you paste in a small reproducible example into your question rather than linking to a large dataset that has to be read in remotely.

If you've never made a reproducible example before (i.e., reprex), you can get some ideas here:

My last thought is that if ezANOVA() fits a repeated measures ANOVA and not a mixed model you can have problems with unbalanced designs. I don't know if this is related to the error message or not, but you can read more about instances where repeated measures ANOVA doesn't work well here.

1 Like

Oh yes sure sorry (it was the wrong data set... my bad) i give you the data where i work in this link:

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