我试图将常数定义为r回归系数。也就是说,试图将弹性定义为你可以在照片中看到的数字-1.64431。

reg <- lm(ln_q ~ ln_price, data=df)
elasticity <- reg[["coefficients","ln_price"]]
print(elasticity)我知道错误:
Error in reg[["coefficients", "ln_price"]] :
incorrect number of subscripts如有任何帮助,不胜感激!)
发布于 2020-01-22 23:52:11
elasticity <- reg$coefficients[names(reg$coefficients)=="ln_price"]https://stackoverflow.com/questions/59869813
复制相似问题