0

In a regression analysis R "rates" each independent variable with its level of significance (i.e. with stars **), e.g.:

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   7.0869     0.6504  10.897  < 2e-16 *
X1          -2.1953     0.3160  -6.948 8.89e-12 ***
X2           0.2586     0.0778   3.324 0.000936 **
X3          -0.3415     0.1003  -3.406 0.000700 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

But when you convert into Latex with xtable, the new table looks nice, but doesn't have the column with stars. How can I make xtable to include a column with the stars? Or else, how can I make that each row is colored to reflect the level of significance? Thanks!

IRTFM
  • 258,963
  • 21
  • 364
  • 487
Oliver Amundsen
  • 1,491
  • 2
  • 21
  • 40
  • 1
    Have you looked at the package [stargazer](http://cran.r-project.org/web/packages/stargazer/index.html)? It allows to produce latex tables of regression results with significance stars. – ytsaig Dec 19 '13 at 19:47
  • 1
    If you want to stick with **xtable** I would look at this [question](http://stackoverflow.com/questions/11777586/customize-xtable?rq=1) about customizing xtable. It can be done, but I think the easiest thing would be to write a function that takes the coefficient table out of the model object and adds the appropriate stars. Then use xtable to print it. – Christopher Louden Dec 19 '13 at 21:48

0 Answers0