Regression result tables are produced via stargazer
from plm
objects. Below in the summary part, only Oberservations, R², Adjusted R² and the F Statistic are presented. I would also like to include the number of groups and periods. These appear as "n" and "T" in the plm
object.
Asked
Active
Viewed 454 times
2

Dima
- 146
- 1
- 1
- 12
1 Answers
1
I suggest to add those manually.
library("plm")
library("stargazer")
data("Produc", package = "plm")
panel_model <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
data = Produc,
index = c("state","year"),
method="within")
# n (groups) and T (periods) appear in summary
summary(panel_model)
# adding those manually
stargazer(panel_model,type="text", add.lines = list(c("Groups", "48"), c("Periods", "17")))
This and more you find on:

Marco
- 2,368
- 6
- 22
- 48
-
Thanks for the answer. This solution works for a clearly arranged set of regression columns. But when you create plenty and/or if the data changes, it'll become hard. Isn't there a solution to include something like Statas ```scalars``` into the stargazer output? – Dima Jan 23 '20 at 07:35