# Expressing multivariate repsonse with StatsModels.@formula

**URL:** <https://discourse.julialang.org/t/expressing-multivariate-repsonse-with-statsmodels-formula/111705>\
**Category:** Statistics\
**Tags:** glm\
**Created:** [March 16, 2024, 7:08pm UTC](https://discourse.julialang.org/t/expressing-multivariate-repsonse-with-statsmodels-formula/111705 "2024-03-16T19:08:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcpabst](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcpabst](https://discourse.julialang.org/u/marcpabst)\
**Post date:** [March 16, 2024, 7:08pm UTC](https://discourse.julialang.org/t/expressing-multivariate-repsonse-with-statsmodels-formula/111705/1 "2024-03-16T19:08:03Z")

</div>

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