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.



1 Answer 1


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)) %>% 
             ungroup() %>%  mutate(gmc_sum = sum - mn_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.

  • $\begingroup$ Thanks for your answer! This already really helpful. In our field, the total effect (how I would call the effect in the first stage regression) of the sum is already well studied but meta-analyses show that this effect is actually small. In our study we try to explain this effect through the second stage, so the individual investments. We assume that some specific investments (variables) are positively correlated (the total effect is also assumed to be positive) with the total effect but others may even harm the total effect, i.e. these are misinvestments. $\endgroup$ Commented Jan 19, 2020 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.