# Tautology in multi level model

We want to estimate a multi level model with second stage regressors.

How does it behave in the following scenario: We have a panel data set with i individuals over t time points. We have a set of variables, say X1, X2, X3 which are all on the same scale. Assume that these measure e.g. investments in three different objects. I sum these up and use the sum of these variables (i.e. the total investment across objects) as a regressor in the first stage regression. Now I want to explain the i individual coefficients in the second stage regression by the individual-specific mean value of the variables X1, X2, X3 over the t time points (what was the average investment of individual i in objects 1, 2, 3?). So I want to estimate the relative influence of the three variables on the overall effect.

Is there anything statistically clearly against this? At the moment we are unsure about this. The variables (sum and the individual variables) do not appear in the same regression (keyword multicollinearity). We further do not explain the sum itself through the variables, but only the effect of the sum.

Thanks!

It would be helpful to know why you would choose to model the data in this way. However in terms of the multilevel model, this is technically possible to do. I would suggest group mean centering the within-unit sum by subtracting each unit's mean from their time-specific value on the sum. In R's dplyr:
df <- df %>% group_by(unit) %>% mutate(gmn_sum = mean(sum)) %>%

This means that the new sum variable (gmc_sum) purely measures within-unit variation in sum, which is completely uncorrelated with the pure between group variation in sum (gmn_sum). Then you can add the group mean of sum (gmn_sum) or the group mean of its constituent variables. The multilevel model does this "for free" if you leave sum uncentered at level 1 (within unit) and then enter the group mean for sum at level 2 (between unit), which is what I see in practices much more often than the method you propose. Obviously you would not want to have both the group mean of sum and the group means of its three constituent parts in the same model for the multicolinearity problem you identify.