% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
  pdftitle={Homework 09 Solutions},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[margin=1in]{geometry}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{framed}
\definecolor{shadecolor}{RGB}{248,248,248}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\BuiltInTok}[1]{#1}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\usepackage{amsmath}
\usepackage{amsthm}
\DeclareMathOperator{\Cov}{Cov}
\DeclareMathOperator{\Corr}{Corr}
\DeclareMathOperator{\Var}{Var}
\DeclareMathOperator{\upmodels}{\perp \!\!\! \perp}
\ifLuaTeX
  \usepackage{selnolig}  % disable illegal ligatures
\fi

\title{Homework 09 Solutions}
\author{}
\date{\vspace{-2.5em}11/10/2021}

\begin{document}
\maketitle

\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{library}\NormalTok{(knitr)}
\FunctionTok{library}\NormalTok{(pander)}
\FunctionTok{library}\NormalTok{(nlme)}
\FunctionTok{library}\NormalTok{(ggplot2)}
\FunctionTok{library}\NormalTok{(dplyr)}
\FunctionTok{library}\NormalTok{(scales)}
\end{Highlighting}
\end{Shaded}

\hypertarget{problem-1}{%
\section{Problem 1}\label{problem-1}}

\hypertarget{a}{%
\subsection{(a)}\label{a}}

We see in Figure \ref{f:1a_plot} that plotting the mean for each state
is helpful in summarizing the overall income level within each stage but
does not give an indication of the relationship between income and high
school graduation rates. Relative to the other plots Figure
\ref{f:1a_plot} is easy to interpret but is probably not the best way to
convey the information it is displaying.

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{dat }\OtherTok{\textless{}{-}} \FunctionTok{read.table}\NormalTok{(}\StringTok{"../cdi.dat"}\NormalTok{)}

\NormalTok{mean.df }\OtherTok{\textless{}{-}} \FunctionTok{group\_by}\NormalTok{(dat, state) }\SpecialCharTok{\%\textgreater{}\%}
    \FunctionTok{summarise}\NormalTok{(}\AttributeTok{per.cap.income =} \FunctionTok{mean}\NormalTok{(per.cap.income))}

\FunctionTok{ggplot}\NormalTok{(dat) }\SpecialCharTok{+}
    \FunctionTok{geom\_point}\NormalTok{(}\FunctionTok{aes}\NormalTok{(pct.hs.grad, per.cap.income)) }\SpecialCharTok{+}
    \FunctionTok{geom\_hline}\NormalTok{(}\AttributeTok{data =}\NormalTok{ mean.df, }\FunctionTok{aes}\NormalTok{(}\AttributeTok{yintercept =}\NormalTok{ per.cap.income),}\AttributeTok{col=}\StringTok{"blue"}\NormalTok{) }\SpecialCharTok{+}
    \FunctionTok{facet\_wrap}\NormalTok{(}\SpecialCharTok{\textasciitilde{}}\NormalTok{state) }\SpecialCharTok{+}
    \FunctionTok{scale\_y\_continuous}\NormalTok{(}\AttributeTok{label =}\NormalTok{ comma) }\SpecialCharTok{+}
    \FunctionTok{xlab}\NormalTok{(}\StringTok{"Percentage High School Graduates"}\NormalTok{) }\SpecialCharTok{+} \FunctionTok{ylab}\NormalTok{(}\StringTok{"Per Capitca Income ($)"}\NormalTok{) }\SpecialCharTok{+}
    \FunctionTok{theme\_bw}\NormalTok{()}
\end{Highlighting}
\end{Shaded}

\begin{figure}
\centering
\includegraphics{hw09_solutions_files/figure-latex/1a_plot-1.pdf}
\caption{Problem 1a: HS graduation rate vs.~county level per capita
income with state level mean per capita income line.\label{f:1a_plot}}
\end{figure}

\hypertarget{b}{%
\subsection{(b)}\label{b}}

Figure \ref{f:1b_plot} allows us to examine if the relationship between
high school graduation rate and income are similar to what is observed
at a national level but it is hard to see what the state level trends
are. Relative to the others plots Figure \ref{f:1b_plot} is best suited
the answering the question of ``Does state X look like nation as a
whole?'\,' instead of conveying state level results or tends.

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{fit }\OtherTok{\textless{}{-}} \FunctionTok{lm}\NormalTok{(per.cap.income }\SpecialCharTok{\textasciitilde{}}\NormalTok{ pct.hs.grad, }\AttributeTok{data =}\NormalTok{ dat)}
\FunctionTok{ggplot}\NormalTok{(dat, }\FunctionTok{aes}\NormalTok{(pct.hs.grad, per.cap.income)) }\SpecialCharTok{+}
    \FunctionTok{geom\_point}\NormalTok{() }\SpecialCharTok{+}
    \FunctionTok{geom\_abline}\NormalTok{(}\AttributeTok{intercept =}\NormalTok{ fit[[}\StringTok{"coefficients"}\NormalTok{]][}\DecValTok{1}\NormalTok{],}
                \AttributeTok{slope =}\NormalTok{ fit[[}\StringTok{"coefficients"}\NormalTok{]][}\DecValTok{2}\NormalTok{],}
                \AttributeTok{col=}\StringTok{"blue"}\NormalTok{) }\SpecialCharTok{+}
    \FunctionTok{facet\_wrap}\NormalTok{(}\SpecialCharTok{\textasciitilde{}}\NormalTok{state) }\SpecialCharTok{+}
    \FunctionTok{scale\_y\_continuous}\NormalTok{(}\AttributeTok{label =}\NormalTok{ comma) }\SpecialCharTok{+}
    \FunctionTok{xlab}\NormalTok{(}\StringTok{"Percentage High School Graduates"}\NormalTok{) }\SpecialCharTok{+} \FunctionTok{ylab}\NormalTok{(}\StringTok{"Per Capitca Income ($)"}\NormalTok{) }\SpecialCharTok{+}
    \FunctionTok{theme\_bw}\NormalTok{()}
\end{Highlighting}
\end{Shaded}

\begin{figure}
\centering
\includegraphics{hw09_solutions_files/figure-latex/1b_plot-1.pdf}
\caption{Problem 1b: HS graduation rate vs.~county level per capita
income with national level regression line.\label{f:1b_plot}}
\end{figure}

\hypertarget{c}{%
\subsection{(c)}\label{c}}

Figure \ref{f:1c_plot} allows us to examine if the relationship between
high school graduation rate and income are similar to what is observed
at a national level while adjusting for mean income in the state but
makes it harder to see how the overall state income level compares to
the nation as a whole. Relative to the others plots Figure
\ref{f:1b_plot} is best suited the answering the question of ``Does the
relationship between high gradation and income in state X look like
nation as a whole?'\,' but does not convey much about the mean income
level as done in Figure \ref{f:1a_plot} and Figure \ref{f:1b_plot}.

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{fit2 }\OtherTok{\textless{}{-}} \FunctionTok{lm}\NormalTok{(per.cap.income }\SpecialCharTok{\textasciitilde{}} \SpecialCharTok{{-}}\DecValTok{1} \SpecialCharTok{+}\NormalTok{ state }\SpecialCharTok{+}\NormalTok{ pct.hs.grad, }\AttributeTok{data =}\NormalTok{ dat)}
\NormalTok{slopes.df }\OtherTok{\textless{}{-}} \FunctionTok{data.frame}\NormalTok{(}\AttributeTok{state =} \FunctionTok{substr}\NormalTok{(}\FunctionTok{names}\NormalTok{(fit2[[}\StringTok{"coefficients"}\NormalTok{]][}\DecValTok{1}\SpecialCharTok{:}\DecValTok{48}\NormalTok{]), }\DecValTok{6}\NormalTok{, }\DecValTok{7}\NormalTok{),}
                       \AttributeTok{state.intercept =}\NormalTok{ fit2[[}\StringTok{"coefficients"}\NormalTok{]][}\DecValTok{1}\SpecialCharTok{:}\DecValTok{48}\NormalTok{],}
                       \AttributeTok{slope =}\NormalTok{ fit2[[}\StringTok{"coefficients"}\NormalTok{]][}\DecValTok{49}\NormalTok{])}

\FunctionTok{ggplot}\NormalTok{(dat, }\FunctionTok{aes}\NormalTok{(pct.hs.grad, per.cap.income)) }\SpecialCharTok{+}
    \FunctionTok{geom\_point}\NormalTok{() }\SpecialCharTok{+}
    \FunctionTok{geom\_abline}\NormalTok{(}\AttributeTok{data =}\NormalTok{ slopes.df, }\FunctionTok{aes}\NormalTok{(}\AttributeTok{intercept =}\NormalTok{ state.intercept, }\AttributeTok{slope =}\NormalTok{ slope), }
                \AttributeTok{col=}\StringTok{"blue"}\NormalTok{) }\SpecialCharTok{+}
    \FunctionTok{facet\_wrap}\NormalTok{(}\SpecialCharTok{\textasciitilde{}}\NormalTok{state) }\SpecialCharTok{+}
    \FunctionTok{scale\_y\_continuous}\NormalTok{(}\AttributeTok{label =}\NormalTok{ comma) }\SpecialCharTok{+}
    \FunctionTok{xlab}\NormalTok{(}\StringTok{"Percentage High School Graduates"}\NormalTok{) }\SpecialCharTok{+} \FunctionTok{ylab}\NormalTok{(}\StringTok{"Per Capitca Income ($)"}\NormalTok{) }\SpecialCharTok{+}
    \FunctionTok{theme\_bw}\NormalTok{()}
\end{Highlighting}
\end{Shaded}

\begin{figure}
\centering
\includegraphics{hw09_solutions_files/figure-latex/1c_plot-1.pdf}
\caption{Problem 1c: HS graduation rate vs.~county level per capita
income with state level intercept and national slope
line.\label{f:1c_plot}}
\end{figure}

\hypertarget{d}{%
\subsection{(d)}\label{d}}

We see in Figure \ref{f:1d_plot} that the state level regression lines
match the observed data, as closely as possible, but we are unable to
fit them for all states since some states contain only a single county.
In contrast to the other plots there is much greater variance in the
fitted regression lines perhaps better describing each state but Figure
\ref{f:1d_plot} fails to convey any country level trends.

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{state\_lm }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(df)\{}
\NormalTok{    mod }\OtherTok{\textless{}{-}} \FunctionTok{lm}\NormalTok{(per.cap.income }\SpecialCharTok{\textasciitilde{}}\NormalTok{ pct.hs.grad, }\AttributeTok{data =}\NormalTok{ df)}
    \FunctionTok{return}\NormalTok{(}\FunctionTok{data.frame}\NormalTok{(}\AttributeTok{intercept =}\NormalTok{ mod[[}\StringTok{"coefficients"}\NormalTok{]][}\DecValTok{1}\NormalTok{], }\AttributeTok{slope =}\NormalTok{ mod[[}\StringTok{"coefficients"}\NormalTok{]][}\DecValTok{2}\NormalTok{]))}
\NormalTok{\}}
\NormalTok{lm.df }\OtherTok{\textless{}{-}} \FunctionTok{group\_by}\NormalTok{(dat, state) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{do}\NormalTok{(., }\FunctionTok{state\_lm}\NormalTok{(.))}

\FunctionTok{ggplot}\NormalTok{(dat, }\FunctionTok{aes}\NormalTok{(pct.hs.grad, per.cap.income)) }\SpecialCharTok{+}
    \FunctionTok{geom\_point}\NormalTok{() }\SpecialCharTok{+}
    \FunctionTok{geom\_abline}\NormalTok{(}\AttributeTok{data =}\NormalTok{ lm.df, }\FunctionTok{aes}\NormalTok{(}\AttributeTok{intercept =}\NormalTok{ intercept, }\AttributeTok{slope =}\NormalTok{ slope),}
                \AttributeTok{col=}\StringTok{"blue"}\NormalTok{) }\SpecialCharTok{+}
    \FunctionTok{facet\_wrap}\NormalTok{(}\SpecialCharTok{\textasciitilde{}}\NormalTok{state) }\SpecialCharTok{+}
    \FunctionTok{scale\_y\_continuous}\NormalTok{(}\AttributeTok{label =}\NormalTok{ comma) }\SpecialCharTok{+}
    \FunctionTok{xlab}\NormalTok{(}\StringTok{"Percentage High School Graduates"}\NormalTok{) }\SpecialCharTok{+} \FunctionTok{ylab}\NormalTok{(}\StringTok{"Per Capitca Income ($)"}\NormalTok{) }\SpecialCharTok{+}
    \FunctionTok{theme\_bw}\NormalTok{()}
\end{Highlighting}
\end{Shaded}

\begin{figure}
\centering
\includegraphics{hw09_solutions_files/figure-latex/1d_plot-1.pdf}
\caption{Problem 1d: HS graduation rate vs.~county level per capita
income with state level regression line.\label{f:1d_plot}}
\end{figure}

\pagebreak

\hypertarget{problem-2}{%
\section{Problem 2}\label{problem-2}}

We need to assume throughout this problem that the errors \(\epsilon_i\)
are independent of the quantities \(\eta_j\). (Remember, \(\epsilon_i\)
represents the ``unexplainable variation''.) Also, since
\(\mathop{\mathrm{Cov}}(a,X) = \mathop{\mathrm{Var}}(a) = 0\) if \(a\)
is a constant and \(X\) is a random variable, we will omit the constant
\(\beta_0\) from all of the calculations below.

\hypertarget{a-1}{%
\subsection{(a)}\label{a-1}}

Since, for two random variables \(A, B\), we have that
\(\mathop{\mathrm{Corr}}(A, B) = 0 \iff \mathop{\mathrm{Cov}}(A, B) = 0\),
let's just focus on the covariance. We have: \begin{align}
  \mathop{\mathrm{Cov}}(y_i, y_{i'}) &= \mathop{\mathrm{Cov}}(\alpha_{j[i]} + \epsilon_i, \alpha_{j[i']} + \epsilon_{i'}) \\
  &= \mathop{\mathrm{Cov}}(\alpha_{j[i]}, \alpha_{j[i']}) + \mathop{\mathrm{Cov}}(\alpha_{j[i]}, \epsilon_{i'}) + \mathop{\mathrm{Cov}}(\epsilon_i, \alpha_{j[i']}) + \mathop{\mathrm{Cov}}(\epsilon_i, \epsilon_{i'}) \label{eq:1a}
\end{align}

Recall that if two random variables \(A\) and \(B\) are independent,
then \(f(A)\) and \(g(B)\) are independent for any functions \(f\) and
\(g\)\footnote{Any measurable functions $f$ and $g$, that is, but you don't really need to worry about this technicality.}.
Since \(\eta_{j[i]} \mathop{\mathrm{\perp \!\!\! \perp}}\eta_{j[i']}\),
and \(\beta_0\) is just a constant, it follows that
\(\alpha_{j[i]} \mathop{\mathrm{\perp \!\!\! \perp}}\alpha_{j[i']}\)

Furthermore, we have the errors \(\epsilon_i\) are independent of
everything, by assumption.

Hence each pair of variables in \eqref{eq:1a} is independent, so the
covariances are all 0.

\hypertarget{b-1}{%
\subsection{(b)}\label{b-1}}

Substituting \(j[i]\) for \(j[i']\) in \eqref{eq:1a}, we have
\begin{align}
  \mathop{\mathrm{Cov}}(y_i, y_{i'}) &= \mathop{\mathrm{Cov}}(\alpha_{j[i]}, \alpha_{j[i]}) + \mathop{\mathrm{Cov}}(\alpha_{j[i]}, \epsilon_{i'}) + \mathop{\mathrm{Cov}}(\epsilon_i, \alpha_{j[i]}) + \mathop{\mathrm{Cov}}(\epsilon_i, \epsilon_{i'}) \\
  &= \mathop{\mathrm{Var}}(\alpha_{j[i]}) + 0 + 0 + 0 \\
  &= \tau^2
\end{align} Now, \begin{align}
  \mathop{\mathrm{Corr}}(y_i, y_{i'}) &= \frac{\mathop{\mathrm{Cov}}(y_i, y_{i'})}{\sqrt{\sigma^2_{y_i}\sigma^2_{y_{i'}}}} \label{eq:1b}
\end{align} Writing the model in variance components form, we have
\(y_i = \beta_0 + \eta_{j[i]} + \epsilon_i\), which means
\(y_i \sim N(\beta_0, \sigma^2 + \tau^2)\) (since the sum of two
independent normally distributed random variables has variance equal to
the sum of the variances). Substituting this into \eqref{eq:1b} yields
\begin{align}
  \mathop{\mathrm{Corr}}(y_i, y_{i'}) &= \frac{\mathop{\mathrm{Cov}}(y_i, y_{i'})}{\sqrt{(\sigma^2 + \tau^2)(\sigma^2 + \tau^2)}} \\
  &= \frac{\tau^2}{\sigma^2 + \tau^2}
\end{align}

\hypertarget{c-1}{%
\subsection{(c)}\label{c-1}}

\begin{align}
  \frac{1}{n_j}\sum Y_i &= \frac{1}{n_j}[\sum\alpha_j + \sum \epsilon_i] \\
                        &= \alpha_j + \frac{1}{n_j}\sum\epsilon_i \\
          \implies \mathop{\mathrm{Var}}(\bar{y}_j) &= \mathop{\mathrm{Var}}(\alpha_j) + \frac{1}{n_j^2}\sum\mathop{\mathrm{Var}}(\epsilon_i) \\
          &= \tau^2 + \frac{\sigma^2}{n_j}
\end{align}

\hypertarget{d-1}{%
\subsection{(d)}\label{d-1}}

Notice that this is equivalent to sampling a group, sampling a bunch of
data points from that group, splitting those data points into two
sub-groups, and taking the means of each subgroup. We have:
\begin{align}
  \mathop{\mathrm{Cov}}(\bar{y}_j, \bar{y}_j^*) &= \mathop{\mathrm{Cov}}\left(\frac{1}{n_j}\sum_i y_i,  \frac{1}{n_j^*}\sum_k y_k^*\right) \\
  &= \frac{1}{n_j^2}\sum_i\sum_k\mathop{\mathrm{Cov}}(y_i, y_k^*) \\
  &= \frac{1}{n_j^2}n_j^2\tau^2 \\
  &= \tau^2
\end{align} where in line 2 we assumed that \(n_j^* = n_j\), and in line
3 we used that \(\mathop{\mathrm{Cov}}(y_i, y_k^*)\) is equivalent to
\(\mathop{\mathrm{Cov}}(y_i, y_{i'})\) from part (b) above. Now, using
the result from part (c), we have \begin{align}
  \mathop{\mathrm{Cov}}(\bar{y}_j, \bar{y}_j^*) &= \frac{\tau^2}{\sqrt{\sigma^2_{\bar{y}}\sigma^2_{\bar{y}^*}}} \\
  &= \frac{\tau^2}{\tau^2 + \sigma^2/n_j}
\end{align}

\end{document}
