7.5 Making regression tables

Use the stargazer() function to transform messy R regression estimates into professional and exportable regression tables. Be sure you have installed and loaded the stargazer package. Then simply specify the model estimates to include.

  library(stargazer)
  
  stargazer(
   Model1, Model2,    # stored estimates to include in the table
   type = 'text',    
   keep.stat = 'n'   # add #obs from each model
  ) 
## 
## =========================================
##                  Dependent variable:     
##              ----------------------------
##                        ProfMath          
##                   (1)            (2)     
## -----------------------------------------
## ProfLang        0.876***      0.894***   
##                 (0.039)        (0.041)   
##                                          
## NumTested                      -0.010    
##                                (0.007)   
##                                          
## Constant         0.910          2.211    
##                 (1.505)        (1.715)   
##                                          
## -----------------------------------------
## Observations      108            108     
## =========================================
## Note:         *p<0.1; **p<0.05; ***p<0.01

You can copy and paste these into a program like Excel or Word, and have a nice table with only a few edits.