rlinear-regressionsummarypanel-dataplm

Getting a subset of variables in R summary


When using the summary function in R, is there an option I can pass in there to present only a subset of the variables?

In my example, I ran a panel regression with plm() (from package plm) I have several explanatory variables, and have many dummy variables whose coefficients I do not want to present. I suppose there is a simple way to do this, but couldn't find it in the function documentation.


Solution

  • It is in the documentation, but you have to look for the associacted print method for summary.plm. The argument is subset. Use it as in the following example:

    library(plm)
    data("Grunfeld", package = "plm")
    mod <- plm(inv ~ value + capital, data = Grunfeld)
    print(summary(mod), subset = c("capital"))