# Supplementary Materials for “T2-DAG: a powerful test for differentially
expressed gene pathways via graph-informed structural equation modeling”

Jin Jin, Yue Wang

##  1 Proof of Theorems

In this proof, we consider the high-dimensional regime where
$(p,d,p_{0})\rightarrow\infty$ as $(n_{1},n_{2})\rightarrow\infty$. We begin
with some additional notations. For a $p$-dimensional random vector ${\bf
v}=\left(v_{1},\dots,v_{p}\right)^{\intercal}$, we define the following vector
norms,

$\|{\bf v}\|_{q}\mathrel{\mathop{\mathchar
58\relax}}=\left(\sum_{j=1}^{p}\left|v_{j}\right|^{q}\right)^{1/q}\mbox{ for
}0<q<\infty,\quad\|{\bf v}\|_{\infty}\mathrel{\mathop{\mathchar
58\relax}}=\max_{1\leq j\leq p}\left|v_{j}\right|.$

For a $p\times p$ matrix $M=(m_{jk})_{j,k=1,\ldots,p}$, we define

$\|M\|_{q}\mathrel{\mathop{\mathchar
58\relax}}=\max_{\|v\|_{q}=1}\|Mv\|_{q},\quad\|M\|_{\max}\mathrel{\mathop{\mathchar
58\relax}}=\max_{(j,k)}\left|m_{jk}\right|,\quad\|M\|_{\mathrm{F}}\mathrel{\mathop{\mathchar
58\relax}}=\left(\sum_{j,k}\left|m_{jk}\right|^{2}\right)^{1/2},$

for $0<q<\infty$. We use $I_{p}$ to denote a $p\times p$ identity matrix. For
any index set $S\subseteq\\{1,\ldots,p\\}$, let ${\bf v}_{S}$ denote the
subvector of $\bf v$ with entries indexed by $S$. Similarly, $M_{S,S}$ denotes
the submatrix of $M$ with rows and columns indexed by $S$.

We first cite the following result (Theorem 6.1, Wainwright, 2019).

######  Lemma 1.1.

Let ${\bf x}_{1},\ldots,{\bf x}_{n}$ be $p\times 1$ random vectors drawn i.i.d
from a multivariate normal distribution with mean $\bf 0$ and covariance
$\Sigma$, and ${X}=[{\bf x}_{1}~{}\cdots~{}{\bf x}_{n}]^{\intercal}$. Let
$\sigma_{\max}({X}),\sigma_{\min}({X})$, $\gamma_{\max}(\Sigma)$ and
$\gamma_{\min}(\Sigma)$, respectively, denote the largest and smallest
singular value of $X$ and the largest and smallest eigenvalue of $\Sigma$. For
all $\delta>0$, we then have

$\mathbb{P}\left[\frac{\sigma_{\max}(X)}{\sqrt{n}}\geq\sqrt{\gamma_{\max}(\Sigma)}(1+\delta)+\sqrt{\frac{\operatorname{tr}(\Sigma)}{n}}\right]\leq
e^{-n\delta^{2}/2},$ (1)

and

$\mathbb{P}\left[\frac{\sigma_{\min}(X)}{\sqrt{n}}\leq\sqrt{\gamma_{\min}(\Sigma)}(1-\delta)-\sqrt{\frac{\operatorname{tr}(\Sigma)}{n}}\right]\leq
e^{-n\delta^{2}/2}.$ (2)

Recall that $S_{j}=\\{i\mathrel{\mathop{\mathchar 58\relax}}a_{ij}=1\\}$,
where $a_{ij}$ is the $(i,j)$-th entry of the adjacency matrix $A$, and

$\widehat{\Sigma}=(n_{1}+n_{2})^{-1}\left(\sum_{k=1}^{n_{1}}({\bf
x}^{(1)}_{k}-\overline{\bf x}^{(1)})^{\otimes 2}+\sum_{k=1}^{n_{2}}({\bf
x}^{(2)}_{k}-\overline{\bf x}^{(2)})^{\otimes 2}\right),$

where for any vector $\bf a$, ${\bf a}^{\otimes 2}={\bf aa}^{\intercal}$.

The next result bounds the spectral norm distance between
$\widehat{\Sigma}_{S_{j},S_{j}}$ and $\Sigma_{S_{j},S_{j}}$ for all
$j\in\mathcal{J}$, where $\mathcal{J}=\\{j\mathrel{\mathop{\mathchar
58\relax}}|S_{j}|>0\\}$.

######  Lemma 1.2.

As $n_{1},n_{2}\rightarrow\infty$, we have

$\displaystyle\max_{j\in\mathcal{J}}\frac{\|\Sigma_{S_{j},S_{j}}^{-1/2}\widehat{\Sigma}_{S_{j},S_{j}}\Sigma_{S_{j},S_{j}}^{-1/2}-I_{|S_{j}|}\|_{2}}{|S_{j}|}=O_{p}\left(\frac{\log
p_{0}}{n_{1}+n_{2}}\right).$ (3)

Furthermore, if $d\log p_{0}=o(n_{1}+n_{2})$, then

$\displaystyle\max_{j\in\mathcal{J}}\frac{\|\Sigma_{S_{j},S_{j}}^{1/2}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}\Sigma_{S_{j},S_{j}}^{1/2}-I_{|S_{j}|}\|_{2}}{|S_{j}|}=O_{p}\left(\frac{\log
p_{0}}{n_{1}+n_{2}}\right).$ (4)

###### Proof of Lemma 1.2.

Recalling that

${\bf z}_{i}=\begin{cases}{\bf
x}^{(1)}_{k}-{\mbox{\boldmath${\mu}$}}_{1}&k=1,2,\ldots,n_{1}\\\ {\bf
x}^{(2)}_{k-n_{1}}-{\mbox{\boldmath${\mu}$}}_{2}&k=n_{1}+1,\ldots,n_{1}+n_{2}\end{cases},$

we write

$\displaystyle\widehat{\Sigma}=$
$\displaystyle~{}\frac{1}{n_{1}+n_{2}}\sum_{k=1}^{n_{1}+n_{2}}{\bf
z}_{k}^{\otimes 2}+\frac{n_{1}}{n_{1}+n_{2}}(\overline{\bf
x}^{(1)}-{\mbox{\boldmath${\mu}$}}_{1})^{\otimes
2}+\frac{n_{2}}{n_{1}+n_{2}}(\overline{\bf
x}^{(2)}-{\mbox{\boldmath${\mu}$}}_{2})^{\otimes 2}.$

Letting ${\bf w}_{k}=\Sigma^{-1/2}{\bf z}_{k}$, it is easy to check that ${\bf
w}_{k}\stackrel{{\scriptstyle i.i.d}}{{\sim}}N(0,{I}_{p})$. Thus, we have

$\displaystyle\left\|\Sigma_{S_{j},S_{j}}^{-1/2}\widehat{\Sigma}_{S_{j},S_{j}}\Sigma_{S_{j},S_{j}}^{-1/2}-I_{|S_{j}|}\right\|_{2}\leq\left\|\frac{1}{n_{1}+n_{2}}\sum_{k=1}^{n_{1}+n_{2}}({\bf
w}_{k}^{\otimes 2})_{S_{j},S_{j}}-{I}_{|S_{j}|}\right\|_{2}$ $\displaystyle+$
$\displaystyle~{}\frac{n_{1}}{n_{1}+n_{2}}\left\|\Sigma_{S_{j},S_{j}}^{-1/2}(\overline{\bf
x}^{(1)}-{\mbox{\boldmath${\mu}$}}_{1})_{S_{j}}\right\|_{2}^{2}+\frac{n_{2}}{n_{1}+n_{2}}\left\|\Sigma_{S_{j},S_{j}}^{-1/2}(\overline{\bf
x}^{(2)}-{\mbox{\boldmath${\mu}$}}_{2})_{S_{j}}\right\|_{2}^{2}.$

Using Lemma 1.1, we know for all $\delta>0$,

$\displaystyle\mathbb{P}\left\\{\sqrt{\gamma_{\max}\left(\frac{1}{n_{1}+n_{2}}\sum_{k=1}^{n_{1}+n_{2}}({\bf
w}_{k}^{\otimes 2})_{S_{j},S_{j}}\right)}\geq
1+\delta+\sqrt{\frac{|S_{j}|}{n_{1}+n_{2}}}\right\\}\leq
e^{-\frac{(n_{1}+n_{2})\delta^{2}}{2}}$

and

$\displaystyle\mathbb{P}\left\\{\sqrt{\gamma_{\min}\left(\frac{1}{n_{1}+n_{2}}\sum_{k=1}^{n_{1}+n_{2}}({\bf
w}_{k}^{\otimes 2})_{S_{j},S_{j}}\right)}\leq
1-\delta-\sqrt{\frac{|S_{j}|}{n_{1}+n_{2}}}\right\\}\leq
e^{-\frac{(n_{1}+n_{2})\delta^{2}}{2}}.$

These together yield

$\displaystyle\mathbb{P}\left\\{\left\|\frac{1}{n_{1}+n_{2}}\sum_{k=1}^{n_{1}+n_{2}}({\bf
w}_{k}^{\otimes
2})_{S_{j},S_{j}}-{I}_{|S_{j}|}\right\|_{2}\geq\left(\delta+\sqrt{\frac{|S_{j}|}{n_{1}+n_{2}}}\right)^{2}\right\\}\leq
e^{-\frac{(n_{1}+n_{2})\delta^{2}}{2}}.$

By taking $\delta=\sqrt{4|S_{j}|\log p_{0}/({n_{1}+n_{2}})}$, we have

$\mathbb{P}\left\\{|S_{j}|^{-1}\left\|\frac{1}{n_{1}+n_{2}}\sum_{k=1}^{n_{1}+n_{2}}({\bf
w}_{k}^{\otimes
2})_{S_{j},S_{j}}-{I}_{|S_{j}|}\right\|_{2}\geq\frac{1}{n_{1}+n_{2}}\left(\sqrt{2\log
p_{0}}+1\right)^{2}\right\\}\leq{p_{0}}^{-2|S_{j}|}.$

Taking the union over $j\in\mathcal{J}$, we have

$\displaystyle\mathbb{P}\left\\{\max_{j\in\mathcal{J}}\left\\{|S_{j}|^{-1}\left\|\frac{1}{n_{1}+n_{2}}\sum_{k=1}^{n_{1}+n_{2}}({\bf
w}_{k}^{\otimes
2})_{S_{j},S_{j}}-{I}_{|S_{j}|}\right\|_{2}\right\\}\geq\frac{1}{n_{1}+n_{2}}\left(\sqrt{2\log
p_{0}}+1\right)^{2}\right\\}$
$\displaystyle\leq\sum_{j\in\mathcal{J}}p_{0}^{-2|S_{j}|}\leq p_{0}^{-1},$

which goes to $0$ as $n_{1},n_{2}\rightarrow\infty$. This indicates that as
$n_{1},n_{2}\rightarrow\infty$, we have

$\max_{j\in\mathcal{J}}|S_{j}|^{-1}\left\|\left(\frac{1}{n_{1}+n_{2}}\sum_{k=1}^{n_{1}+n_{2}}{\bf
w}_{k}^{\otimes
2}-{I}_{p}\right)_{S_{j},S_{j}}\right\|_{2}=O_{p}\left(\frac{\log
p_{0}}{n_{1}+n_{2}}\right).$

Also,

$\displaystyle\frac{n_{1}}{n_{1}+n_{2}}\left\|\Sigma_{S_{j},S_{j}}^{-1/2}(\overline{\bf
x}^{(1)}-{\mbox{\boldmath${\mu}$}}_{1})_{S_{j}}\right\|_{2}^{2}=\frac{n_{1}}{n_{1}+n_{2}}\left\|n_{1}^{-1}\sum_{k=1}^{n_{1}}({\bf
w}_{k})_{S_{j}}\right\|_{2}^{2}.$

Note that $\left\|n_{1}^{-1/2}\sum_{k=1}^{n_{1}}({\bf
w}_{k})_{S_{j}}\right\|_{2}^{2}\sim\chi^{2}_{|S_{j}|}$, therefore by using the
standard tail bound for $\chi^{2}$ variables, we can get

$\displaystyle\mathbb{P}\left\\{\left|\|n_{1}^{-1/2}\sum_{k=1}^{n_{1}}({\bf
w}_{k})_{S_{j}}\|_{2}^{2}-|S_{j}|\right|>|S_{j}|n_{1}t\right\\}\leq
2e^{-|S_{j}|n_{1}t/8}\leq 2e^{-n_{1}t/8},~{}\mbox{for
all}~{}t>\frac{1}{n_{1}}.$

Hence, taking the union over $j\in\mathcal{J}$ gives

$\displaystyle\mathbb{P}\left\\{\max_{j\in\mathcal{J}}\left|\|n_{1}^{-1/2}|S_{j}|^{-1}\sum_{k=1}^{n_{1}}({\bf
w}_{k})_{S_{j}}\|_{2}^{2}-1\right|>n_{1}t\right\\}\leq
e^{\log(2p_{0})-n_{1}t/8},~{}\mbox{for all}~{}t>\frac{1}{n_{1}}.$

By taking $t=16\log(2p_{0})/n_{1}>n_{1}^{-1}$, we get

$\displaystyle\mathbb{P}\left\\{\max_{j\in\mathcal{J}}\left||S_{j}|^{-1}\|n_{1}^{-1/2}\sum_{k=1}^{n_{1}}({\bf
w}_{k})_{S_{j}}\|_{2}^{2}-1\right|>16\log(2p_{0})\right\\}\leq(2p_{0})^{-1}.$

This indicates that

$\frac{n_{1}}{n_{1}+n_{2}}\max_{j\in\mathcal{J}}|S_{j}|^{-1}\left\|n_{1}^{-1}\sum_{k=1}^{n_{1}}({\bf
w}_{k})_{S_{j}}\right\|_{2}^{2}=O_{p}\left(\frac{\log
p_{0}}{n_{1}+n_{2}}\right).$

Similarly, we can show that

$\displaystyle\frac{n_{2}}{n_{1}+n_{2}}\left\|\Sigma_{S_{j},S_{j}}^{-1/2}(\overline{\bf
x}^{(2)}-{\mbox{\boldmath${\mu}$}}_{2})_{S_{j}}\right\|_{2}^{2}=O_{p}\left(\frac{\log
p_{0}}{n_{1}+n_{2}}\right).$ (5)

This completes the proof of (3) in Lemma 1.2. To show (4) in Lemma 1.2, we
only need to note that

$\|\Sigma_{S_{j},S_{j}}^{1/2}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}\Sigma_{S_{j},S_{j}}^{1/2}-I_{|S_{j}|}\|_{2}\leq\frac{\|\Sigma_{S_{j},S_{j}}^{-1/2}\widehat{\Sigma}_{S_{j},S_{j}}\Sigma_{S_{j},S_{j}}^{-1/2}-I_{|S_{j}|}\|_{2}}{1-\|\Sigma_{S_{j},S_{j}}^{-1/2}\widehat{\Sigma}_{S_{j},S_{j}}\Sigma_{S_{j},S_{j}}^{-1/2}-I_{|S_{j}|}\|_{2}};$

here, we use the matrix variant of Taylor expansion. It follows from (3) that
if $d\log p_{0}=o(n_{1}+n_{2})$, we then have
$\|\Sigma_{S_{j},S_{j}}^{1/2}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}\Sigma_{S_{j},S_{j}}^{1/2}-I_{|S_{j}|}\|_{2}=O(\|\Sigma_{S_{j},S_{j}}^{-1/2}\widehat{\Sigma}_{S_{j},S_{j}}\Sigma_{S_{j},S_{j}}^{-1/2}-I_{|S_{j}|}\|_{2})$.
This yields (4). ∎

For any set $E$, let $A_{E}=\\{{\bf x}^{(l)}_{i,E}\mathrel{\mathop{\mathchar
58\relax}}l=1,2;i=1,\ldots,n_{l}\\}$. The following lemma characterizes the
properties of $\widehat{Q}$ and $\widehat{R}$.

######  Lemma 1.3.

Under Assumptions 1-3, for $j\in\mathcal{J}$ and any arbitrary set $E$ that
satisfies $S_{j}\subseteq E\subseteq\\{1,\ldots,j-1\\}$, we have

  1. (1)

Conditioned on $A_{E}$, $\widehat{\bf q}_{j,S_{j}}\mathchoice{\mathrel{\hbox
to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}\widehat{r}_{j}$ and $(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf
e}_{j}\mathchoice{\mathrel{\hbox to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}\widehat{r}_{j}$, where ${\bf
e}_{j}\in\mathbb{R}^{p}$ denotes the vector where the $j$-th entry equals 1
and 0 elsewhere.

  2. (2a)

Conditioned on $A_{E}$, $\widehat{\bf q}_{j,S_{j}}$ follows a multivariate
normal distribution with mean ${\bf q}_{j,S_{j}}$ and covariance
${r_{j}}(n_{1}+n_{2})^{-1}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}$.

  3. (2b)

Conditioned on $A_{E}$, $\widehat{\bf q}_{j,S_{j}}\mathchoice{\mathrel{\hbox
to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}{\bf e}_{j}$.

  4. (2c)

For $k<j$, we have

$\mathbb{E}\left[(\widehat{\bf q}_{j,S_{j}}-{\bf q}_{j,S_{j}})(\widehat{\bf
q}_{k,S_{k}}-{\bf q}_{k,S_{k}})^{\intercal}\mid A_{S_{j}\cup
S_{k}\cup\\{k\\}}\right]=0_{|S_{j}|\times|S_{k}|}.$

  5. (3a)

For $j=1,\ldots,p$, we have $\mathbb{E}\left[\widehat{r}_{j}^{-1}\mid
A_{E}\right]={r}_{j}^{-1}$ and $\mbox{Var}[\widehat{r}_{j}^{-1}\mid
A_{E}]={r_{j}^{-2}(n_{1}+n_{2}-|S_{j}|-6)^{-1}}$.

  6. (3b)

For $k<j$,

$\mathbb{E}\left[(\widehat{r}_{j}^{-1}-r_{j}^{-1})(\widehat{r}_{k}^{-1}-r_{k}^{-1})\mid
A_{S_{j}\cup S_{k}\cup\\{k\\}}\right]=0.$

###### Proof.

We first recall some notations. We denote by ${\bf 1}_{n_{1}+n_{2}}$ the
$(n_{1}+n_{2})$-dimensional vector of all ones and let ${\bf
g}=(g_{1},\ldots,g_{n_{1}+n_{2}})^{\intercal}$ denote the group indicator;
that is, $g_{i}$ equals 1 for $i=1,\ldots,n_{1}$ and equals 0 for
$i=n_{1}+1,\ldots,n_{1}+n_{2}$. Then, letting $X=\left[{\bf
x}_{1}^{(1)}~{}\cdots~{}{\bf x}_{n_{1}}^{(1)}~{}{\bf
x}_{1}^{(2)}~{}\cdots~{}{\bf x}_{n_{2}}^{(2)}\right]^{\intercal}$, we consider

$\left\|X_{j}-\theta_{1j}{\bf 1}_{n_{1}+n_{2}}-\theta_{2j}{\bf
g}-X_{S_{j}}{\bf q}_{j,S_{j}}\right\|_{2}^{2}.$ (6)

Here, $X_{j}$ denotes the $j$-th column of $X$; $X_{S_{j}}$ denotes the sub-
matrix of $X$ with columns indexed by $S_{j}$; ${\bf q}_{j,S_{j}}$ denotes the
sub-vector of ${\bf q}_{j}$ with entries indexed by $S_{j}$. Thus, letting
$W=[{\bf 1}_{n_{1}+n_{2}}~{}{\bf g}]$, we obtain the OLS estimator of ${\bf
q}_{j,S_{j}}$ and $(\theta_{1j},\theta_{2j})^{\intercal}$:

$\displaystyle\widehat{\bf q}_{j,S_{j}}=$
$\displaystyle~{}\left(X_{S_{j}}^{\intercal}(I_{n_{1}+n_{2}}-\mathcal{P}_{W})X_{S_{j}}\right)^{-1}X_{S_{j}}^{\intercal}(I_{n_{1}+n_{2}}-\mathcal{P}_{W})X_{j},$
$\displaystyle(\widehat{\theta}_{1j},\widehat{\theta}_{2j})^{\intercal}=$
$\displaystyle~{}(W^{\intercal}W)^{-1}W^{\intercal}\left(X_{j}-X_{S_{j}}\widehat{\bf
q}_{j,S_{j}}\right),$ (7)

where $\mathcal{P}_{W}=W(W^{\intercal}W)^{-1}W^{\intercal}$ is the orthogonal
projection matrix onto the column space of $W$. Then, the “plug-in" estimator
of $r_{j}$ is

$\widehat{r}_{j}=\frac{1}{n_{1}+n_{2}-|S_{j}|-4}\left\|X_{j}-\widehat{\theta}_{1j}{\bf
1}_{n_{1}+n_{2}}-\widehat{\theta}_{2j}{\bf g}-X_{S_{j}}\widehat{\bf
q}_{j,S_{j}}\right\|_{2}^{2};$

for shorthand notation, let
$\hat{{\mbox{\boldmath${\varepsilon}$}}}_{j}=X_{j}-\widehat{\theta}_{1j}{\bf
1}_{n_{1}+n_{2}}-\widehat{\theta}_{2j}{\bf g}-X_{S_{j}}\widehat{\bf
q}_{j,S_{j}}$.

  * (1)

Note that under Gaussianity, conditioned on the predictors, the OLS
coefficient estimator is independent of the OLS variance estimator (note that
the group indicator $g_{i}$ is a fixed quantity). Thus, $\widehat{\bf
q}_{j,S_{j}}\mathchoice{\mathrel{\hbox to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}\widehat{r}_{j}$ given $A_{S_{j}}$. We next
prove $(\overline{\bf x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf
e}_{j}=\left(\overline{x}^{(1)}_{j}-\overline{x}^{(2)}_{j}\right)\mathchoice{\mathrel{\hbox
to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}\widehat{r}_{j}$ given $A_{S_{j}}$. Under
Gaussianity, we only need to show

$\mbox{Cov}\left(\widehat{{\mbox{\boldmath${\varepsilon}$}}}_{j},\overline{x}_{j}^{(l)}\mid
A_{S_{j}}\right)={\bf 0},~{}~{}l=1,2.$

We first consider $l=1$. By (6), we get

$\hat{{\mbox{\boldmath${\varepsilon}$}}}_{j}=\left\\{I_{n_{1}+n_{2}}-\mathcal{P}_{W}(I_{n_{1}+n_{2}}-X_{S_{j}}F)-X_{S_{j}}F\right\\}X_{j},$

where
$F=\left(X_{S_{j}}^{\intercal}(I_{n_{1}+n_{2}}-\mathcal{P}_{W})X_{S_{j}}\right)^{-1}X_{S_{j}}^{\intercal}(I_{n_{1}+n_{2}}-\mathcal{P}_{W})$.
Then, since $\overline{x}^{(l)}_{j}=n_{1}^{-1}{\bf g}^{\intercal}X_{j}$, we
have

$\mbox{Cov}\left(\widehat{{\mbox{\boldmath${\varepsilon}$}}}_{j},\overline{x}_{j}^{(1)}\mid
A_{S_{j}}\right)=n_{1}^{-1}\left\\{I_{n_{1}+n_{2}}-\mathcal{P}_{W}(I_{n_{1}+n_{2}}-X_{S_{j}}F)-X_{S_{j}}F\right\\}\mbox{Cov}\left(X_{j}\mid
A_{S_{j}}\right){\bf g}.$

Note that $X_{j}-\theta_{1j}{\bf 1}_{n_{1}+n_{2}}-\theta_{2j}{\bf
g}-X_{S_{j}}{\bf q}_{j,S_{j}}=\widetilde{{\mbox{\boldmath${\epsilon}$}}}_{j}$,
where
$\widetilde{{\mbox{\boldmath${\epsilon}$}}}_{j}=(\epsilon_{1j},\ldots,\epsilon_{n_{1}+n_{2},j})^{\intercal}$.
Thus,

$\mbox{Cov}\left(X_{j}\mid
A_{S_{j}}\right)=\mbox{Cov}(\widetilde{{\mbox{\boldmath${\epsilon}$}}}_{j})=r_{j}I_{n_{1}+n_{2}}.$
(8)

This leads to

$\mbox{Cov}\left(\widehat{{\mbox{\boldmath${\varepsilon}$}}}_{j},\overline{x}_{j}^{(1)}\mid
A_{S_{j}}\right)=n_{1}^{-1}r_{j}\left\\{I_{n_{1}+n_{2}}-\mathcal{P}_{W}(I_{n_{1}+n_{2}}-X_{S_{j}}F)-X_{S_{j}}F\right\\}{\bf
g}={\bf 0},$

because $\mathcal{P}_{W}{\bf g}={\bf g}$. For $l=2$, we notice
$\overline{x}_{j}^{(2)}=n_{2}^{-1}({\bf 1}_{n_{1}+n_{2}}-{\bf
g})^{\intercal}X_{j}$. Using similar tricks, we get

$\mbox{Cov}\left(\widehat{{\mbox{\boldmath${\varepsilon}$}}}_{j},\overline{x}_{j}^{(2)}\mid
A_{S_{j}}\right)=n_{2}^{-1}r_{j}\left\\{I_{n_{1}+n_{2}}-\mathcal{P}_{W}(I_{n_{1}+n_{2}}-X_{S_{j}}F)-X_{S_{j}}F\right\\}({\bf
1}_{n_{1}+n_{2}}-{\bf g})={\bf 0},$

because $\mathcal{P}_{W}({\bf 1}_{n_{1}+n_{2}}-{\bf g})={\bf
1}_{n_{1}+n_{2}}-{\bf g}$. Therefore, we have
$\widehat{\varepsilon}_{j}\mathchoice{\mathrel{\hbox
to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}\overline{x}_{j}^{(1)}-\overline{x}_{j}^{(2)}$
given $A_{S_{j}}$.

To generalize this result to any arbitrary set $E$ that satisfies
$S_{j}\subseteq E\subseteq\\{1,\ldots,j-1\\}$, we note that after conditioning
on $\\{{\bf x}^{(l)}_{i,S_{j}}\mathrel{\mathop{\mathchar
58\relax}}l=1,2;i=1,\ldots,n_{l}\\}$, the only random variable in
$\widehat{r}_{j}$ is $\\{\epsilon_{ij},i=1,\ldots,n_{1}+n_{2}\\}$. Since
$\epsilon_{ij}\mathchoice{\mathrel{\hbox
to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}y_{il}$ for all $l<j$ and
$i=1,\ldots,n_{1}+n_{2}$, we have

$\left(\widehat{\bf
q}_{j,S_{j}},\widehat{r}_{j},\overline{x}^{(1)}_{j}-\overline{x}^{(2)}_{j}\right)\mid
A_{E}\stackrel{{\scriptstyle d}}{{=}}\left(\widehat{\bf
q}_{j,S_{j}},\widehat{r}_{j},\overline{x}^{(1)}_{j}-\overline{x}^{(2)}_{j}\right)\mid
A_{S_{j}}$

for any $S_{j}\subseteq E\subseteq\\{1,2,\ldots,j-1\\}$. This completes the
proof.

  * (2a)

By (6) and (8), we immediately know that

$\widehat{\bf q}_{j,S_{j}}\mid A_{E}\sim N\left({\bf
q}_{j,S_{j}},r_{j}FF^{\intercal}\right).$

We next find the explicit form of $FF^{\intercal}$. Note that

$FF^{\intercal}=\left(X_{S_{j}}^{\intercal}(I_{n_{1}+n_{2}}-\mathcal{P}_{W})X_{S_{j}}\right)^{-1}.$

Also,

$\mathcal{P}_{W}=W(W^{\intercal}W)^{-1}W^{\intercal}=\frac{1}{n_{1}n_{2}}W\begin{bmatrix}n_{1}&-n_{1}\\\
-n_{1}&n_{1}+n_{2}\end{bmatrix}W^{\intercal}=\frac{1}{n_{2}}({\bf
1}_{n_{1}+n_{2}}-{\bf g})({\bf 1}_{n_{1}+n_{2}}-{\bf
g})^{\intercal}+\frac{1}{n_{1}}{\bf gg}^{\intercal}.$

Note that

$\frac{1}{n_{2}}X_{S_{j}}^{\intercal}({\bf 1}_{n_{1}+n_{2}}-{\bf
g})=\overline{\bf
x}^{(2)}_{S_{j}},~{}~{}~{}\frac{1}{n_{1}}X_{S_{j}}^{\intercal}{\bf
g}=\overline{\bf x}^{(1)}_{S_{j}},$

Then, we have

$X_{S_{j}}^{\intercal}(I_{n_{1}+n_{2}}-\mathcal{P}_{W})X_{S_{j}}=\sum_{l=1}^{2}\sum_{i=1}^{n_{l}}({\bf
x}_{i,S_{j}}^{(l)}-\overline{\bf x}^{(l)}_{S_{j}})({\bf
x}_{i,S_{j}}^{(l)}-\overline{\bf
x}^{(l)}_{S_{j}})^{\intercal}=(n_{1}+n_{2})\widehat{\Sigma}_{S_{j},S_{j}}.$

Here, $\overline{\bf x}_{S_{j}}^{(l)}$ and ${\bf x}_{i,S_{j}}^{(l)}$,
respectively, denote the sub-vector of $\overline{\bf x}^{(l)}$ and ${\bf
x}_{i}^{(l)}$ with entries indexed by $S_{j}$. This completes the proof.

  * (2b)

Under Gaussianity, we only need to show that

$\mbox{Cov}\left(\widehat{\bf q}_{j,S_{j}},\overline{x}_{j}^{(l)}\mid
A_{E}\right)={\bf 0}~{}~{}~{}\mbox{ for }l=1,2.$

Using similar tricks to (1), we have

$\mbox{Cov}\left(\widehat{\bf q}_{j,S_{j}},\overline{x}_{j}^{(1)}\mid
A_{E}\right)=r_{j}F{\bf g}={\bf 0},~{}~{}~{}\mbox{Cov}\left(\widehat{\bf
q}_{j,S_{j}},\overline{x}_{j}^{(2)}\mid A_{E}\right)=r_{j}F({\bf
1}_{n_{1}+n_{2}}-{\bf g})={\bf 0}.$

This completes the proof.

  * (2c)

Since $Q$ is strictly upper triangular, thus $j\notin S_{k}$ but possibly
$k\in S_{j}$. Then, conditioned on $A_{S_{j}\cup S_{k}\cup\\{k\\}}$,
$\widehat{\bf q}_{k,S_{k}}$ becomes a fixed quantity; however, since $k<j$ and
$S_{j}\subseteq S_{j}\cup S_{k}\cup\\{k\\}\subseteq\\{1,\ldots,j-1\\}$, it
follows from 2(a) that $\widehat{\bf q}_{j,S_{j}}$ follows a multivariate
normal distribution with mean ${\bf q}_{j,S_{j}}$ and covariance
$r_{j}(n_{1}+n_{2})^{-1}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}$.

Therefore,

$\mathbb{E}\left[(\widehat{\bf q}_{j,S_{j}}-{\bf q}_{j,S_{j}})(\widehat{\bf
q}_{k,S_{k}}-{\bf q}_{k,S_{k}})^{\intercal}\mid A_{S_{j}\cup
S_{k}\cup\\{k\\}}\right]={\bf 0}\times(\widehat{\bf q}_{k,S_{k}}-{\bf
q}_{k,S_{k}})^{\intercal}={\bf 0},$

which completes the proof.

  * (3a)

Using the properties of the OLS variance estimator, conditioned on $A_{E}$, we
have
$(n_{1}+n_{2}-|S_{j}|-4)\widehat{r}_{j}r_{j}^{-1}\sim\chi^{2}_{n_{1}+n_{2}-2-|S_{j}|}$.
This indicates that conditioned on $A_{E}$,
$(n_{1}+n_{2}-|S_{j}|-4)^{-1}\widehat{r}_{j}^{-1}r_{j}$ follows an inverse
chi-square distribution with the degree of freedom $n_{1}+n_{2}-2-|S_{j}|$.
Then, we know that
$\mathbb{E}\left[(n_{1}+n_{2}-|S_{j}|-4)^{-1}\widehat{r}_{j}^{-1}r_{j}\mid
A_{E}\right]=(n_{1}+n_{2}-|S_{j}|-4)^{-1}$ and
$\mbox{Var}\left[(n_{1}+n_{2}-|S_{j}|-4)^{-1}\widehat{r}_{j}^{-1}r_{j}\mid
A_{E}\right]=(n_{1}+n_{2}-|S_{j}|-4)^{-2}(n_{1}+n_{2}-|S_{j}|-6)^{-1}$.

This leads to

$\mathbb{E}\left(\widehat{r}_{j}^{-1}\mid
A_{E}\right)={r}_{j}^{-1},~{}~{}~{}\mbox{Var}\left(\widehat{r}_{j}^{-1}\mid
A_{E}\right)={r_{j}^{-2}(n_{1}+n_{2}-|S_{j}|-6)^{-1}},$

which completes the proof.

  * (3b)

Using similar arguments to (2c), we have for $k<j$,

$\mathbb{E}\left[(\widehat{r}_{j}^{-1}-r_{j}^{-1})(\widehat{r}_{k}^{-1}-r_{k}^{-1})\mid
A_{S_{j}\cup
S_{k}\cup\\{k\\}}\right]=\mathbb{E}\left[\widehat{r}_{j}^{-1}-r_{j}^{-1}\mid
A_{S_{j}\cup
S_{k}\cup\\{k\\}}\right]\times(\widehat{r}_{k}^{-1}-r_{k}^{-1})=0,$

which completes the proof.

∎

With all the lemmas, we next prove Theorem 1.

###### Proof of Theorem 1.

Recall that $N=n_{1}n_{2}/(n_{1}+n_{2})$ and $A_{E}=\\{{\bf
x}^{(l)}_{i,E}\mathrel{\mathop{\mathchar 58\relax}}l=1,2;i=1,\ldots,n_{l}\\}$
for any set $E\subset\\{1,\ldots,p\\}$. We write

$\displaystyle T^{2}(\widehat{Q},\widehat{R})=$
$\displaystyle~{}N(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}\Sigma^{-1}(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})$ $\displaystyle+$ $\displaystyle~{}N(\overline{\bf
x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}\left\\{\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}\right\\}(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})$ $\displaystyle=$
$\displaystyle~{}J_{1}+J_{2}.$ (9)

It is easy to check that
$J_{1}\mathrel{\stackrel{{\scriptstyle\makebox[0.0pt]{\mbox{\tiny$H_{0}$}}}}{{\sim}}}\chi^{2}_{p}$.
Next, we provide an asymptotic bound for $J_{2}$. We first write

$\displaystyle J_{2}=$
$\displaystyle~{}N\left\\{\sum_{j\in\mathcal{J}}\widehat{r_{j}}^{-1}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}({\bf e}_{j}-\widehat{\bf
q}_{j})\\}^{2}-\sum_{j\in\mathcal{J}}{r_{j}}^{-1}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}({\bf e}_{j}-{\bf
q}_{j})\\}^{2}\right\\}$ $\displaystyle+$
$\displaystyle~{}N\left\\{\sum_{j\notin\mathcal{J}}\widehat{r_{j}}^{-1}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf
e}_{j}\\}^{2}-\sum_{j\notin\mathcal{J}}{r_{j}}^{-1}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf e}_{j}\\}^{2}\right\\}$
$\displaystyle=$ $\displaystyle~{}J_{21}+J_{22}.$ (10)

For $J_{22}$, based on Lemma 1.3, we have

$\displaystyle\mathbb{E}(J_{22})=N\sum_{j\notin\mathcal{J}}\mathbb{E}\left[\mathbb{E}\left[\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf e}_{j}\\}^{2}\mid
A_{S_{j}}\right]\mathbb{E}(\widehat{r}_{j}^{-1}-r_{j}^{-1}\mid
A_{S_{j}})\right]=0.$ (11)

This double expectation trick will be used throughout the proof. Also, we have

$\displaystyle\mbox{Var}(J_{22})=$
$\displaystyle~{}N^{2}\sum_{j\notin\mathcal{J}}\mathbb{E}\left[\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf
e}_{j}r_{j}^{-1/2}\\}^{4}r_{j}^{2}(\widehat{r}_{j}^{-1}-r_{j}^{-1})^{2}\right]$
$\displaystyle+$
$\displaystyle~{}2N^{2}\sum_{j\notin\mathcal{J}}\sum_{k\notin\mathcal{J},k<j}\mathbb{E}\bigg{[}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf
e}_{j}r_{j}^{-1/2}\\}^{2}\\{(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}{\bf e}_{k}r_{k}^{-1/2}\\}^{2}\times$
$\displaystyle~{}r_{j}(\widehat{r}_{j}^{-1}-r_{j}^{-1})r_{k}(\widehat{r}_{k}^{-1}-r_{j}^{-1})\bigg{]}$
$\displaystyle=$ $\displaystyle~{}J_{221}+J_{222}.$ (12)

Since $|S_{j}|=0$ for $j\notin\mathcal{J}$, using Lemma 1.3 and the double
expectation trick, we have

$J_{221}=N^{2}\sum_{j\notin\mathcal{J}}\mathbb{E}[\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf
e}_{j}r_{j}^{-1/2}\\}^{4}]\mathbb{E}[r_{j}^{2}(\widehat{r}_{j}^{-1}-r_{j}^{-1})^{2}]=\frac{3(p-p_{0})}{n_{1}+n_{2}-6}.$

Here we also use the fact that $\sqrt{N}(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}{\bf e}_{j}r_{j}^{-1/2}\sim N(0,1)$ for
$j\notin\mathcal{J}$. Similarly, we have

$\displaystyle J_{222}=$
$\displaystyle~{}2N^{2}\sum_{j\notin\mathcal{J}}\sum_{k\notin\mathcal{J},k<j}\mathbb{E}\bigg{[}\mathbb{E}[(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}{\bf
e}_{j}r_{j}^{-1/2}\\}^{2}r_{j}\mid
B_{j,k}]\mathbb{E}[(\widehat{r}_{j}^{-1}-r_{j}^{-1})\mid B_{j,k}]\times$
$\displaystyle~{}\\{(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}{\bf
e}_{k}r_{k}^{-1/2}\\}^{2}r_{k}(\widehat{r}_{k}^{-1}-r_{k}^{-1})]\bigg{]}$
$\displaystyle=$ $\displaystyle~{}0.$

Combining results of $J_{221}$ and $J_{222}$, we have

$\mbox{Var}(J_{22})=3(p-p_{0})/(n_{1}+n_{2}-6)=o(1).$

For $J_{21}$, we first write that

$\displaystyle J_{21}\leq$
$\displaystyle~{}2N\left\\{\sum_{j\in\mathcal{J}}\widehat{r_{j}}^{-1}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}({\bf e}_{j}-{\bf
q}_{j})\\}^{2}-\sum_{j\in\mathcal{J}}{r_{j}}^{-1}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}({\bf e}_{j}-{\bf
q}_{j})\\}^{2}\right\\}+$ $\displaystyle
2N\sum_{j\in\mathcal{J}}\widehat{r_{j}}^{-1}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}(\widehat{\bf q}_{j}-{\bf
q}_{j})\\}^{2}$ $\displaystyle=$ $\displaystyle~{}J_{211}+J_{212}.$ (13)

For $J_{211}$, using Lemma 1.3, we have

$\mathbb{E}(J_{211})=N\left\\{\sum_{j\in\mathcal{J}}\mathbb{E}\left[\mathbb{E}[\widehat{r_{j}}^{-1}-r_{j}^{-1}|A_{S_{j}}]\mathbb{E}[(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}({\bf e}_{j}-{\bf
q}_{j})\\}^{2}\mid A_{S_{j}}]\right]\right\\}=0.$

Also,

$\displaystyle\mbox{Var}(J_{211})=$
$\displaystyle~{}N^{2}\sum_{j\in\mathcal{J}}\mathbb{E}\left[\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}({\bf e}_{j}-{\bf
q}_{j})r_{j}^{-1/2}\\}^{4}r_{j}^{2}(\widehat{r}_{j}^{-1}-r_{j}^{-1})^{2}\right]$
$\displaystyle+$
$\displaystyle~{}2N^{2}\sum_{j\in\mathcal{J}}\sum_{k\in\mathcal{J},k<j}\mathbb{E}\bigg{[}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}({\bf e}_{j}-{\bf
q}_{j})r_{j}^{-1/2}\\}^{2}\\{(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}({\bf e}_{k}-{\bf q}_{k})r_{k}^{-1/2}\\}^{2}$
$\displaystyle~{}\times
r_{j}(\widehat{r}_{j}^{-1}-r_{j}^{-1})r_{k}(\widehat{r}_{k}^{-1}-r_{j}^{-1})\bigg{]}.$

Noting that $\sqrt{N}(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}({\bf e}_{j}-{\bf q}_{j})r_{j}^{-1/2}\sim N(0,1)$ for
$j\in\mathcal{J}$, we use the same tricks as those for $J_{221}$ and $J_{222}$
to show

$\mbox{Var}(J_{221})=\sum_{j\in\mathcal{J}}3/(n_{1}+n_{2}-|S_{j}|-6)\leq
3p_{0}/(n_{1}+n_{2}-d-6).$

For $J_{212}$, we first note that $(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})^{\intercal}(\widehat{\bf q}_{j}-{\bf q}_{j})=(\overline{\bf
x}^{(1)}-\overline{\bf
x}^{(2)})_{S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1/2}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{1/2}(\widehat{\bf
q}_{j}-{\bf q}_{j})_{S_{j}}$ for $j\in\mathcal{J}$. For ease of notation, we
let ${\mbox{\boldmath${\nu}$}}_{j}^{\intercal}=(\overline{\bf
x}^{(1)}-\overline{\bf
x}^{(2)})_{S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1/2}$ and
${\mbox{\boldmath${\theta}$}}_{j}=\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{1/2}(\widehat{\bf
q}_{j}-{\bf q}_{j})_{S_{j}}$. It follows from Lemma 1.3 that
$\mathbb{E}({\mbox{\boldmath${\theta}$}}_{j}|A_{S_{j}})={\bf 0}$ and
$\mbox{Cov}({\mbox{\boldmath${\theta}$}}_{j}|A_{S_{j}})=r_{j}(n_{1}+n_{2})^{-1}I_{S_{j}}$.
Thus,

$\displaystyle~{}\mathbb{E}(J_{212})=N\sum_{j\in\mathcal{J}}\widehat{r}_{j}^{-1}\sum_{s\in
S_{j},t\in
S_{j}}\mathbb{E}\left[\nu_{js}\nu_{jt}\theta_{js}\theta_{jt}\right]$
$\displaystyle=$ $\displaystyle~{}N\sum_{j\in\mathcal{J}}\sum_{s\in S_{j},t\in
S_{j}}\mathbb{E}\left[\mathbb{E}[\widehat{r_{j}}^{-1}\theta_{js}\theta_{jt}|A_{S_{j}}]\nu_{js}\nu_{jt}\right]$
$\displaystyle=$ $\displaystyle~{}N\sum_{j\in\mathcal{J}}r_{j}^{-1}\sum_{s\in
S_{j}}\mathbb{E}\left[\mathbb{E}[\theta_{js}^{2}|A_{S_{j}}]\nu_{js}^{2}\right]$
$\displaystyle=$
$\displaystyle~{}\frac{N}{n_{1}+n_{2}}\sum_{j\in\mathcal{J}}\mathbb{E}[{\mbox{\boldmath${\nu}$}}_{j}^{\intercal}{\mbox{\boldmath${\nu}$}}_{j}]$
$\displaystyle=$
$\displaystyle~{}\sum_{j\in\mathcal{J}}\frac{|S_{j}|}{n_{1}+n_{2}}\left(1+N\mathbb{E}\bigg{[}(\overline{\bf
x}^{(1)}-\overline{\bf
x}^{(2)})_{S_{j}}^{\intercal}{\Sigma}_{S_{j},S_{j}}^{-1/2}\frac{{\Sigma}_{S_{j},S_{j}}^{1/2}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\Sigma}_{S_{j},S_{j}}^{1/2}-I_{|S_{j}|}}{|S_{j}|}{\Sigma}_{S_{j},S_{j}}^{-1/2}(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})_{S_{j}})\bigg{]}\right)$

Since $d\log p_{0}=o(n_{1}+n_{2})$, using Lemma 1.2, we have

$\displaystyle~{}N\mathbb{E}\left[(\overline{\bf x}^{(1)}-\overline{\bf
x}^{(2)})_{S_{j}}^{\intercal}{\Sigma}_{S_{j},S_{j}}^{-1/2}\frac{{\Sigma}_{S_{j},S_{j}}^{1/2}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\Sigma}_{S_{j},S_{j}}^{1/2}-I_{|S_{j}|}}{|S_{j}|}{\Sigma}_{S_{j},S_{j}}^{-1/2}(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})_{S_{j}})\right]$ $\displaystyle\leq$
$\displaystyle~{}N\mathbb{E}\left[\max_{j\in\mathcal{J}}\frac{\left\|{\Sigma}_{S_{j},S_{j}}^{1/2}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\Sigma}_{S_{j},S_{j}}^{1/2}-I_{|S_{j}|}\right\|_{2}}{|S_{j}|}(\overline{\bf
x}^{(1)}-\overline{\bf
x}^{(2)})_{S_{j}}^{\intercal}\\{{\Sigma}_{S_{j},S_{j}}\\}^{-1}(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})_{S_{j}}\right]$ $\displaystyle\leq$
$\displaystyle~{}O_{p}\left(\frac{d\log p_{0}}{n_{1}+n_{2}}\right).$

Since $d\log p_{0}(n_{1}+n_{2})^{-1}=O(1)$ and
$N_{e}=\sum_{j\in\mathcal{J}}|S_{j}|$, we have

${\mathbb{E}(J_{212})}=O\left(\frac{N_{e}}{n_{1}+n_{2}}\right).$

Furthermore,

$\displaystyle\mathbb{E}(J_{212}^{2})=$
$\displaystyle~{}N^{2}\mathbb{E}\left[\left(\sum_{j\in\mathcal{J}}\widehat{r_{j}}^{-1}\\{(\overline{\bf
x}^{(1)}-\overline{\bf x}^{(2)})^{\intercal}(\widehat{\bf q}_{j}-{\bf
q}_{j})\\}^{2}\right)^{2}\right]$ $\displaystyle=$
$\displaystyle~{}N^{2}\sum_{j\in\mathcal{J},k\in\mathcal{J}}\mathbb{E}\left[\widehat{r}_{j}^{-1}\sum_{s\in
S_{j},t\in
S_{j}}\nu_{js}\theta_{js}\nu_{jt}\theta_{jt}\times\widehat{r}_{k}^{-1}\sum_{u\in
S_{k},v\in S_{k}}\nu_{ku}\theta_{ku}\nu_{kv}\theta_{kv}\right]$
$\displaystyle=$
$\displaystyle~{}N^{2}\sum_{j\in\mathcal{J}}\mathbb{E}\left[\widehat{r}_{j}^{-2}\\{\sum_{s\in
S_{j},t\in S_{j}}\nu_{js}\theta_{js}\nu_{jt}\theta_{jt}\\}^{2}\right]$
$\displaystyle+$
$\displaystyle~{}2N^{2}\sum_{j\in\mathcal{J},k\in\mathcal{J},k<j}\mathbb{E}\left[\widehat{r}_{j}^{-1}\sum_{s\in
S_{j},t\in
S_{j}}\nu_{js}\theta_{js}\nu_{jt}\theta_{jt}\times\widehat{r}_{k}^{-1}\sum_{u\in
S_{k},v\in S_{k}}\nu_{ku}\theta_{ku}\nu_{kv}\theta_{kv}\right]$
$\displaystyle=$ $\displaystyle~{}J_{2121}+J_{2122}.$

For $J_{2121}$, we have

$\displaystyle J_{2121}=$
$\displaystyle~{}N^{2}\sum_{j\in\mathcal{J}}\mathbb{E}\bigg{[}\mathbb{E}\big{(}\widehat{r}_{j}^{-2}\mid
A_{S_{j}}\big{)}\mathbb{E}\big{[}\big{(}\sum_{s\in S_{j},t\in
S_{j}}\nu_{js}\theta_{js}\nu_{jt}\theta_{jt}\big{)}^{2}\mid
A_{S_{j}}\big{]}\bigg{]}$ $\displaystyle=$
$\displaystyle~{}N^{2}\sum_{j\in\mathcal{J}}r_{j}^{-2}\left(1+\frac{1}{n_{1}+n_{2}-|S_{j}|-6}\right)\sum_{s,t,u,v\in
S_{j}}\mathbb{E}\bigg{[}\nu_{js}\nu_{jt}\nu_{ju}\nu_{jv}\mathbb{E}\big{(}\theta_{js}\theta_{jt}\theta_{ju}\theta_{jv}\mid
A_{S_{j}}\big{)}\bigg{]}.$

Since given $A_{S_{j}}$, $\theta_{js}\sim N(0,r_{j}(n_{1}+n_{2})^{-1})$ and
$\theta_{js}\mathchoice{\mathrel{\hbox to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}\theta_{jt}$ for all $s\neq t$ and $s,t\in
S_{j}$,

$\displaystyle J_{2121}=$
$\displaystyle~{}N^{2}\sum_{j\in\mathcal{J}}\frac{1}{(n_{1}+n_{2})^{2}}\left(1+\frac{1}{n_{1}+n_{2}-|S_{j}|-6}\right)\left(\sum_{s\in
S_{j}}\mathbb{E}\big{[}v_{js}^{4}\big{]}+\sum_{s,t\in S_{j},s\neq
t}\mathbb{E}\big{[}\nu_{js}^{2}\nu_{jt}^{2}\big{]}\right).$

Since $\sqrt{N}\nu_{js}\sim N(0,1)$ for all $s$, and
$\nu_{js}\mathchoice{\mathrel{\hbox to0.0pt{$\displaystyle\perp$\hss}\mkern
2.0mu{\displaystyle\perp}}}{\mathrel{\hbox
to0.0pt{$\textstyle\perp$\hss}\mkern 2.0mu{\textstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptstyle\perp$\hss}\mkern
2.0mu{\scriptstyle\perp}}}{\mathrel{\hbox
to0.0pt{$\scriptscriptstyle\perp$\hss}\mkern
2.0mu{\scriptscriptstyle\perp}}}\nu_{jt}$ for all $s\neq t$, we have

$J_{2121}=O\left(\frac{dN_{e}}{(n_{1}+n_{2})^{2}}\right).$

We can use similar tricks on $J_{2122}$. Specifically,

$\displaystyle J_{2122}=$
$\displaystyle~{}2N^{2}\sum_{j\in\mathcal{J},k\in\mathcal{J},k<j}\mathbb{E}\bigg{[}\mathbb{E}\big{[}\widehat{r}_{j}^{-1}\sum_{s\in
S_{j},t\in S_{j}}\nu_{js}\theta_{js}\nu_{jt}\theta_{jt}\mid
B_{j,k}\big{]}\times\widehat{r}_{k}^{-1}\sum_{u\in S_{k},v\in
S_{k}}\nu_{ku}\theta_{ku}\nu_{kv}\theta_{kv}\bigg{]}$ $\displaystyle=$
$\displaystyle~{}2N^{2}\sum_{j\in\mathcal{J},k\in\mathcal{J},k<j}\mathbb{E}\bigg{[}r_{j}^{-1}\sum_{s\in
S_{j}}\nu_{js}^{2}\mathbb{E}\big{[}\theta_{js}^{2}|B_{j,k}\big{]}\widehat{r}_{k}^{-1}\sum_{u\in
S_{k},v\in S_{k}}\nu_{ku}\theta_{ku}\nu_{kv}\theta_{kv}\bigg{]}$
$\displaystyle=$
$\displaystyle~{}\frac{2N}{n_{1}+n_{2}}\sum_{j\in\mathcal{J},k\in\mathcal{J},k<j}|S_{j}|\mathbb{E}\big{[}\widehat{r}_{k}^{-1}\sum_{u\in
S_{k},v\in S_{k}}\nu_{ku}\theta_{ku}\nu_{kv}\theta_{kv}\big{]}$
$\displaystyle=$
$\displaystyle~{}\frac{2N}{(n_{1}+n_{2})}\sum_{j\in\mathcal{J},k\in\mathcal{J},k<j}|S_{j}|\mathbb{E}\bigg{[}\mathbb{E}\big{[}r_{k}^{-1}|A_{k}\big{]}\sum_{u\in
S_{k},v\in S_{k}}\nu_{ku}\nu_{kv}\mathbb{E}\big{[}\theta_{ku}\theta_{kv}\mid
A_{k}\big{]}\bigg{]}$ $\displaystyle=$
$\displaystyle~{}\frac{2}{(n_{1}+n_{2})^{2}}\sum_{j\in\mathcal{J},k\in\mathcal{J},k<j}|S_{j}||S_{k}|\leq\frac{N_{e}^{2}}{(n_{1}+n_{2})^{2}}.$

Since $d\leq N_{e}$, we have

$\mbox{Var}(J_{212})\leq\mathbb{E}(J_{212}^{2})=O\left(\frac{N_{e}^{2}}{(n_{1}+n_{2})^{2}}\right).$

Combining all the assertions above, we have

$\mathbb{E}(J_{2})=O\left(\frac{N_{e}}{n_{1}+n_{2}}\right),~{}~{}~{}\mbox{Var}(J_{2})=O\left(\frac{p}{n_{1}+n_{2}-d-6}+\frac{N_{e}^{2}}{(n_{1}+n_{2})^{2}}\right).$

Therefore, as $n_{1},n_{2},p\rightarrow\infty$,

  * •

if $N_{e}=o(n_{1}+n_{2})$ and $p=o(n_{1}+n_{2})$, then under $H_{0}$,
$T^{2}(\widehat{Q},\widehat{R})\rightarrow\chi^{2}_{p}$ in distribution.

  * •

if $N_{e}=o\left(\sqrt{p}(n_{1}+n_{2})\right)$, we have

$\frac{T^{2}(\widehat{Q},\widehat{R})-p}{\sqrt{2p}}=\frac{J_{1}-p}{\sqrt{2p}}+o_{p}(1)\rightarrow
N(0,1)$

in distribution.

This completes the proof.

∎

###### Proof of Theorem 2.

For ease of notation, let ${\bf
d}_{\mu}={\mbox{\boldmath${\mu}$}}_{1}-{\mbox{\boldmath${\mu}$}}_{2}$ and
${\bf y}_{d}=\overline{\bf x}^{(1)}-\overline{\bf x}^{(2)}-{\bf d}_{\mu}$.
Recall that $N=n_{1}n_{2}(n_{1}+n_{2})^{-1}$,
$D_{\text{KL}}=\sum_{j=1}^{p}r_{j}^{-1}\\{{\bf d}_{\mu}^{\intercal}({\bf
e}_{j}-{\bf q}_{j})\\}^{2}$ and $D_{\text{DAG}}=\sum_{j\in\mathcal{J}}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\Sigma_{S_{j},S_{j}}\\}^{-1}{\bf d}_{\mu,S_{j}}$.
We can then write

$\displaystyle T^{2}(\widehat{Q},\widehat{R})=N{\bf
y}_{d}^{\intercal}\widehat{\Sigma}_{\text{DAG}}^{-1}{\bf
y}_{d}+ND_{\text{KL}}+N{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}+2N{\bf d}_{\mu}^{\intercal}\widehat{\Sigma}_{\text{DAG}}^{-1}{\bf
y}_{d}.$ (14)

Using (14), we can write

$\displaystyle\left|\frac{T^{2}(\widehat{Q},\widehat{R})-p}{\sqrt{2p}}\right|\geq\frac{ND_{\text{KL}}}{\sqrt{2p}}-\left|\frac{N{\bf
y}_{d}^{\intercal}\widehat{\Sigma}^{-1}{\bf
y}_{d}-p}{\sqrt{2p}}\right|-\frac{2N}{\sqrt{2p}}\left|{\bf
d}_{\mu}^{\intercal}\widehat{\Sigma}_{\text{DAG}}^{-1}{\bf
y}_{d}\right|-\frac{N}{\sqrt{2p}}|{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}|.$ (15)

Since $d\log p_{0}=O(n_{1}+n_{2})$ and $N_{e}=o(\sqrt{p}(n_{1}+n_{2}))$, one
can use the proof of Theorem 1 to show that

$\frac{N{\bf y}_{d}^{\intercal}\widehat{\Sigma}^{-1}{\bf
y}_{d}-p}{\sqrt{2p}}\stackrel{{\scriptstyle d}}{{\rightarrow}}N(0,1)\mbox{ as
}n_{1},n_{2}\rightarrow\infty.$

We now show $\frac{N}{\sqrt{2p}}{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}=o_{p}(1)$. Specifically,

$\displaystyle{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}=\sum_{j=1}^{p}\widehat{r}_{j}^{-1}\\{{\bf d}_{\mu}^{\intercal}({\bf
e}_{j}-\widehat{\bf q}_{j})\\}^{2}-\sum_{j=1}^{p}{r}_{j}^{-1}\\{{\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf q}_{j})\\}^{2}.$

Again, using the double expectation trick, we have

$\displaystyle~{}\mathbb{E}\big{[}\widehat{r}_{j}^{-1}\\{{\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-\widehat{\bf
q}_{j})\\}^{2}\big{]}=\mathbb{E}\bigg{[}\mathbb{E}\big{[}\widehat{r}_{j}^{-1}\mid
A_{S_{j}}\big{]}\mathbb{E}\big{[}\\{{\bf d}_{\mu}^{\intercal}({\bf
e}_{j}-\widehat{\bf q}_{j})\\}^{2}\mid A_{S_{j}}\big{]}\bigg{]}$
$\displaystyle=$ $\displaystyle~{}r_{j}^{-1}\mathbb{E}\bigg{[}\\{{\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf
q}_{j})\\}^{2}+r_{j}(n_{1}+n_{2})^{-1}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}\bigg{]}.$

Since $d\log p_{0}=o(n_{1}+n_{2})$, using Lemma 1.2, we have

$\displaystyle~{}\mathbb{E}\big{[}{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}\big{]}=\frac{1}{n_{1}+n_{2}}\sum_{j\in\mathcal{J}}\mathbb{E}\big{[}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}\big{]}$ $\displaystyle=$
$\displaystyle~{}\frac{D_{\text{DAG}}}{n_{1}+n_{2}}\times O\left(1+\frac{d\log
p_{0}}{(n_{1}+n_{2})}\right).$

Since $D_{\text{DAG}}=O(p^{1/2}N^{-\gamma})$ for $\gamma>1/2$ and
$N/(n_{1}+n_{2})<1$, we have

$\frac{N}{\sqrt{2p}}\mathbb{E}\big{[}{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}\big{]}=o(1).$

Also,

$\displaystyle~{}\mathbb{E}\bigg{[}\\{{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}\\}^{2}\bigg{]}\leq
2\mathbb{E}\left\\{\sum_{j=1}^{p}(\widehat{r}_{j}^{-1}-r_{j}^{-1})\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-\widehat{\bf q}_{j})\\}^{2}\right\\}^{2}$
$\displaystyle+$
$\displaystyle~{}2\mathbb{E}\left\\{\sum_{j=1}^{p}r_{j}^{-1}\left(\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-\widehat{\bf q}_{j})\\}^{2}-\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-{\bf q}_{j})\\}^{2}\right)\right\\}^{2}$
$\displaystyle=$ $\displaystyle~{}2(J_{3}+J_{4}).$

Note that

$\displaystyle J_{3}=$
$\displaystyle~{}\sum_{j=1}^{p}\mathbb{E}\bigg{[}(\widehat{r}_{j}^{-1}-r_{j}^{-1})^{2}\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-\widehat{\bf q}_{j})\\}^{4}\bigg{]}$
$\displaystyle+$
$\displaystyle~{}2\sum_{k<j}\mathbb{E}\bigg{[}(\widehat{r}_{j}^{-1}-r_{j}^{-1})\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-\widehat{\bf
q}_{j})\\}^{2}(\widehat{r}_{k}^{-1}-r_{k}^{-1})\\{{\bf d}_{u}^{\intercal}({\bf
e}_{k}-\widehat{\bf q}_{k})\\}^{2}\bigg{]}$ $\displaystyle=$
$\displaystyle~{}J_{31}+2J_{32}.$

For $J_{31}$, we have

$\displaystyle J_{31}=$
$\displaystyle~{}\sum_{j=1}^{p}r_{j}^{-2}\frac{1}{n_{1}+n_{2}-|S_{j}|-6}\mathbb{E}\bigg{[}\mathbb{E}\big{[}\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-\widehat{\bf q}_{j})\\}^{4}\mid
A_{S_{j}}\big{]}\bigg{]}$ $\displaystyle\leq$
$\displaystyle~{}8\sum_{j=1}^{p}r_{j}^{-2}\frac{1}{n_{1}+n_{2}-|S_{j}|-6}\left(({\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf
q}_{j}))^{4}+3\mathbb{E}\left[\left(\frac{r_{j}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}}{n_{1}+n_{2}}\right)^{2}\right]I(j\in\mathcal{J})\right)$
$\displaystyle\leq$
$\displaystyle~{}\frac{8}{n_{1}+n_{2}-d-6}\sum_{j=1}^{p}r_{j}^{-2}({\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf
q}_{j}))^{4}+\frac{24}{n_{1}+n_{2}-d-4}\sum_{j\in\mathcal{J}}\mathbb{E}\left[\left(\frac{{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}}{n_{1}+n_{2}}\right)^{2}\right].$

Note that

$\displaystyle\sum_{j\in\mathcal{J}}\mathbb{E}\left[\left(\frac{{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}}{n_{1}+n_{2}}\right)^{2}\right]\leq\frac{2}{(n_{1}+n_{2})^{2}}\sum_{j\in\mathcal{J}}({\bf
d}_{\mu,S_{j}}^{\intercal}\\{{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}})^{2}\times
O\left(1+\frac{d^{2}\log^{2}p_{0}}{(n_{1}+n_{2})^{2}}\right).$

Also,

$\sum_{j=1}^{p}r_{j}^{-2}({\bf d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf
q}_{j}))^{4}\leq D_{\text{KL}}^{2};\sum_{j\in\mathcal{J}}({\bf
d}_{\mu,S_{j}}^{\intercal}\\{{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}})^{2}\leq D_{\text{DAG}}^{2}.$

Since $d\log p_{0}=O(n_{1}+n_{2})$, we then have

$J_{31}=O\left(\frac{D_{\text{KL}}^{2}}{n_{1}+n_{2}-d-6}+\frac{D_{\text{DAG}}^{2}}{(n_{1}+n_{2})^{2}(n_{1}+n_{2}-d-6)}\right).$

Also, using the double expectation trick, it is easy to see that $J_{32}=0$.
Therefore,

$J_{3}=O\left(\frac{D_{\text{KL}}^{2}}{n_{1}+n_{2}-d-4}+\frac{D_{\text{DAG}}^{2}}{(n_{1}+n_{2})^{2}(n_{1}+n_{2}-d-6)}\right).$

For $J_{4}$, we have

$\displaystyle J_{4}=$
$\displaystyle~{}\sum_{j=1}^{p}\mathbb{E}\bigg{[}r_{j}^{-2}\\{\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-\widehat{\bf q}_{j})\\}^{2}-\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-{\bf q}_{j})\\}^{2}\\}^{2}\bigg{]}$
$\displaystyle+$
$\displaystyle~{}2\sum_{k<j}\mathbb{E}\bigg{[}r_{j}^{-1}[\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-\widehat{\bf q}_{j})\\}^{2}-\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-{\bf q}_{j})\\}^{2}]r_{k}^{-1}[\\{{\bf
d}_{u}^{\intercal}({\bf e}_{k}-\widehat{\bf q}_{k})\\}^{2}-\\{{\bf
d}_{\mu}^{\intercal}({\bf e}_{k}-{\bf q}_{k})\\}^{2}]\bigg{]}$
$\displaystyle=$ $\displaystyle~{}J_{41}+2J_{42}.$

For $J_{41}$, using similar tricks, we can show that

$\displaystyle J_{41}\leq$
$\displaystyle~{}\frac{8}{n_{1}+n_{2}}\sum_{j\in\mathcal{J}}r_{j}^{-1}\\{{\bf
d}_{u}^{\intercal}({\bf e}_{j}-{\bf q}_{j})\\}^{2}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}\times O\left(1+\frac{d\log p_{0}}{n_{1}+n_{2}}\right)$
$\displaystyle+$
$\displaystyle~{}\frac{6}{(n_{1}+n_{2})^{2}}\sum_{j\in\mathcal{J}}({\bf
d}_{\mu,S_{j}}^{\intercal}\\{{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}})^{2}\times O\left(1+(\frac{d\log
p_{0}}{n_{1}+n_{2}})^{2}\right)$ $\displaystyle=$
$\displaystyle~{}O\left(\frac{D_{\text{DL}}D_{\text{DAG}}}{n_{1}+n_{2}}+\frac{D_{\text{DAG}}^{2}}{(n_{1}+n_{2})^{2}}\right).$

and

$\displaystyle 2J_{42}=$
$\displaystyle~{}\frac{1}{(n_{1}+n_{2})^{2}}\sum_{k\neq j}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}{\bf
d}_{\mu,S_{k}}^{\intercal}\\{{\Sigma}_{S_{k},S_{k}}\\}^{-1}{\bf
d}_{\mu,S_{k}}\times O\left((1+\frac{d\log p_{0}}{n_{1}+n_{2}})^{2}\right)$
$\displaystyle=$
$\displaystyle~{}O\left(\frac{D_{\text{DAG}}^{2}}{(n_{1}+n_{2})^{2}}\right).$

Thus, since $D_{\text{DAG}}\asymp p^{\beta},D_{\text{KL}}\asymp
p^{1/2}N^{-\gamma}$ and $d=o(n_{1}+n_{2})$ for $\gamma>1/2$ and $0<\beta<1/2$,
combining the results for $J_{3}$ and $J_{4}$, one can see that

$\frac{N^{2}}{2p}\mathbb{E}\bigg{[}\\{{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}\\}^{2}\bigg{]}=o(1).$

Therefore,

$\frac{N}{\sqrt{2p}}\left({\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-\Sigma^{-1}){\bf
d}_{\mu}\right)=o_{p}(1).$

We now focus on ${\bf
d}_{\mu}^{\intercal}\widehat{\Sigma}_{\text{DAG}}^{-1}{\bf y}_{d}$. Similarly,
we can write

${\bf d}_{\mu}^{\intercal}\widehat{\Sigma}_{\text{DAG}}^{-1}{\bf y}_{d}={\bf
d}_{\mu}^{\intercal}{\Sigma}^{-1}{\bf y}_{d}+{\bf
d}_{\mu}^{\intercal}(\widehat{\Sigma}_{\text{DAG}}^{-1}-{\Sigma}^{-1}){\bf
y}_{d}=J_{5}+J_{6}$

For $J_{5}$, it is easy to see that $J_{5}\sim N(0,N^{-1}D_{\text{KL}})$; this
indicates that $NJ_{5}/\sqrt{2p}=o_{p}(1)$, since
$D_{\text{KL}}=O(p^{1/2}N^{-\gamma})$ for $\gamma>1/2$. For $J_{6}$, we first
write

$\displaystyle J_{6}=\sum_{j=1}^{p}\widehat{r}_{j}^{-1}{\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-\widehat{\bf q}_{j})({\bf e}_{j}-\widehat{\bf
q}_{j})^{\intercal}{\bf y}_{d}-\sum_{j=1}^{p}{r}_{j}^{-1}{\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf q}_{j})({\bf e}_{j}-{\bf
q}_{j})^{\intercal}{\bf y}_{d}.$

Again, using the double expectation trick and Lemmas 1.2 and 1.3, we have

$\displaystyle\mathbb{E}[J_{6}]=$
$\displaystyle~{}\sum_{j=1}^{p}\mathbb{E}\bigg{[}\mathbb{E}\big{[}\widehat{r}_{j}^{-1}\mid
A_{S_{j}}\big{]}{\bf d}_{\mu}^{\intercal}\mathbb{E}\big{[}({\bf
e}_{j}-\widehat{\bf q}_{j})({\bf e}_{j}-\widehat{\bf q}_{j})^{\intercal}{\bf
y}_{d}\mid A_{S_{j}}\big{]}\bigg{]}$ $\displaystyle=$
$\displaystyle~{}-2\sum_{j=1}^{p}r_{j}^{-1}\mathbb{E}\bigg{[}{\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf q}_{j})(\widehat{\bf q}_{j}-{\bf
q}_{j})^{\intercal}{\bf
y}_{d}\bigg{]}+\sum_{j=1}^{p}r_{j}^{-1}\mathbb{E}\bigg{[}{\bf
d}_{\mu}^{\intercal}(\widehat{\bf q}_{j}-{\bf q}_{j})(\widehat{\bf q}_{j}-{\bf
q}_{j})^{\intercal}{\bf y}_{d}\bigg{]}$ $\displaystyle=$
$\displaystyle~{}\frac{1}{n_{1}+n_{2}}\sum_{j\in\mathcal{J}}\mathbb{E}\bigg{[}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
y}_{d,S_{j}}\bigg{]}$ $\displaystyle=$
$\displaystyle~{}\frac{1}{(n_{1}+n_{2})N}\sum_{j\in\mathcal{J}}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\Sigma_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}\times O\left(1+\frac{d\log p_{0}}{n_{1}+n_{2}}\right)$
$\displaystyle=$
$\displaystyle~{}O\left(\frac{D_{\text{DAG}}}{(n_{1}+n_{2})N}\right).$

Since $D_{\text{DAG}}=O(p^{\beta})$ for $0<\beta<1/2$, one can see that
$\sqrt{N}\mathbb{E}(J_{6})/\sqrt{p}=o(1)$. Similarly,

$\displaystyle\mathbb{E}[J_{6}^{2}]\leq$
$\displaystyle~{}2\mathbb{E}\bigg{[}\\{\sum_{j=1}^{p}(\widehat{r}_{j}^{-1}-r_{j}^{-1}){\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf q}_{j})({\bf e}_{j}-{\bf
q}_{j})^{\intercal}{\bf y}_{d}\\}^{2}\bigg{]}$ $\displaystyle+$
$\displaystyle~{}16\mathbb{E}\bigg{[}\\{\sum_{j=1}^{p}\widehat{r}_{j}^{-1}{\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf q}_{j})(\widehat{\bf q}_{j}-{\bf
q}_{j})^{\intercal}{\bf y}_{d}\\}^{2}\bigg{]}$ $\displaystyle+$
$\displaystyle~{}4\mathbb{E}\bigg{[}\\{\sum_{j=1}^{p}\widehat{r}_{j}^{-1}{\bf
d}_{\mu}^{\intercal}(\widehat{\bf q}_{j}-{\bf q}_{j})(\widehat{\bf q}_{j}-{\bf
q}_{j})^{\intercal}{\bf y}_{d}\\}^{2}\bigg{]}.$ $\displaystyle=$
$\displaystyle~{}2J_{61}+16J_{62}+4J_{63}.$

For $J_{61}$, we have

$\displaystyle J_{61}\leq$
$\displaystyle~{}\frac{1}{N(n_{1}+n_{2}-d-6)}\sum_{j=1}^{p}r_{j}^{-2}\\{{\bf
d}_{\mu}^{\intercal}({\bf e}_{j}-{\bf q}_{j})\\}^{2}({\bf e}_{j}-{\bf
q}_{j})^{\intercal}\Sigma({\bf e}_{j}-{\bf q}_{j})$ $\displaystyle\leq$
$\displaystyle~{}\frac{D_{\text{KL}}}{N(n_{1}+n_{2}-d-6)}.$

Here, we use the fact that $({\bf e}_{j}-{\bf q}_{j})^{\intercal}\Sigma({\bf
e}_{j}-{\bf q}_{j})=r_{j}$. Using similar tricks, we have

$\displaystyle J_{62}\leq\frac{D_{\text{KL}}d}{(n_{1}+n_{2})N}\times
O\left(1+\frac{d\log p_{0}}{n_{1}+n_{2}}\right).$

and

$\displaystyle J_{63}=$
$\displaystyle~{}\sum_{j=1}^{p}r_{j}^{-2}(1+\frac{1}{n_{1}+n_{2}-|S_{j}|-6})\mathbb{E}\bigg{[}\\{{\bf
d}_{\mu}^{\intercal}(\widehat{\bf q}_{j}-{\bf q}_{j})(\widehat{\bf q}_{j}-{\bf
q}_{j})^{\intercal}{\bf y}_{d}\\}^{2}\bigg{]}$ $\displaystyle+$
$\displaystyle~{}\frac{2}{(n_{1}+n_{2})^{2}}\sum_{k<j}\mathbb{E}\bigg{[}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
y}_{d,S_{j}}{\bf
d}_{\mu,S_{k}}^{\intercal}\\{\widehat{\Sigma}_{S_{k},S_{k}}\\}^{-1}{\bf
y}_{d,S_{k}}\bigg{]}$ $\displaystyle=$ $\displaystyle~{}J_{631}+J_{632}.$

For $J_{631}$, recall that
${\mbox{\boldmath${\theta}$}}_{S_{j}}=\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{1/2}(\widehat{\bf
q}_{j}-{\bf q}_{j})_{S_{j}}$. For ease of notations, let
${\mbox{\boldmath${\psi}$}}_{j}=\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1/2}{\bf
d}_{\mu,S_{j}}$ and
${\mbox{\boldmath${\phi}$}}_{j}=\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1/2}{\bf
y}_{d,S_{j}}$. Then, using the fact that
${\mbox{\boldmath${\theta}$}}_{S_{j}}\mid A_{S_{j}}\sim
N(0,r_{j}(n_{1}+n_{2})^{-1})$, we have

$\displaystyle~{}\mathbb{E}\bigg{[}\\{{\bf d}_{\mu}^{\intercal}(\widehat{\bf
q}_{j}-{\bf q}_{j})(\widehat{\bf q}_{j}-{\bf q}_{j})^{\intercal}{\bf
y}_{d}\\}^{2}\bigg{]}=\mathbb{E}\bigg{[}\sum_{s,t,u,v\in\mathcal{S}_{j}}\phi_{js}\phi_{jt}\psi_{ju}\psi_{jv}\theta_{js}\theta_{jt}\theta_{ju}\theta_{jv}.\bigg{]}$
$\displaystyle\leq$
$\displaystyle~{}\frac{4r_{j}^{2}}{(n_{1}+n_{2})^{2}}\mathbb{E}\bigg{[}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}\times{\bf
y}_{d,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
y}_{d,S_{j}}\bigg{]}$ $\displaystyle+$
$\displaystyle~{}\frac{2r_{j}^{2}}{(n_{1}+n_{2})^{2}}\mathbb{E}\bigg{[}\left({\bf
d}_{\mu,S_{j}}^{\intercal}\\{\widehat{\Sigma}_{S_{j},S_{j}}\\}^{-1}{\bf
y}_{d,S_{j}}\right)^{2}\bigg{]}.$

Since ${\bf y}_{d,S_{j}}\sim N(0,N^{-1}\Sigma_{S_{j},S_{j}})$, by some
algebra, one can see that

$\displaystyle J_{631}\leq$
$\displaystyle~{}\frac{4d}{N(n_{1}+n_{2})^{2}}(1+\frac{1}{n_{1}+n_{2}-d-4})\sum_{j\in\mathcal{J}}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\Sigma_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}\times O\left((1+\frac{d\log p_{0}}{n_{1}+n_{2}})^{2}\right)$
$\displaystyle+$
$\displaystyle~{}\frac{2}{N(n_{1}+n_{2})^{2}}\sum_{j\in\mathcal{J}}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\Sigma_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}\times O\left((1+\frac{d\log p_{0}}{n_{1}+n_{2}})^{2}\right)$
$\displaystyle=$
$\displaystyle~{}O\left(\frac{4dD_{\text{DAG}}}{N(n_{1}+n_{2})^{2}}\right).$

Similarly,

$\displaystyle J_{632}\leq$
$\displaystyle~{}\frac{1}{N(n_{1}+n_{2})^{2}}\sum_{j\in\mathcal{J}}{\bf
d}_{\mu,S_{j}}^{\intercal}\\{\Sigma_{S_{j},S_{j}}\\}^{-1}{\bf
d}_{\mu,S_{j}}\times O\left((1+\frac{d\log p_{0}}{n_{1}+n_{2}})^{2}\right)$
$\displaystyle=$ $\displaystyle~{}\frac{D_{\text{DAG}}}{N(n_{1}+n_{2})^{2}}.$

Since $D_{\text{KL}}=O(p^{1/2}N^{-\gamma})$, $D_{\text{DAG}}=O(p^{\beta})$ and
$d=o(n_{1}+n_{2})$ for $\gamma>1/2$ and $0<\beta<1/2$, one can see that
$N^{2}\mathbb{E}(J_{6}^{2})/p=o(1)$. Combining all the assertions above, as
$n_{1},n_{2}\rightarrow\infty$, we have

$\displaystyle\mathbb{P}\left(\left|\frac{T^{2}(\widehat{Q},\widehat{P})-p}{\sqrt{2p}}\right|\geq
z_{\alpha/2}\right)\geq\mathbb{P}\left(|Z|\leq\frac{ND_{\text{KL}}}{\sqrt{2p}}-z_{\alpha/2}\right).$

Furthermore, if $1/2<\gamma<1$, then

$\mathbb{P}\left(|Z|\leq\frac{ND_{\text{KL}}}{\sqrt{2p}}-z_{\alpha/2}\right)=1\mbox{
as }n_{1},n_{2}\rightarrow\infty.$

This completes the proof. ∎

##  2 More information on the simulation studies

###  2.1 Additional simulation results assuming accurate edge information

Figure S1. Empirical type I error rates ($\delta=0$) and powers ($|\delta|>0)$
under $\bf{n_{1}=n_{2}=50}$ and $\bf{p=20}$, with the number of children nodes
in the DAG set to $p_{0}=0.4p$ (columns 1 and 2) or $p_{0}=0.8p$ (columns 3
and 4), and the number of non-zero signals set to $q=0.1p$ (columns 1 and 3)
or $0.5p$ (columns 2 and 4). Figure S2. Empirical type I error rates
($\delta=0$) and powers ($|\delta|>0)$ under $\bf{n_{1}=n_{2}=100}$ and
$\bf{p=100}$, with $p_{0}=0.4p$ (columns 1 and 2) or $p_{0}=0.8p$ (columns 3
and 4), and $q=0.1p$ (columns 1 and 3) or $0.5p$ (columns 2 and 4). Figure S3.
Empirical type I error rates ($\delta=0$) and powers ($|\delta|>0)$ under
$\bf{n_{1}=n_{2}=100}$ and $\bf{p=300}$, with $p_{0}=0.4p$ (columns 1 and 2)
or $p_{0}=0.8p$ (columns 3 and 4), and $q=0.1p$ (columns 1 and 3) or $0.5p$
(columns 2 and 4).

###  2.2 Additional simulation results given mis-specified edge information

Figure S4. Empirical type I error rates ($\delta=0$) and powers ($|\delta|>0)$
of T2-DAG $Z$ (top panel) and T2-DAG $\chi^{2}$ (bottom panel) under
$n_{1}=n_{2}=50$ and $p=50$, with $p_{0}=0.8p$, and $q=0.1p$ (left panel) or
$0.5p$ (right panel). The T2-DAG was applied based on $A$ (“T2-DAG Correct”),
$A_{1}$ (“T2-DAG Missing”), or $A_{2}$ (“T2-DAG Redundant”). The Graph T2 was
applied based on the true adjacency matrix $A$. Figure S5. Empirical type I
error rates ($\delta=0$) and powers ($|\delta|>0)$ of T2-DAG $Z$ (top panel)
and T2-DAG $\chi^{2}$ (bottom panel) under $n_{1}=n_{2}=100$ and $p=100$, with
$p_{0}=0.8p$, and $q=0.1p$ (left panel) or $0.5p$ (right panel). The T2-DAG
was applied based on $A$ (“T2-DAG Correct”), $A_{1}$ (“T2-DAG Missing”), or
$A_{2}$ (“T2-DAG Redundant”). The Graph T2 was applied based on the true
adjacency matrix $A$. Figure S6. Empirical type I error rates ($\delta=0$) and
powers ($|\delta|>0)$ of T2-DAG $Z$ (top panel) and T2-DAG $\chi^{2}$ (bottom
panel) under $n_{1}=n_{2}=100$ and $p=300$, with $p_{0}=0.8p$, and $q=0.1p$
(left panel) or $0.5p$ (right panel). The T2-DAG was applied based on $A$
(“T2-DAG Correct”), $A_{1}$ (“T2-DAG Missing”), or $A_{2}$ (“T2-DAG
Redundant”). The Graph T2 was applied based on the true adjacency matrix $A$.

###  2.3 Additional simulation results in the presence of unadjusted
confounding effects

Figure S7. Empirical type I error rates ($\delta=0$) and powers ($|\delta|>0)$
of the various tests under $n_{1}=n_{2}=50$ and $p=50$ (column 1) or
$n_{1}=n_{2}=100$ and $p=100$ (column 2), assuming two continuous confounders,
with $p_{0}=0.8p$, and $q=0.5p$.

###  2.4 Additional simulation results given non-Gaussian error terms

We conducted a sensitivity analysis on T2-DAG in terms of the distribution of
the error terms. Specifically, we considered three alternative non-Gaussian
distributions: (1) uniform distribution, where $\epsilon_{ij}$ was generated
from $\text{Unif}(-\sqrt{(}3r_{j}),\sqrt{(}3r_{j}))$, with a zero mean and
variance equal to $r_{j}$ as in the simulation setting in Section 3.2 of the
main manuscript; (2) Gamma distribution, where $\epsilon_{ij}$ was generated
from a Gamma distribution with a shape parameter $s=10$ and a scale parameter
$\sqrt{r_{j}/s}$ and then subtracted by its mean, $s\sqrt{r_{j}/s}$, which
gave a zero mean and variance equal to $r_{j}$; and (3) log-normal
distribution, where $\epsilon_{ij}$ was generated from a log-normal
distribution with zero mean and variance $\tau^{2}=0.16$ on the log scale and
then subtracted by its mean, $\exp(\tau^{2}/2)$.

Figure S8. Empirical type I error rates ($\delta=0$) and powers ($|\delta|>0)$
of the various tests under $\bf{n_{1}=n_{2}=50}$ and $\bf{p=40}$, with error
terms generated from log-normal distributions based on the raw data (row 1) or
log-transformed data (row 2). The number of children nodes in the DAG is set
to $p_{0}=0.6p$ (columns 1 and 2) or $p_{0}=0.8p$ (columns 3 and 4), and the
number of non-zero signals is set to $q=0.1p$ (columns 1 and 3) or $0.5p$
(columns 2 and 4). Figure S9. Empirical type I error rates ($\delta=0$) and
powers ($|\delta|>0)$ of the various tests under $\bf{n_{1}=n_{2}=100}$ and
$\bf{p=100}$, with error terms generated from log-normal distributions based
on the raw data (row 1) or log-transformed data (row 2). The number of
children nodes in the DAG is set to $p_{0}=0.6p$ (columns 1 and 2) or
$p_{0}=0.8p$ (columns 3 and 4), and the number of non-zero signals is set to
$q=0.1p$ (columns 1 and 3) or $0.5p$ (columns 2 and 4). Figure S10. Empirical
type I error rates ($\delta=0$) and powers ($|\delta|>0)$ of the various tests
under $\bf{n_{1}=n_{2}=100}$ and $\bf{p=300}$, with error terms generated from
log-normal distributions based on the raw data (row 1) or log-transformed data
(row 2). The number of children nodes in the DAG is set to $p_{0}=0.6p$
(columns 1 and 2) or $p_{0}=0.8p$ (columns 3 and 4), and the number of non-
zero signals is set to $q=0.1p$ (columns 1 and 3) or $0.5p$ (columns 2 and 4).
Figure S11. Empirical type I error rates ($\delta=0$) and powers
($|\delta|>0)$ of the various tests under $\bf{n_{1}=n_{2}=50}$ and
$\bf{p=40}$, with error terms generated from gamma distributions based on the
raw data (row 1) or log-transformed data (row 2). The number of children nodes
in the DAG is set to $p_{0}=0.6p$ (columns 1 and 2) or $p_{0}=0.8p$ (columns 3
and 4), and the number of non-zero signals is set to $q=0.1p$ (columns 1 and
3) or $0.5p$ (columns 2 and 4). Figure S12. Empirical type I error rates
($\delta=0$) and powers ($|\delta|>0)$ of the various tests under
$\bf{n_{1}=n_{2}=50}$ and $\bf{p=100}$, with error terms generated from gamma
distributions based on the raw data (row 1) or log-transformed data (row 2).
The number of children nodes in the DAG is set to $p_{0}=0.6p$ (columns 1 and
2) or $p_{0}=0.8p$ (columns 3 and 4), and the number of non-zero signals is
set to $q=0.1p$ (columns 1 and 3) or $0.5p$ (columns 2 and 4). Figure S13.
Empirical type I error rates ($\delta=0$) and powers ($|\delta|>0)$ of the
various tests under $\bf{n_{1}=n_{2}=100}$ and $\bf{p=100}$, with error terms
generated from gamma distributions based on the raw data (row 1) or log-
transformed data (row 2). The number of children nodes in the DAG is set to
$p_{0}=0.6p$ (columns 1 and 2) or $p_{0}=0.8p$ (columns 3 and 4), and the
number of non-zero signals is set to $q=0.1p$ (columns 1 and 3) or $0.5p$
(columns 2 and 4). Figure S14. Empirical type I error rates ($\delta=0$) and
powers ($|\delta|>0)$ of the various tests under $\bf{n_{1}=n_{2}=100}$ and
$\bf{p=300}$, with error terms generated from gamma distributions based on the
raw data (row 1) or log-transformed data (row 2). The number of children nodes
in the DAG is set to $p_{0}=0.6p$ (columns 1 and 2) or $p_{0}=0.8p$ (columns 3
and 4), and the number of non-zero signals is set to $q=0.1p$ (columns 1 and
3) or $0.5p$ (columns 2 and 4). Figure S15. Empirical type I error rates
($\delta=0$) and powers ($|\delta|>0)$ of the various tests under
$\bf{n_{1}=n_{2}=50}$ and $\bf{p=40}$, with error terms generated from uniform
distributions. The number of children nodes in the DAG is set to $p_{0}=0.6p$
(columns 1 and 2) or $p_{0}=0.8p$ (columns 3 and 4), and the number of non-
zero signals is set to $q=0.1p$ (columns 1 and 3) or $0.5p$ (columns 2 and 4).
Figure S16. Empirical type I error rates ($\delta=0$) and powers
($|\delta|>0)$ of the various tests under $\bf{n_{1}=n_{2}=50}$ and
$\bf{p=100}$, with error terms generated from uniform distributions. The
number of children nodes in the DAG is set to $p_{0}=0.6p$ (columns 1 and 2)
or $p_{0}=0.8p$ (columns 3 and 4), and the number of non-zero signals is set
to $q=0.1p$ (columns 1 and 3) or $0.5p$ (columns 2 and 4). Figure S17.
Empirical type I error rates ($\delta=0$) and powers ($|\delta|>0)$ of the
various tests under $\bf{n_{1}=n_{2}=100}$ and $\bf{p=100}$, with error terms
generated from uniform distributions. The number of children nodes in the DAG
is set to $p_{0}=0.6p$ (columns 1 and 2) or $p_{0}=0.8p$ (columns 3 and 4),
and the number of non-zero signals is set to $q=0.1p$ (columns 1 and 3) or
$0.5p$ (columns 2 and 4). Figure S18. Empirical type I error rates
($\delta=0$) and powers ($|\delta|>0)$ of the various tests under
$\bf{n_{1}=n_{2}=100}$ and $\bf{p=300}$, with error terms generated from
uniform distributions. The number of children nodes in the DAG is set to
$p_{0}=0.6p$ (columns 1 and 2) or $p_{0}=0.8p$ (columns 3 and 4), and the
number of non-zero signals is set to $q=0.1p$ (columns 1 and 3) or $0.5p$
(columns 2 and 4).

##  3 Additional information on real data analysis

Figure S16: $-{\log}_{10}(p)$ of the various tests for 20 randomly selected
pathways between stage I and stage II lung cancer.  Figure S17: The
$-{\log}_{10}(p)$ of the various tests for 20 randomly selected pathways
between stage I and stage IV lung cancer.  Figure S18: The $-{\log}_{10}(p)$
of the various tests for 20 randomly selected pathways between stage II and
stage III lung cancer.  Figure S19: The $-{\log}_{10}(p)$ of the various tests
for 20 randomly selected pathways between stage II and stage IV lung cancer.
Figure S20: The $-{\log}_{10}(p)$ of the various tests for 20 randomly
selected pathways between stage III and stage IV lung cancer.  Figure S21: The
$-{\log}_{10}(p)$ of the comparison between stage II and stage IV lung cancer
($N_{2}=124$, $N_{4}=24$) for the pathways identified by any test to have
significantly different expression levels between the two cancer stages.
Figure S22: The $-{\log}_{10}(p)$ of the comparison between stage III and
stage IV lung cancer ($N_{3}=84$, $N_{4}=27$) for the pathways identified by
any test to have significantly different expression levels between the two
cancer stages.

Detailed information on the pathways and testing results of data analysis are
summarized in Supplementary Tables S1 - S10 which are provided in a separate
file named “Supplemental Tables S1 - S10”.

Table S11: Results for testing differential expression of 206 pathways between stage I and stage II lung cancer ($N_{1}=278$, $N_{2}=124$). In each panel, the numbers in the diagonal cells are the numbers of significant pathways identified by the corresponding methods; the numbers in the $(i,j)$-th cell in the upper and lower triangle respectively indicate the number of significant pathways detected by both method $i$ and method $j$, and the correlation in $-{\log}_{10}(p)$ between the two methods.  |  T2-DAG $\chi^{2}$ |  T2-DAG $z$ | Graph T2 | T2 | CH-Q | SK | CLX | GCT | aSPU | ARHT
---|---|---|---|---|---|---|---|---|---|---
T2-DAG $\chi^{2}$ | 39 | 39 | 0 | 0 | 11 | 4 | 0 | 10 | 13 | 3
T2-DAG $z$ | 0.98 | 57 | 0 | 0 | 13 | 4 | 0 | 10 | 18 | 3
Graph T2 | 0.43 | 0.39 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0
T2 | 0.39 | 0.34 | 0.70 | 1 | 0 | 0 | 0 | 0 | 0 | 0
CH-Q | 0.71 | 0.71 | 0.30 | 0.34 | 16 | 4 | 0 | 6 | 13 | 3
SK | 0.72 | 0.71 | 0.34 | 0.43 | 0.83 | 4 | 0 | 3 | 4 | 2
CLX | 0.40 | 0.34 | 0.23 | 0.35 | 0.40 | 0.48 | 0 | 0 | 0 | 0
GCT | 0.86 | 0.80 | 0.37 | 0.38 | 0.60 | 0.65 | 0.26 | 10 | 6 | 3
aSPU | 0.28 | 0.30 | 0.21 | 0.22 | 0.60 | 0.42 | 0.35 | 0.13 | 26 | 3
ARHT | 0.63 | 0.57 | 0.56 | 0.84 | 0.71 | 0.69 | 0.46 | 0.59 | 0.44 | 3
Table S12: Results for testing potential differential expression of 206 pathways between stage I and stage IV lung cancer ($N_{1}=278$, $N_{4}=27$). In each panel, the numbers in the diagonal cells are the numbers of significant pathways identified by the corresponding methods; the numbers in the $(i,j)$-th cell in the upper and lower triangle respectively indicate the number of significant pathways detected by both method $i$ and method $j$, and the correlation in $-{\log}_{10}(p)$ between the two methods.  |  T2-DAG $\chi^{2}$ |  T2-DAG $z$ | Graph T2 | T2 | CH-Q | SK | CLX | GCT | aSPU | ARHT
---|---|---|---|---|---|---|---|---|---|---
T2-DAG $\chi^{2}$ | 55 | 55 | 4 | 9 | 4 | 4 | 1 | 16 | 16 | 8
T2-DAG $z$ | 0.98 | 74 | 4 | 9 | 4 | 4 | 2 | 16 | 16 | 8
Graph T2 | 0.54 | 0.55 | 4 | 2 | 3 | 2 | 0 | 2 | 3 | 3
T2 | 0.43 | 0.41 | 0.49 | 12 | 2 | 2 | 0 | 0 | 3 | 7
CH-Q | 0.44 | 0.54 | 0.43 | 0.32 | 5 | 2 | 0 | 1 | 5 | 3
SK | 0.72 | 0.74 | 0.60 | 0.59 | 0.59 | 4 | 1 | 0 | 3 | 2
CLX | 0.36 | 0.36 | 0.26 | 0.31 | 0.22 | 0.57 | 3 | 0 | 0 | 0
GCT | 0.85 | 0.82 | 0.51 | 0.34 | 0.31 | 0.62 | 0.14 | 16 | 6 | 2
aSPU | 0.39 | 0.45 | 0.47 | 0.27 | 0.69 | 0.52 | 0.33 | 0.33 | 19 | 5
ARHT | 0.39 | 0.48 | 0.40 | 0.47 | 0.95 | 0.55 | 0.22 | 0.23 | 0.54 | 9
Table S13: Results for testing potential differential expression of 206 pathways between stage II and stage IV lung cancer ($N_{2}=124$, $N_{4}=27$). In each panel, the numbers in the diagonal cells are the numbers of significant pathways identified by the corresponding methods; the numbers in the $(i,j)$-th cell in the upper and lower triangle respectively indicate the number of significant pathways detected by both method $i$ and method $j$, and the correlation in $-{\log}_{10}(p)$ between the two methods.  |  T2-DAG $\chi^{2}$ |  T2-DAG $z$ | Graph T2 | T2 | CH-Q | SK | CLX | GCT | aSPU | ARHT
---|---|---|---|---|---|---|---|---|---|---
T2-DAG $\chi^{2}$ | 6 | 6 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1
T2-DAG $z$ | 0.97 | 13 | 0 | 1 | 0 | 0 | 0 | 1 | 3 | 1
Graph T2 | 0.38 | 0.34 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
T2 | 0.45 | 0.40 | 0.49 | 1 | 0 | 0 | 0 | 0 | 0 | 1
CH-Q | 0.60 | 0.58 | 0.36 | 0.30 | 0 | 0 | 0 | 0 | 0 | 0
SK | 0.74 | 0.77 | 0.45 | 0.45 | 0.55 | 0 | 0 | 0 | 0 | 0
CLX | 0.29 | 0.25 | 0.13 | 0.27 | 0.19 | 0.44 | 0 | 0 | 0 | 0
GCT | 0.58 | 0.67 | 0.20 | 0.03 | 0.40 | 0.50 | -0.11 | 2 | 0 | 0
aSPU | 0.43 | 0.45 | 0.16 | 0.18 | 0.64 | 0.47 | 0.38 | 0.29 | 6 | 0
ARHT | 0.50 | 0.44 | 0.40 | 0.91 | 0.42 | 0.51 | 0.27 | 0.11 | 0.22 | 1
Table S14: Results for testing potential differential expression of 206 pathways between stage III and stage IV lung cancer ($N_{3}=84$, $N_{4}=24$). In each panel, the numbers in the diagonal cells are the numbers of significant pathways identified by the corresponding methods; the numbers in the $(i,j)$-th cell in the upper and lower triangle respectively indicate the number of significant pathways detected by both method $i$ and method $j$, and the correlation in $-{\log}_{10}(p)$ between the two methods.  |  T2-DAG $\chi^{2}$ |  T2-DAG $z$ | Graph T2 | T2 | CH-Q | SK | CLX | GCT | aSPU | ARHT
---|---|---|---|---|---|---|---|---|---|---
T2-DAG $\chi^{2}$ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
T2-DAG $z$ | 0.55 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
Graph T2 | 0.33 | 0.01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
T2 | 0.35 | -0.01 | 0.34 | 0 | 0 | 0 | 0 | 0 | 0 | 0
CH-Q | 0.50 | 0.13 | 0.35 | 0.22 | 0 | 0 | 0 | 0 | 0 | 0
SK | 0.37 | 0.89 | -0.01 | -0.07 | 0.12 | 0 | 0 | 0 | 0 | 0
CLX | 0.45 | 0.10 | 0.08 | 0.30 | 0.22 | 0.07 | 0 | 0 | 0 | 0
GCT | -0.21 | 0.53 | -0.20 | -0.26 | -0.21 | 0.62 | -0.27 | 5 | 0 | 0
aSPU | 0.38 | 0.11 | 0.12 | 0.15 | 0.47 | 0.05 | 0.41 | -0.16 | 0 | 0
ARHT | 0.40 | 0.01 | 0.41 | 0.86 | 0.44 | -0.04 | 0.25 | -0.25 | 0.18 | 0

## References

  * Wainwright (2019) Martin J Wainwright.  _High-dimensional statistics: A non-asymptotic viewpoint_ , volume 48.  Cambridge University Press, 2019.