Although stargazer
is said to work with objects created by plm::pgmm()
(see here) I get the error Error: Unrecognized object type
when running the following code:
require(pder)
require(plm)
require(stargazer)
data("DemocracyIncome", package = "pder")
abond_2step <- plm::pgmm(
formula = democracy ~ lag(democracy) + lag(income) | lag(democracy, 2:99) | lag(income, 2),
data = DemocracyIncome, subset = sample==1, index = c("country", "year"),
model = "twostep", effect = "twoways")
stargazer::stargazer(abond_2step) # yields 'Error: Unrecognized object type'
Am I doing something wrong or does stargazer
not support objects created by plm::pgmm()
any more? The relevant specification of my session are as follows:
R
:4.0.4
(Mac)plm
:2.4-1
pder
:1.0-1
stargazer
:5.2.2
Thanks a lot for your help!
Edit: I figured out that when removing the explicit plm::
befor pgmm
the code works, yet I have no idea why:
abond_2step_alt <- pgmm( # removed plm::
formula = democracy ~ lag(democracy) + lag(income) | lag(democracy, 2:99) | lag(income, 2),
data = DemocracyIncome, subset = sample==1, index = c("country", "year"),
model = "twostep", effect = "twoways")
stargazer::stargazer(abond_2step_alt) # This works!