Using the method of moments or maximum likelihood to estimate parameters
For estimating \(\mu\), this method uses the overall mean \(\bar{y}\).
What about the \(\sigma^2\)’s? The key identity is, \[\begin{align*} \mathbf{E}\left[MS_{\text{treatments}}\right] &= \sigma^2 + n \sigma_{\tau}^2 \\ \mathbf{E}\left[MS_{E}\right] &= \sigma^2 \end{align*}\]
We can approximate the expected values using, \[\begin{align*} MS_{\text{treatment}} \approx \sigma^2 + n \sigma_{\tau}^2 \\ MS_{E} \approx \sigma^2 \end{align*}\]
If we pretended these approximations were exact equalities, then we have two equations with two unknowns. The method of moments defines parameter estimates as the solutions to that system of equations. \[\begin{align} \hat{\sigma}^2 &= MS_{E} \\ \hat{\sigma}^2_{\tau} &= \frac{1}{n}\left[MS_{\text{treatment}} - MS_{E}\right] \end{align}\]
How can we get confidence intervals for these estimates?
The specific form of the covariance isn’t important. What is important is that we can exactly evaluate the probability of \(y_{11}, y_{12},\dots, y_{an}\) under any choice of the parameters \(\mu, \sigma^2, \sigma^2_{\tau}\).
Define \(L(\mu, \sigma^2, \sigma^2_{\tau})\) to be the probability of the dataset \(y_{11}, y_{12}, \dots y_{an}\) viewed as a function of the normal distribution’s parameters. A good estimate for these parameters comes from finding the configuration that maximizes \(L\left(\mu, \sigma^2, \sigma^2_{\tau}\right)\). The maximizers can’t be found analytically, but algorithms exist to find the maximizers.
The lme4
package implements the maximum likelihood approach to random effects model estimation; this package is reviewed in the previous notes.
To estimate the method of moments, we can do all the calculations by hand – we just need the results from an ANOVA table.
MSE
quantities available in the ANOVA table. It also computes the intraclass correlation coefficient (ICC), which is defined in the reading.sigma_sqs <- vector(length = 2)
sigma_sqs[1] <- aov_table$meansq[2] # estimate for sigma^2
sigma_sqs[2] <- (aov_table$meansq[1] - aov_table$meansq[2]) / n # estimate for sigma^2_tau
sigma_sqs
[1] 1.895833 6.958333
sigma_sqs[2] / sum(sigma_sqs) # ICC
[1] 0.7858824
[1] 0.9748608 5.1660065
ratio_bounds <- 1 / n * (aov_table$statistic[1] / qf(int_bounds, a - 1, N - a) - 1)
ratio_bounds / (1 + ratio_bounds) # CI for ICC
[1] 0.3850736 0.9824420