Argument order in aov_ez #2

Open
dgromer opened this Issue Sep 20, 2015 · 3 comments

Comments

Projects
None yet
2 participants

dgromer commented Sep 20, 2015

Is there a specific reason why id is the first argument in aov_ez, and data is the third?

It would make more sense to me if data was the first argument, because then it would fit nicely into pipelines like

data %>%
  dplyr::filter(some_filtering_here) %>%
  aov_ez("id", "dv", further_arguments_here)

instead of now

data %>%
  dplyr::filter(some_filtering_here) %>%
  aov_ez("id", "dv", ., further_arguments_here)
Owner

singmann commented Sep 20, 2015

I think the reason for having both id and dv before data was to clearly separate those required arguments from the two more or less optional arguments between and within. But I see that even without dplyr it could make sense to have data as first argument, e.g., when using lapply. On the other hand, this design would easily allow to run ANOVAs on many subsets of the data which should in principle only exacerbate the existing problem of Type I error accumulation (which exists for any multifactor ANOVA).

I also have just recently made some rather strong changes to the interface so I am not sure now is the time for the next ones, but it is any idea I will keep in mind. Perhaps only adding an alternative version with changed ordering of arguments could work for the time being, e.g., aov_ez2.

dgromer commented Sep 21, 2015

Having data as the first argument seems more intuitive to me, since then all following arguments clearly refer to this data frame. Right now, the first two arguments are somewhat out of context in my opinon.
And aov_ez would be more similar to ez::ezANOVA ;)

However, I wouldn't include the aov_ez2 wrapper, because it could make things more complicated for people starting with the package.

Owner

singmann commented Oct 8, 2015

I am somewhat inclined to make this change. The only problem is, this will really break a lot of existing code using this function, so it would be quite a big change.

I have some plans for making some rather drastic changes (e.g., harmonizing all function and argument names to use _ instead of .) for version 1.0. And if I decide to do so, I will include this change as well (I will keep it open to remind me).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment