# Which is the dimension (or units) of the predicted random effects?

Consider a simple panel data (or multilevel model) with random effects. For context, consider a wage regression, where the dependent variable $ln(y_{it})$ is the natural log of wage, where the wage is measured in £ per hour. The regression to be estimated is:

$$ln(y_{it})= X_{it}\beta + \zeta_{i} + \eta_{t} + \epsilon_{it}$$

where $\zeta$ and $\eta$ represent individual heterogeneity and year effects, respectively, and $\epsilon_{it}$ is white noise (or idiosyncratic error).

You estimate the above model, and obtain an estimate for the random effects. I have three related questions.

Question 1:

Which is the dimension/units of both error components? Do they have the same units as the dependent variable? (which actually has no units, because logarithm is dimentionless). If so, is there a formal proof of this?

Question 2:

If the answer is yes to Q1, then, does it mean that $exp(\zeta_i)$ and $exp(\eta_t)$ are measured in £ per hour?

Question 3:

But then, how can we go back to the theory? For instance, my theory could assume that workers are paid according to their productivity. Therefore, you can somehow split the pay to wages in terms of something like

$$y_{it} = \omega_t h_{it}$$

where $h_{it}$ is productivity (output per hour) and $\omega_t$ is the pay rate per product unit, i.e. £ per output, which combined give £ per hour. Thus, if one wanted to use such a wage regression to find those two elements, it seems impossible to do so, because all we are measuring is always in the same units than the left-hand side variable. We can therefore never go back to the theory.

To put it differently, say the answer to Q1 is yes (as I expect so to be). Then, let's exponentiate the regression:

$$y_{it} = exp(X_{it}\beta) \ exp(\zeta_i) \ exp(\eta_i) \ exp( \epsilon_{it})$$

So, $y_{it}$ is measured in £ per hour. How do we get the same units from the right-hand side? If the exponential of the two random effects (and the error term) are measured in £ per hour (Q2), then it's up to $exp(X_{it}\beta)$ to balance the units of the equation. But for this to be the case, the units of the latter would have to be $\left(\dfrac{hour}{£}\right)^2$, which looks totally arbitrary. Furthermore, how can we ever go back to the theory and write the resulting estimates in terms of productivity and pay per unit of output? (Q3)

• Whatever is added must have the same dimensions. – Nick Cox Jul 4 '16 at 8:52
• Your formula is additive. It makes no difference whether you are joining or splitting. Synthesis looks the same as analysis. – Nick Cox Jul 4 '16 at 20:33
• For $\ln(y_{it})$ to be properly defined, don't you need $y_{it}$ to be dimensionless? – Robin Ryder Sep 8 '18 at 8:57
• When you take the exponent for $ln(y_{it})= X_{it}\beta + \zeta_{i} + \eta_{t} + \epsilon_{it}$ then you should add a coefficient before it with some dimension. E.g. you go from $$ln(y_{it})= ln(a) + X_{it}\beta + \zeta_{i} + \eta_{t} + \epsilon_{it}$$ to $$y_{it}= a e^{X_{it}\beta + \zeta_{i} + \eta_{t} + \epsilon_{it}}$$ where $a$ is the intercept that you omitted in your formula (possibly because you assume $ln(a)$ is zero) but it still is there to keep the dimensions correct ($a$ has dimensions of $y$). Why, what-for do you need an official source? – Sextus Empiricus Sep 8 '18 at 21:43
• If you take log or exp then you sort of 'remove' the dimensions. You can 'get them back' by multiplying with a constant equal to 1 and this you can take together with your intercept term. So by $$a = 1 \cdot e^{\log a} = 1 \cdot e^{\beta_0}$$ you can turn the exponent of $beta_0$ into a term with dimension by combining the dimensionless constant with a constant equal to $1$ but with dimensions equal to $y$ whenever you have a exponent or logarithm in relation to some parameter with dimensions then you should place a constant (possibly equal to 1) in front of it with dimensions. – Sextus Empiricus Sep 9 '18 at 9:47

The issue is that you are attempting to take the logarithm of a variable which is not dimensionless.

There are a number of reasons to state that $\ln(x)$, $\exp(x)$, $\cos(x)$ and so on are properly defined (from a dimensional analysis point of view) only if $x$ is dimensionless. For example, if you define the $\exp$ function by its power series $$\exp(x)=1+x+\frac{x^2}{2}+\frac{x^3}{6}+\ldots$$ then you are adding $x$ and $x^2$, which is only possible if $x$ is dimensionless. See this discussion on physics.SE for details and links.

Yet, as you wrote in the comments, we often take logs of variables which are not dimensionless; in your model, the unit of $y_{it}$ is $£/h$. This is resolved by adding an arbitrary base value: a more formal way of writing your model would be to define $y_0=1£/h$ and write $$\ln\left(\frac{y_{it}}{y_0}\right)=X_{it}\beta+\zeta_i+\eta_t+\epsilon_{it}$$ and now it is clearer that your dependent variable is dimensionless, as are $\zeta_i$ and $\eta_t$.

Exponentiating, you get $$y_{it}=y_0e^{X_{it}\beta}e^{\zeta_i}e^{\eta_t}e^{\epsilon_{it}}$$ where $y_0$ is in $£/h$ and the other variables are dimensionless.

The answer to Q1 is thus no, and this hopefully clears everything up for Q3.

As Robin has pointed out in his answer, it is possible to deal with equations involving units by dividing through by a base value of a single unit, thus creating a unitless equation. However, it is also possible to deal directly with the dimensional quantities (i.e., with the units still included) by treating the units as algebraic quantities that are subject to an algebra of operations. The field that examines the algebraic structures for dimensional quantities is called dimensional analysis.

Dimensional analysis is a well-developed field with a substantial literature (see e.g., Drobot 1953, Huntley 1967, Whitney 1968a, Whitney 1968b, Szekeres 1978, Hughes 2016). Analysis within this field is generally undertaken formally by defining an algebra that can handle arithmetic operations on quantities that possess units, which involves creating an algebra on a set containing the real numbers, plus some unit quantities representing the units of analysis. The core operations in these algebras are addition and multiplication, but it is generally possible to extend to consideration of more complicated operations (like the exponential and logarithmic transformations) using standard formulae that relate these to addition and multiplication (e.g., their power series definitions). Since exponentials and logarithms are defined through power series, extension of the algebraic system to incorporate logarithms of quantities with units requires you to add quantities with different units, so this requires an algebra that is sufficiently developed for this purpose (discussion and some of the maths can be found in some answers to a similar question here).

It is notable here that there are various suggestions floating around the internet suggesting that you can only take logarithms of a dimensionless quantity. This is false --- it is possible to create an algrebraic structure that is sufficiently rich to incorporate units, allow you to add quantities with different units, and therefore allow you to extend to logarithms of quantities with units. You need to be careful if you do this, since operations on units are not necessarily easy to interpret, and they follow some algebraic rules that are non-intuitive.

Units in your analysis: Consider your regression equation where the variables have units (using your example where the response variable is a wage rate, modelled by looking at productivity and pay rate). To facilitate our analysis we denote dimensionless quantities for those variables (i.e., stripped of their units) using standard notation, and we denote the inclusion of units by putting a tilde on top of the notation. We can the write the dimensional quantities as a product of a dimensionless value and a unit quantity as follows:

$$\tilde{y}_{i,t} = y_{i,t} \cdot \mathbf{u} \quad \quad \quad \exp (\tilde{x}_{i,t} \tilde{\beta} ) = \exp (x_{i,t} \beta) \cdot \mathbf{u} \quad \quad \quad \mathbf{u} \equiv 1 \cdot \frac{£}{\text{hours}}.$$

In this system, the base unit $\mathbf{u}$ is rate of one pound per hour. If we include the units, your log-linear model can then be written as:

$$\ln \tilde{y}_{i,t} = \tilde{x}_{it} \tilde{\beta} + \zeta_{i} + \eta_{t} + \epsilon_{it}.$$

The response variable here is a dimensional quantity measured in "log pounds per hour"$^\dagger$, as is the first term on the right-hand-side of the equation. The remaining random effects and error terms are dimensionless. Alegraic manipulation of the equation to separate the units from the corresponding dimensionless quantities yields:

$$\ln y_{i,t} + \ln \mathbf{u} = x_{it} \beta + \ln \mathbf{u} + \zeta_{i} + \eta_{t} + \epsilon_{it}.$$

The term $\ln \mathbf{u}$ on both sides of this equation shows that both sides are dimensional quantities measured in "log pounds per hour". So, in answer to your specific questions: (1) The random effects/errors are dimensionless, and this is the case even if you take your response variable to have a dimension; (2) the exponentiated random effects/errors are also dimensionless; (3) theoretical understanding of the interrelation of the units in the equation requires you to look at algebraic structures that incorporate both dimensionless numbers and also units (see the above literature to get started on this).

$^\dagger$ This name for the units is a little ambiguous, since it is unclear grammatically that the logarithm is taken after taking the ratio of pounds per hour. We will assume in the present context that this is clear enough for our purposes.

• Thanks (late but well, just had time now to get deep into this). A few comments. First, I find odd that one can "choose" how to see the model, either with or without units. The regression is what it is, ontologically speaking. Who can we decide on the interpretation at our will? Second, in my application, $\omega_t$ is estimated using year fixed effects, the $\eta_t$ in the regression. But then, if the latter has no dimension, it means we cannot really go back to the theory, as we do not know the relationship between $\eta_t$ and $\omega_t$. Finally, are these effect really dimensionless? – luchonacho Oct 27 '18 at 16:39
• If we change the dimension of the dependent variable, don't these change too? – luchonacho Oct 27 '18 at 16:40