broom.mixed
broom.mixed copied to clipboard
refactor lme4/nlme/glmmTMB/(glmmADMB?) tidiers
I've gradually been refactoring the lme4 tidiers, moving away from the broom::fix*()
functions - instead, make sure columns are renamed appropriately on the fly, and use tibble::rownames_to_column()
as appropriate. Need to make sure that code is re-used appropriately and that behaviour is a similar as possible across these cases.
Should there be a set of default parameters in the tidy/augment/glance that are built-in into all supported models? This would allow for a common api, with changes only to the arguments of the broom.mixed functions.
can you be more specific? give an example?
I'm thinking something along the lines of every tidy function should at least have the following parameters:
- ran_prefix (or else)
- conf.int (or a more general intervals)
- conf.level (or prob)
- conf.method ( or simply interval_method)
- maybe others
Or should each model have an independently maintained set of functions that don't necessarily have to the same parameters. (Like brms with "intervals", since credible intervals != confidence intervals).
I'm thinking of a more unified api among mixed models tidiers.
good points.
- I've wanted to change
conf.int
for a while, at least toconf_int
(since that's more tidyverse-like); it does make sense to change it tointervals
, for reasons you suggest above (although IMO it would be not too horrible to keepconf[_.]int
and note that it has a different meaning. I'd really like to change the names of the returned columns,conf.low
andconf.high
, tolower
/upper
orlwr
/upr
(these are shorter, and each pair has the same length; I've sometimes usedconf.lo
andconf.hi
, but I preferlower
/upper
- that would also take care of the credible vs confidence issue). However, I haven't wanted to do any of this for fear or breaking (back-)compatibility withbroom
. - similarly, I'd like to make sure that the argument that specifies whether to back-transform results (e.g. to go from log-odds to odds ratios) is
transform
rather thanexponentiate
(as intidy.lm
)
So the questions are:
- how much do we want to break
broom
-compatibility in pursuit of consistency withinbroom.mixed
(and/or other criteria such as keeping snake case)? - where should these rules be documented? (
API.md
) ? Does such a document exist already forbroom
?
@dgrtwo ? Opinions?
I think that since we are splitting up parts of broom
, this is our chance to get naming conventions straight and general enough. We won't get it again in a similar way. So my preference would be to break all broom-compatibility we need to break in order to have consistent conventions that "feel right" going forward.
With regard to the specific names, I prefer using intervals
, lower/upper
and transform
.
Agreed, but probably better singular (interval
)