
The stargazer package
For an example of a package which can just make life easier, first let’s consider the output produced by running a summary function on the regression results, as we did previously. You can run it again if you wish.
summary(lm_output)
The amount of statistical information output by the summary() function can be overwhelming to the initiated. This is not only related to the amount of output, but the formatting. That is why I did not show the entire output in the previous example.
One way to make output easier to look at is to first reduce the amount of output that is presented, and then reformat it so it is easier on the eyes.
To accomplish this, we can utilize a package called stargazer, which will reformat the large volume of output produced by summary() function and simplify the presentations. Stargazer excels at reformatting the output of many regression models, and displaying the results as HTML, PDF, Latex, or as simple formatted text. By default, it will show you the most important statistical output for various models, and you can always specify the types of statistical output that you want to see.
To obtain more information on the stargazer package you can first go to CRAN, and search for documentation about stargazer package, and/or you can use the R help system:
IF you already have installed stargazer you can use the following command:
packageDescription("stargazer")
If you haven’t installed the package, information about stargazer, (or other packages) can also be found using R specific internet searches:
RSiteSearch("stargazer")
If you like searching for documentation within R, you can obtain more information about the R help system at: