hughjonesd / huxtable

An R package to create styled tables in multiple output formats, with a friendly, modern interface.
http://hughjonesd.github.io/huxtable
Other
321 stars 28 forks source link

Support for quantreg #61

Closed mattmoo closed 6 years ago

mattmoo commented 6 years ago

Great package! Is there any chance that support for quantreg is on the horizon?

hughjonesd commented 6 years ago

Talk to the 'broom' guys. -- Sent from Gmail Mobile

hughjonesd commented 6 years ago

Actually afaics broom already has quantreg support. So, maybe you mean something else?

hughjonesd commented 6 years ago

WFM:

library(quantreg)
library(huxtable)
tmp <- rq(Petal.Width ~ Sepal.Length, data = iris)
huxreg(tmp, error_format = '{conf.low} / {conf.high}')
## ─────────────────────────────────────────────────
##                                    (1)           
##                         ─────────────────────────
##   (Intercept)                            -3.480  
##                                 -4.291 / -2.837  
##   Sepal.Length                            0.800  
##                                  0.656 / 0.970  
##                        ─────────────────────────
##   N                                     150      
##   logLik                                -99.889  
##   AIC                                   203.777  
## ─────────────────────────────────────────────────
##   *** p < 0.001; ** p < 0.01; * p < 0.05.        

## Column names: names, model1
mattmoo commented 6 years ago

Thanks Hugh. That looks like almost what I want., but with no statistical testing.

It seems like in quantreg the stats are passed off to boot.rq (usually generated using summary(tmp, se="boot"))

I haven't been able to get tidy to generate p-values, although maybe that's broom's issue, as you say.

hughjonesd commented 6 years ago

If summary generates P values then you could try writing a tidy method for summary.quantreg. I think broom is in an awkward place where it can only offer very minimal consistency guarantees. Perhaps that is the inevitable consequence of it being a facade over many different projects. -- Sent from Gmail Mobile