New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistency of emmeans tidiers (with other tidiers) #692
Comments
Thanks for taking this on! Let me know how I can help! |
Sure. I've looked around a little and it seems fm1 <- aov(breaks ~ wool + tension, data = warpbreaks)
thsd <- TukeyHSD(fm1, "tension")
as.data.frame(tidy(thsd))
library("emmeans")
emmp <- pairs(emmeans(fm1, ~ tension))
as.data.frame(tidy(emmp, infer = c(T, T), level = 0.95))
library("multcomp")
glhs <- summary(glht(fm1, linfct = mcp(tension = "Tukey")))
as.data.frame(tidy(glhs))
Regarding point 2.: I like the |
Sorry to bother, @alexpghayes, but do you have any thoughts on this? I'd like to tackle this soon; some developments in my own package depend on this. |
Apologies!
I am happy with or without this argument, although I think providing it would be nice. My main concern is a consistent interface.
I don't think so. We typically do this for
I'm not sure. If there is a way to select between multiple contrasts, or in general get contrasts for multiple categories features, then yes.
Let's move over to the
Agree.
I like |
Thanks, so to summarize I'll do the following:
|
Exactly! |
* Adds tidy-method form summary_emm-objects. * Updates NEWS * Apply suggestions from code review Co-Authored-By: alex hayes <alexpghayes@gmail.com> * Makes requested changes for emmeans tidiers. (#691) - Adds joint_tests()-example - Removes strict = FALSE from tests * Roxygenizes documentation. * Improves consistency of post-hoc comparison tidies (i.e. glht, stats::TukeyHSD, and emmeans). See #692 * Fixes failing tests and roxygenizes. * Adds NEWS entry. * Fixes more failing tests. * Fix bug in emmeans and multcomp examples. * Implement revision suggested by @alexpghayes Co-Authored-By: alex hayes <alexpghayes@gmail.com> Co-authored-by: alex hayes <alexpghayes@gmail.com>
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
While working on a PR to add a new
emmeans
-tidier, I noticed that theemmeans
-tidiers have some internal and external inconsistencies:lsmobj
-method uses the common argumentsconf.int
andconf.level
as defined in theparam_confint
template. The other methods (e.g.,emmGrid
) do not provide these arguments and instead rely on the argument names native to theemmeans
summary()
-methods (e.g.,infer
andlevel
).I haven't looked exhaustively at other methods, but I additionally noticed some inconsistencies compared to other contrast tidiers, specifically
tidy.TukeyHSD()
:tidy.TukeyHSD()
reports the contrasted conditions in a column labelledcomparison
in the form ofa-b
. In contrast, theemmeans
tidiers return the same information in two columns labelledlevel1
andlevel2
(containinga
andb
).tibble
returned bytidy.TukeyHSD()
, the column containing p-values is labelledadj.p.value
. In contrast, theemmeans
tidiers label this columnp.value
regardless of whether it has been adjusted for multiple comparisons or not (see code above). Unless I missed something, the use ofadj.p.value
is currently unique totidy.TukeyHSD()
.It seems desirable to try to keep things consistent across methods where possible but particularly within the set of tidiers for a given package. I would, therefore, suggest the following changes, that I'd be willing to implement in a PR:
conf.int
andconf.level
to all emmeans tidiers.tidy.TukeyHSD()
or theemmeans
-methods. I'm not sure which of the two is preferable here.adj.p.value
inemmeans
tidiers whenever p-values are adjusted for multiple comparisons or usep.value
intidy.TukeyHSD()
. Again I'm not sure which is preferable.Any thoughts?
The text was updated successfully, but these errors were encountered: