I’m using TuringGLM
to fit a hierarchical logistic model on my choice data, but kept getting this type FunctionTerm has no field args
error which I think complains about the variable type of my random effect variable subjid
. If I drop the random effect term the model fitting works , but if I add back the random effect, even with other model family I still always get this error.
I’ve tried the example given on the TuringGLM website tutorial and it worked fine. Then I compared the example dataset they have vs my dataset, and tried drop rows with missing values, changed all categorical data into PooledArray
, but still have this error.
Below are my formula, model, dataframe, and error message. Anyone have an idea what specific format I need to make my random effect variable into to make this work? Thank you!
mod = @formula(chooseLot ~ (1 | subjid) + delta_EV + prev_outcome1);
mhh = turing_model(mod, data; model=Bernoulli)