将观星者扩展到multiwaycov [英] Extending Stargazer to multiwaycov

查看:99
本文介绍了将观星者扩展到multiwaycov的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用观星者为我的学士论文创建回归输出.由于数据的结构,我必须使用集群模型(下面的代码).我正在使用multiwaycov软件包中的vcovclust命令,该命令运行良好.但是,观星者不支持它.您是否知道另一种创建像观星人一样出色的输出的方法?还是您知道其他由Stargazer支持的用于对模型进行聚类的程序包/命令?

I'm using stargazer to create regression outputs for my bachelor thesis. Due to the structure of my data I have to use clustered models (code below). I'm using the vcovclust command from the multiwaycov package, which works perfectly. However, stargazer does not support it. Do you know another way to create outputs as nice as stargazer does? Or do you know an other package/command to cluster the models, which is suppported by stargazer?

model1.1.2 <- lm(leaflet ~ partisan + as.factor(gender) + age + as.factor(education) + meaning + as.factor(polintrest), data = voxit)
summary(model1.1.2)

#clustering
vcov_clust1.1.2 <- cluster.vcov(model1.1.2, cbind(voxit$id, voxit$projetx))
coeftest(model1.1.2, vcov_clust1.1.2)

推荐答案

您可以手动将调整后的p值和se值提供给寻星者.

You can supply the adjusted p- and se-values to stargazer manually.

# model1 and model2 are both objects returned from coeftest()
# Capture them in an object and extract the ses (2nd column) and ps (4th column) in a list
ses <- list(model1[,2], model2[,2])
ps <- list(model1[,4], model2[,4])

# you can then run your normal stargazer command and supply
# the se- and p-values manually to the stargazer function
stargazer(model1, model2, type = "text", se = ses, p = ps, p.auto = F)

希望这会有所帮助!

这篇关于将观星者扩展到multiwaycov的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆