Closed banfai closed 2 months ago
Please look at the NEWS file. There is an option you can set to get the old behavior.
Please look at the NEWS file. There is an option you can set to get tge old behavior.
Thanks for the quick reply. Yes, I've seen that, but I still find it odd that there is now a discrepancy whether data
is used or not. I have proposed a solution (based on the comment on Stackoverflow) that would satisfy the requirements in #500 and would still be consistent regardless of using data
or recover_data()
.
As far as I understand, the aim of #500 was not to have contrasts for non-existent levels, and the current behaviour is only an adverse effect of that fix.
Hello Russel,
I've found this inconsistency described below. I'm still looking into it and I haven't managed to come up with a solution yet, but I wanted to let you know.
Describe the bug
Since the changes in #500 contrasts are generated differently for a dataset with missing levels whether
data
argument is used inemmeans
or not. I suppose without thedata
argumentrecover_data()
is generating the actually appearing levels, but withdata
the non-existent level is appearing among the contrasts (levelc
in the example below).To reproduce
Created on 2024-09-26 with reprex v2.1.1
Expected behavior
I would expect the previous behaviour (i.e. no
c
contrasts regardless of usingdata
or not).Additional context
I would suggest having a test for such case (something along the lines of the example).