r - 1 - diaghat 中的错误:二元运算符的非数字参数
问题描述
我想运行一个双向固定效应模型,然后纠正标准错误。
mod3 = plm(Dir ~ Dist +Trade + GDP_sim +GDP +
GDP_capita_constant +Openess + GDP_g + Endowments +
US_PTA + Japan_PTA + FDI + Population+ Democracy+Rule_of_Law+Values+sim+
WTO, data= dfPTA, index = c("Country", "Year"),
model = "within",
effect = "twoway")
这很好用。
但是,在运行此行时
m.2wfe.scc <- coeftest(mod3, vcov = vcovSCC(mod3, type = "HC3", cluster = "group"))
我收到以下错误消息
Error in 1 - diaghat : non-numeric argument to binary operator
我所有的变量都是数字或整数(国家除外)。
有趣的是,我可以跑
mod4 = plm(Dir ~ Dist + Trade + GDP_sim +GDP +
GDP_capita_constant+Population+FDI, data= dfPTA, index = c("Country", "Year"),
model = "within",
effect = "twoway")
m.2wfe.scc <- coeftest(mod4, vcov = vcovSCC(mod4, type = "HC3", cluster = "group"))
它有效。Alltough 我没有看到子集变量和完整模型之间的区别。
有任何想法吗?
解决方案
推荐阅读
- email - 基于条件字段的电子邮件保存搜索
- node.js - MongoDB 在 find 函数中返回所有结果
- buildroot - 如何将二进制文件添加到 buildroot 生成的图像?
- php - Codeigniter 3 - sess_time_to_update 和 sess_save_path
- r - 退出闪亮的应用程序时添加“您确定要离开此页面”警报消息
- function - 尝试使用带有 PowerShell Azure 功能的 Connect-PnPOnline 连接到 office 365 时出现异常
- networking - 我正在慢慢发疯。这一定有一个简单的答案。localhost RPC 服务器如何告诉客户端他们在哪个端口上运行?
- ios - NSLog/OSLog 间歇性地显示在控制台中
- sql-server - 导入 Excel 数据似乎随机给出 Null 值
- html - Web 组件 - 不接受子元素