Here’s what the AI recommends, but it doesn’t seem to work:
varname = :y # or Symbol("y")
f = @formula($(varname) ~ A * B + (1 | id))
Following previous topics here in discourse I also tried Term(:fname) but this doesn’t work either, I’m getting this error:
ERROR: MethodError: no method matching |(::Int64, ::StatsModels.Term)
The function `|` exists, but no method is defined for this combination of argument types.