# TuringGLM random effect variable format requirement

**URL:** <https://discourse.julialang.org/t/turingglm-random-effect-variable-format-requirement/122424>\
**Category:** Probabilistic Programming\
**Tags:** question\
**Created:** [November 8, 2024, 4:20pm UTC](https://discourse.julialang.org/t/turingglm-random-effect-variable-format-requirement/122424 "2024-11-08T16:20:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cong/32/202895_2.png) [@Cong](https://discourse.julialang.org/u/Cong)\
**Post date:** [November 8, 2024, 4:20pm UTC](https://discourse.julialang.org/t/turingglm-random-effect-variable-format-requirement/122424/1 "2024-11-08T16:20:08Z")

</div>

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)`

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/3/83625f39ad565838be3049e10071c3858a2bac53.png)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/5/556ffe3e01c103e35e58c7ef3e9e3b4167d3fae6.png)
