问题描述
我对 R 比较陌生。我正在尝试使用 Stata 的 dta 文件在 R 中拟合 CAR 模型。我正在使用 INLA 包(我也尝试过使用 BayesX)。
这是我的代码:
model_linear <- inla(form_fit,family="gaussian",data=zim_child_model,control.compute=list(dic=TRUE,waic=TRUE))
我一直遇到这个错误:
Error: `dim<-.haven_labelled()` not supported.
Run `rlang::last_error()` to see where the error occurred.
> rlang::last_error()
<error/vctrs_error_unsupported>
`dim<-.haven_labelled()` not supported.
Backtrace:
1. INLA::inla(...)
2. MatrixModels::model.Matrix(...)
3. Matrix::sparse.model.matrix(...)
4. Matrix:::model.spmatrix(...)
6. vctrs:::`dim<-.vctrs_vctr`(`*tmp*`,value = c(1L,length(f)))
7. vctrs:::stop_unsupported(x,"dim<-")
8. vctrs:::stop_vctrs(...)
Run `rlang::last_trace()` to see the full context
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)