ezANOVA error with multiple within-subject factors

142 views
Skip to first unread message

sms.ne...@gmail.com

unread,
May 10, 2018, 8:44:39 PM5/10/18
to ez4r
I am trying to use ezANOVA with Anteriority, Laterality, and bin as within-subject factors, and group as the between-group factor:

bw = ezANOVA(data=subbins, dv = .(erp), wid = .(Subject), within = .(Anteriority, Laterality, bin), between = .(Group))

But when I run it I get this error: 

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 have used ezDesign to check my data and haven't found any missing data. Also, when I only use two within subject factors of any combination (Anteriority and Laterality; Anteriority and bin; Laterality and bin) I do not get the error and the ANOVA runs fine. 

Here is information on my data: 

 str(subbins)
'data.frame': 174 obs. of  6 variables:
 $ erp        : num  -5.27 -1.37 -2.42 -1.73 -2.87 ...
 $ bin        : Factor w/ 2 levels "3","7": 1 1 1 2 2 2 1 1 1 2 ...
 $ Anteriority: Factor w/ 2 levels "Anterior","Posterior": 1 1 2 1 2 2 1 1 2 1 ...
 $ Laterality : Factor w/ 3 levels "Central","Left", "Right": 2 3 1 1 2 3 2 3 1 1 ...
 $ Subject    : Factor w/ 29 levels "AMC126","AMC131",..: 21 21 21 21 21 21 22 22 22 22 ...
 $ Group      : Factor w/ 2 levels "AMC","LHD": 2 2 2 2 2 2 2 2 2 2 ...

head(subbins)
      erp bin Anteriority Laterality Subject Group
13 -5.271   3    Anterior       Left  LHD009   LHD
15 -1.373   3    Anterior      Right  LHD009   LHD
17 -2.417   3   Posterior    Central  LHD009   LHD
38 -1.734   7    Anterior    Central  LHD009   LHD
40 -2.870   7   Posterior       Left  LHD009   LHD
42 -4.718   7   Posterior      Right  LHD009   LHD

I've also attached my complete dataset (full.csv) and the subset of the data that I am currently working with (subset.csv). 


Does anyone have any idea why this won't work when I include all three within subject factors?

full.csv
subset.csv

Mike Lawrence

unread,
May 10, 2018, 8:50:13 PM5/10/18
to ez...@googlegroups.com
If you run:

    subbins = readr::read_csv('subset.csv')
    library(ez)
    ezDesign(
        data = subbins
        , x = Anteriority
        , y = Laterality
        , col = bin
    )

You get:





Showing that you don't have data for all combinations of the 3 variables, which is necessary for a witihin-Ss anova.



--
Mike Lawrence
Graduate Student
Department of Psychology & Neuroscience
Dalhousie University

~ Certainty is (possibly) folly ~

--
You received this message because you are subscribed to the Google Groups "ez4r" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ez4r+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sms.ne...@gmail.com

unread,
May 10, 2018, 10:34:52 PM5/10/18
to ez4r
Thank you for your quick reply! I'm not sure how I missed that but I fixed the way I subset the data and it is working now. Very much appreciated!
Reply all
Reply to author
Forward
0 new messages