# ComBat batch correction: understanding the model

A collaborator of mine is using ComBat for some RNA-seq data. I would like to understand what it's doing, and I have a specific question about the structure of the model. Equation 2.1 of the paper reads

$$Y_{ijg} = \alpha_g + X\beta_g + \gamma_{ig} + \delta_{ig}\epsilon_{ijg}$$

where $$i$$ is the sample, $$j$$ is the batch, $$g$$ is a gene, $$Y$$ is observed expression, $$\alpha$$ is an intercept term, $$\beta$$ is a vector of coefficients, $$\gamma$$ is an additive batch effect, $$\delta$$ is a multiplicative batch effect, and $$X$$ is a design matrix.

Why is $$X$$ not indexed by $$i$$? If there are $$n$$ samples, $$m$$ genes, and $$d$$ variables in the analysis, what are the dimensions of $$X$$ (or $$X_i$$) and $$\beta_g$$?