Expressing multivariate repsonse with StatsModels.@formula

Hi all,

I’m trying to model a multivariate response variable using GLM.jl (and potentially MixedModels.jl at a later point). I know that there isn’t first-class support for this, but people usually suggest introducing a trait variable, thereby splitting the different responses into a “long” version. In my case, I have a two-dimensional response (we can assume normality of both dimensions) and I would like to know if observations differ across “condition” (no mixed effects for now).

a) How would I express this using GLM.jl? As far as I can see, I should be able to do something like this: @formula(value ~ 0 + trait & (1 + condition)) - does that look right? So no overall intercept, but the interaction between the intercept and the condition of interest.

b) How would I test this analog to a Hotelling’s T2 test? Can I just run an F-Test against the model only containing the trait term? I tried that, but the results are different than what I get with HypothesisTests.UnequalCovHotellingT2Test().