问题描述
我想计算beta回归的边际效应。 我有以下模型:
model <- betareg(y~ var1 * poly(var2,3),data)
变量1是一个因数,变量2是一个数字变量。 我想在变量2的值范围内计算AME。
因此,我想使用以下代码:
margins.1 <- margins::margins(model,variables = "var1",type = "response",at = list(var2 = seq(min(var2),max(var2),0.001)))
我收到以下错误:
Error in poly(var2,3) : 'degree' must be less than number of unique points
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)