[英]How to get confidence intervals after extracting robust standard errors in R?
First, i run a regression model.首先,我运行回归 model。 Then, i extract robust standard errors.然后,我提取稳健的标准误差。 However, i am not sure how to extract the confidence interval afterwards, coeftest()
seems to include only the standard errors.但是,我不确定之后如何提取置信区间, coeftest()
似乎只包括标准错误。 Is there a way to do it automatically?有没有办法自动完成?
Here is the reproducible data and code:这是可重现的数据和代码:
library(plm)
library(lmtest)
library(broom)
data(Cigar)
model<- plm(price ~ sales + cpi, index=c("state", "year"), model = 'within',
data = Cigar)
#Extract the robust standard errors
plot_coeftest = tidy(coeftest(model))
as @deschen proposed, this is the solution:正如@deschen 建议的那样,这是解决方案:
plot_coeftest= broom::tidy(lmtest::coeftest(model), conf.int = TRUE)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.