Exporting R output into Latex - Stargazer for non suported objects -
i'm estimating models in r using frontier
package , need export results latex. output quite similar lm
regression [see below] frontier
objects not supported stargazer
export them latex
code. there way work around this? idea? *i looking texreg
, apsrtable
, far unsuccessfully.
example of frontier
regression output:
i don't know getting stargazer
output unsupported models, can use atidy
method broom package basic output format compatible xtable
, knitr::kable
, or pixiedust
library(broom) library(frontier) # example included in frontier 4.1 (cross-section data) data( front41data ) # cobb-douglas production frontier cobbdouglas <- sfa( log( output ) ~ log( capital ) + log( labour ), data = front41data ) tidy(cobbdouglas, conf.int = true) broom:::tidy.lm(cobbdouglas) term estimate std.error statistic p.value 1 (intercept) 0.5616193 0.20261685 2.771829 5.574228e-03 2 log(capital) 0.2811022 0.04764337 5.900132 3.632107e-09 3 log(labour) 0.5364798 0.04525156 11.855499 2.015196e-32 4 sigmasq 0.2170003 0.06390907 3.395454 6.851493e-04 5 gamma 0.7972069 0.13642438 5.843581 5.109042e-09
for summary statistics, need write own glance
method, frontier
objects aren't compatible broom:::glance.lm
.
but think end story that, if want mimic stargazer output, you'll have preprocessing work.
and since i'm feeling ambitious today, here's tidy
method frontier objects.
tidy.frontier <- function(x, conf.int = false, conf.level = .95, exponentiate = false, quick = false, ...) { broom:::tidy.lm(x, conf.int = conf.int, conf.level = conf.level, exponentiate = exponentiate, quick = quick, ...) } # example included in frontier 4.1 (cross-section data) data( front41data ) # cobb-douglas production frontier cobbdouglas <- sfa( log( output ) ~ log( capital ) + log( labour ), data = front41data ) tidy(cobbdouglas, conf.int = true)
Comments
Post a Comment