1

I am relatively new to R. I am trying to fit a CAR model in R using a dta file from Stata. I am using INLA package (I also tried with BayesX).

This is my code:

model_linear <- inla(form_fit,family="gaussian",data=zim_child_model,
                       control.compute=list(dic=TRUE, waic=TRUE))

I keep running into this error:

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
zx8754
  • 52,746
  • 12
  • 114
  • 209
  • Hi, welcome to Stack Overflow. Please share enough information to make a reproducible example and let us know what you tried. For example, what was the output when you ran `rlang::last_trace()`? Also, we have no info on the content or structure of `form_fit` or `zim_child_model` in your example. – PeterK Jan 17 '21 at 17:26

0 Answers0