Hello,
I am writing with regards to a topic that I know has been discussed on the group page before, an error associated with factor covariates in an spde model:
Error in inla(form, family = "gaussian", data = inla.stack.data(stk.dat), :
With control.fixed = list(expand.factor.strategy='model.matrix'), then NA's in factor are not allowd. Please use strategy 'inla' instead.
My question is this: why does this error occur when there are no NA values in my data? Is this just because some mesh vertices are at unobserved points?
Secondly, when I do switch the setting to expand.factor.strategy='inla' why would the following error occur even though the factor has 2 or more levels?
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Is there a recommended approach for dealing with this problem(s) aside from using 0/1 dummy variables to get around it, or something obvious that I am overlooking? Thanks for your time.
-tyler scott
Tyler ScottAssistant Professor of Public Policy
Department of Public Administration and Policy
School of Public and International Affairs, University of Georgia