Showing linear regression coefficients

I have just finished my Big Data course for 2017, and noted some concepts that I want to teach better next year. One of them is how to interpret and use the coefficient estimates from linear regression. All economists are familiar with dense tables of coefficients and standard errors, but they require experience to read, and are not at all intuitive. Here is a more intuitive and useful way to display the same information. The blue dots show the coefficient estimates, while the lines show +/- 2 standard errors on the coefficients. It’s easy to see that the first two coefficients are “statistically significant at the 5% level”, the third one is not, and so on. More important, the figure gives a clear view

Coef plot from strengejacke Bof the relative importance of different variables in determining the final outcomes.

The heavy lifting for this plot is done by the function sjp.lm from the sjPlot library. The main argument linreg is the standard results of a linear regression model, which is a complex list with all kinds of information buried in it. 

sjp.lm(linreg,
       axisLabels.y=lab,
       axisLabelSize=1,
       breakLabelsAt=30,

       showStandardBeta=FALSE).

The various options are explained on the documentation page for sjp.lm. There are many other versions of the same idea in the sjPlot library, such as for plotting interaction effects, odds ratios, etc.

Next year I think I will require students to report results this way for their homework. I will also discuss “standardized regression coefficients,” and the broader concept of variable importance as opposed to statistical significance. Statistical significance can be quite high even when the underlying variable is unimportant to the actual results!

The author of this library is apparently Strenge Jacke!, who has written a number of other libraries for convenient analysis that I will have to check out.

Advertisements

2 thoughts on “Showing linear regression coefficients

  1. Hi Roger,
    thanks for your post and mentioning my package(s)! Please note that the argument names have changes, so your example (taken from an older of my blog posts, I guess) won’t work for the current version of sjPlot on CRAN.
    Best, Daniel

  2. Daniel, Thanks for the correction. I will turn this into a note for students when it’s time to teach the course again, and at that time I will make sure everything is up to date.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s