I found these papers on linear mixed model with a single random intercept:
1.
https://www.genetics.org/content/177/1/577.long
Where they use an approach for implementing a linear mixed model, where they regress out the BLUP of the random effects (after having estimated the variance components under a null model) and then run a normal linear model on the residuals.
So they do this, for this linear mixed model ($X$ being the design matrix with also column of 1s for intercept:
$y=X\beta+u+e$
They run the model (null model) like this (meaning not including the genotype in their design matrix, only covariates):
$y=X'\beta' + u +e$
They can estimate the BLUP for $u$, from this null model:
$\hat{u}=\sigma_e^2V^{-1}y$
Where $G$ is the co-variance matrix of $u$ and $V=ZGZ^T+R$, where $R$ is the co-variance matrix of $e$. And where $G=\sigma^2_uK$ and $R=\sigma_e^2I$. Let us say that $Z$ is the identity matrix and that we therefore have a linear mixed model with only a random intercept.
They then run this model on the residuals of the null model:
$\tilde{y}=y-(X'\beta' + \hat{u})$
$\tilde{y}=\alpha+g\beta+e'$
(Where $g$ are the genotypes). So the regress out the random effects in the first step.
I have tried myself and this approach gives different results from this approach:
2.
Here they estimate $\sigma^2_u$ and $\sigma_e^2$ under the null model:
$y=X'\beta' + u +e$
And then use the same $\sigma^2_u$ and $\sigma_e^2$ values for each genetic variant, when using the full model, instead of re-estimating $\sigma^2_u$ and $\sigma_e^2$ each time.
$y=X\beta+u+e$
https://www.nature.com/articles/ng.548
So my issue is, why are these two models different?? They are both using the variance components from the null model?
Essentially can I regress out the random effects using the BLUP?