Open TheDom42 opened 1 month ago
Hi Dominik,
Thanks for reaching out and pointing me to the origin of the problem. It seems to me this is something that should ideally be addressed in broom, but we could implement a hot fix in papaja until this happens? Would you be willing to give a PR a shot? And could you open an issue on the broom repository about this to see whether a fix on their end is in the cards?
If not, we can take care of this, but it will almost certainly take longer. ;)
Cheers, Frederik
The earliest I would have time to try a PR would be October.
However, before trying the fix, I was also thinking about something else:
With this code, the label for the estimate column is decided. It defaults to $M$. Currently, I find it quite hard to imagine a good logic to decide, which label to use for a "generic" response column. This could lead to misinterpretations if the response/DV is not actually expressed as a mean.
I agree that there are cases in which M
is not ideal. We could think about a more generic default, such as \hat{y}
. It is always possible to overwrite anything we output here:
apa_print(emm.glmm, est_name = "\\hat{y}")
Describe the bug
emmeans
objects for certain models with a differenttype
than the default fail inapa_print
. Examples that I have identified aretype = unlink
andtype = response
(https://cran.r-project.org/web/packages/emmeans/vignettes/transformations.html#tranlink) for Gamma models. There are probably more.To Reproduce
Created on 2024-09-17 with reprex v2.1.1
Expected behavior
apa_results
should have been returned with the column ofresponse
as the estimate.Additional context This links back to https://github.com/crsh/papaja/blob/c045234d41098721189c04bb7489e6d141c01c75/R/apa_print_emm_lsm.R#L131-L136 and in turn the non-standard naming in
broom
due to the different link type.Because the
tidy_x$estimate
cannot be found, this fails.