Feature Request: Add runrecord-like functionality
billdenney opened this issue · 5 comments
When reporting, I use xpose
as my default reporting package. With that, I would like to simplify the way that I generate records of my runs.
Specifically, I would like to generate a table (aka data.frame) with indicators for the model characteristics (like OFV), description, and nesting. With some relatively straight-forward heuristics, all of this could be automated including the nesting. That said, xpose currently focuses on results at the single-model level not at the level of a group of models.
That also, said, compatibility with broom (as requested in #158), could take us 95% of the way there. Running glance()
on a list of models then rbind()
ing the results is a table of model summaries.
There are also packages that will produce report ready tables baesd on broom
@mattfidler, what are some of those packages? And, will they do things like model nesting calculations? (I'm wanting change in AIC or OFV.)
Unfortunately nesting calculations are not implemented yet.
The report-based tables are currently in
- huxtable (https://hughjonesd.github.io/huxtable/)
- texreg (https://github.com/leifeld/texreg/)
However, they are more geared to stats reports, and don't exactly list what I find useful for a pharmacometrics report. The nlmixr output that I have more closely resembles what I find useful, but it isn't generated from broom entirely.
For me one catch of broom is the back transformation of the parameters on a log vs non-log space.
Thanks for the pointers. I'd looked at huxtable before, but I'd not seen texreg.
I wrote some nesting code yesterday that's not quite ready for prime time. (It works, but I've not checked it for robustness to other situations than what I was working on yesterday.) What I wrote can take a list of xpose objects when they have the parentage defined and automatically nest them with indentation, and it will automatically generate a description of changes from the parent model indicating what parameters were added for estimation or as fixed, removed from estimation or as fixed, fixed, unfixed, or had a changed fixed value.
I'd like for it to automatically determine parentage even when it's not provided, but that is somewhere between hard and impossible. My thoughts there are that a distance matrix could be generated indicating how far the models are from each other on parameters that are included, and then given an initial model do serial connection to the closest model(s) making a directed acyclic graph. The distance for "how far" could be determined by some metric of the parameters added/removed/fixed/unfixed. But, all of this paragraph assumes that parameter descriptions define the model, and subtleties will always creep in.
I this seems pretty nice.
I also think it would be nice to use broom models to create a so called anova
analysis. The first would be the parent and then you could nest them. It could lead to generic sorts for automatic covariate searching.
The distance matrix seems a nice idea, but as you said the subtleties make it error prone.