This question is inspired by the comments to one of my answers on this forum: Should all adjustments be random effects in a mixed linear effect?.
In my answer, I stated something akin to the following: In a mixed effects model, only within-subject predictor variables can be allowed to have varying (or random) effects across the levels of the corresponding random grouping factor.
The comment I received from @HeteroskedasticJim was that this is not really true, implying that even between-subject predictor variables can in fact have within-subject effects that can vary across subjects. (At least, that is my interpretation of this comment.)
My own response to this comment was as follows:
How can we compute the effect of gender within one subject when there is no variability in the values of gender within that subject? The effect of gender within one person would imply that when that person switches genders from male to female, say, there is a difference in the expected value of their response. The variability of the (within-subject) gender effects across subjects would imply that the difference would vary across subjects - so all those subjects would have to have a gender switch! Just trying to understand intuitively what is going on here.
Can someone on this forum provide a concrete example that can help me understand what this comment is trying to get at? I always thought that, to estimate a within-subject effect for a predictor variable, you need to have variability in the values of that predictor variable within that subject. What glaring thing am I missing?