Linear mixed model inner working My question is about the basics of linear mixed model and it may be trivial for some of you. Basically, I followed from this tutorial http://www.bodowinter.com/tutorial/bw_LME_tutorial2.pdf on how to do linear mixed effect analyses in R. I am looking for an effect of a genotype on plant growth. I start with $3n$ seeds, $n$ of which have genotype A and other $2n$ have genotype B. I measure the height for each of these seeds by growing them in $n$ trays. Each tray has $1$ seed of genotype A and $2$ seeds of genotype B. So I have a dataframe in R with three columns. First column is plant genotype, second column is tray index and final is observed height. There are $3n$ observations. Following from Bodo Winter's tutorial, I define an alternative model in R as:
alt <- lmer(height ~ genotype + (1+genotype | tray), data=data, REML= FALSE)

I also define a null model:
nul <- lmer(height ~ genotype + (1+genotype | tray), data=data, REML= FALSE)

Then, I compare the results from these two models by doing 
anova(alt, nul)

I have been interested in following two quantities:
c(coef(summary(alt))[2, "Estimate"], anova(alt, nul)$"Pr(>Chisq)"[2])

My questions are:


*

*What is the underlying matrix formulation that the alt and nul models are solving? I am good with linear algebra but I cannot find any adequately brief or self-contained description just answering my question about my models. All the theory I read is too general and I'd have to read through a lot of stuff to understand it. While I plan to do it, currently I need to finish a project and will feel very comfortable if I could get some insight in what is happening.

*How is anova comparing the two models to get the p value? Again I could find descriptions on how anova makes use of F-values to estimate significance, I could not relate that description to comparison of two models.
Any explanation will be highly appreciated.
 A: I guess all your questions can be answered by this book here: http://www.springer.com/gp/book/9780387874579, chapter 5 particularly.
Question 2. Normally, you fit mixed-effects model with restricted maximum likelihood (REML), description of which is nicely provided in the above-mentioned book. Function anova() performs a likelihood ratio test and that is why you need to have REML=FALSE argument in you model. However, I can see that your nul and alt model are exactly the same models. To test a statistical significance of your fixed-effect you need to exclude it from the nul model and then run anova() function:
alt <- lmer(height ~ genotype + (1+genotype | tray), data=data, REML= FALSE)
nul <- lmer(height ~ (1+genotype | tray), data=data, REML= FALSE)
anova(alt,nul)

The obtained p-value would show the statistical significance of your fixed-effect. 
Question 1. Do not quite understand the question, the matrix formulation for mixed-effects models is nicely described in the above-mentioned book. 
