As I understand it, this is a fixed-effects GLM (as could be used in analyzing the results of an fMRI experiment):
$$Y = X\beta + \epsilon$$
I assume that $Y$ is a matrix of all the data (voxels $\times$ time points) concatenated diagonally over all subjects, and padded with zeroes. Consequently the estimated $\beta$ should be a matrix of contrasts (over regressor and participant). I have repeatedly read that this allows us to "compare the group effect to the within-subject variability".
- How?
Apparently to capture effects that differ in spatial pattern and/or magnitude over participants, we need a random-effects model. As I understand it, this looks like this:
$$Y = X\beta + \epsilon$$
$$\beta = X'\beta' + \epsilon'$$
- What kind of matrix is $X'$?
- Why do we need this? doesn't $\beta$ already contain participant-specific estimates – which we can use to get $\mu$ and $\sigma$ for every voxel?
Best Answer
This is a pretty broad question - I would basically translate this into: what is a GLM, and what is a mixed model. First of all, you write that you want to fit a GLM, but I suspect you mean LM, because the formula
$$Y = X\beta + \epsilon$$
would typically denote an LM. For the GLM, we would have an additional link function.
In the formula above, $Y$ is your response, $X$ are your predictors (design matrix), and $\beta$ are the regression coefficients for these predictors (contrasts if categorical).
Your notation for a random-effects model is a bit unorthodox (not sure from where this is taken), but I would suspect
$$Y = X\beta + \epsilon$$ $$\beta = X'\beta' + \epsilon'$$
means that you want to fit a so-called random slope model, in which the regression coefficients / contrasts can differ for each grouping factor. The assumption of the random slope model is that differences in $\beta$ between the groups are drawn from a normal distribution $\epsilon'$, which is the between-group-variability. So the final entire vector of predictors $\beta$ is composed of the overall $\beta'$ and the random effects $\epsilon'$.
In general, I'm not sure if this notation is exceedingly useful to understand how a mixed model works - I would suggest to read start with a general textbook or tutorial about mixed models.
Of course there are many other good books, it depends on your field and what level of mathematics you are looking for.