I am running models with plm with re-calculated standard errors. The challenge? I want to turn the models with the updated standards errors into a stargazer regression table.
Here is some sample data
library(plm)
library(stargazer)
df <- data.frame(year= rep(c(2000:2005), each=6),
county= rep(c("c1", "c2", "c3", "c4", "c5", "c6"), times=6),
temperature= runif(36, min=40, max=80),
trade= runif(36, min=10, max=20),
policy.outcome= runif(36, min=0, max=100))
df.p <- pdata.frame(df, index=c("county", "year"))
m1 <- plm(policy.outcome
~ temperature + trade, data=df.p, model="within", effect="twoways")
summary(m1)
I would like to load this model into stargazer
summary(m1, vcov = function(x) vcovDC(x, type="HC1"))
stargazer(m1, align= T, type = "text")
stargazer(m1, ...)code? Does it not return what you want, throw an error, etc?help("stargazer")specifies how you can pass modified standard errors ...modelsummarylets you do this in the same call withmodelsummary(m1, vcov = \(x) vcovDC(x, type = 'HC1'))