相关疑难解决方法(0)

从lfe包预测felm的方法

有没有人有一个很好的清洁方式来获取模型的predict行为felm

library(lfe)
model1 <- lm(data = iris, Sepal.Length ~ Sepal.Width + Species)
predict(model1, newdata = data.frame(Sepal.Width = 3, Species = "virginica"))
# Works

model2 <- felm(data = iris, Sepal.Length ~ Sepal.Width | Species)
predict(model2, newdata = data.frame(Sepal.Width = 3, Species = "virginica"))
# Does not work
Run Code Online (Sandbox Code Playgroud)

r predict lfe

20
推荐指数
4
解决办法
4867
查看次数

标签 统计

lfe ×1

predict ×1

r ×1