texreg
texreg copied to clipboard
Reorder coefficients by regex
Allow coefficients to be re-ordered by a vector of regex:
Eg:
reorder.coef = c("^log", "^GDP", "^Population")
would put all coefficients that start with "log" on top, then "GDP" and then "Population" coefficients.
Motivation: I routinely have model with some fixed effects and interactions, then I would have to calculate the number of created dummy variables and based on these I could reorder them.
I would like to see this as well :)
I'd be open to a pull request if anyone wants to give it a try. The relevant code fragments are the reorder function, potentially the lines in the texreg, screenreg etc functions that call the reorder function, and two places in the plotreg function, which handles reordering in a different way, I think.
Yes, plotreg has its own way of reordering. I confirm that.