为什么我在 R 中运行 felm固定效应线性模型代码时只得到 NA?

问题描述

dput(TandC[1:5,])

大家好! 我想在 R 中运行这个固定效应线性模型,但是当我运行代码时出现这个奇怪的错误,然后是一个充满“NA”的输出。这是我得到的错误

Warning in chol.default(mat,pivot = TRUE,tol = tol) : the matrix is either rank-deficient or indefinite

这是我的模型:

m6a <- felm(ihs(RD_expenses) ~ merger_it_post1 + merger_it_post2 + merger_it_post3 + age + ihs(rd_expenses_pre1) + ihs(employees_pre1) + ihs(profit_pre1) + factor(year)
       | company | 0 | company,data = TandC,na.action,subset = RD_expenses > pcts[1] & RD_expenses < pcts[2])

总结(m6a)

merger_it 变量是虚拟变量,其余变量是协变量。 例如,我确实在 profit_pre1 中有一些 NA,但这是因为这些变量是基于 tje period 变量形成的。

我不知道我做错了什么,因为没有协变量的模型(所以只有合并虚拟变量和固定效应)工作得非常好。

谁能帮帮我?非常感谢!!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)