**3. Optimal 2-treatment N-of-1 designs**

Let **x***τ*, **x***<sup>γ</sup>* , **x***<sup>s</sup>* and **x***<sup>m</sup>* be the design vectors corresponding to the parameters *τ*, *γ*, *γ<sup>s</sup>* and *γm*, respectively. Under the traditional model, the design matrix is [**1***p*, **x***τ*, **x***<sup>γ</sup>* ] for the parameters [*μ*, *τ*, *γ*] with **X**<sup>1</sup> ¼ 1*<sup>p</sup>* and **X**2=[**x***τ*, **x***γ*]. Under the self and mixed effect model, we have [**1***<sup>p</sup>* **x***τ*, **x***s*, **x***m*] for the parameters [*μ*, *τ*, *γs*, *γm*] with **X**<sup>1</sup> ¼ 1*<sup>p</sup>* and **X**2= [**x***τ*, **x***s*, **x***m*].

In 2-treatment N-of-1 trials, the *Id*ð Þ *τ*, *γ* is a function of the quantities:

$$\mathbf{x}'\_{\tau}\mathbf{x}\_{\tau} = p, \quad \mathbf{x}'\_{\gamma}\mathbf{x}\_{\tau} = p - \mathbf{1}, \quad \mathbf{x}'\_{\tau}\mathbf{x}\_{\tau} = h \tag{4}$$

under model (1) for *θ* ¼ ð Þ *τ*, *γ* <sup>0</sup> , or

$$\mathbf{x}'\_{\tau}\mathbf{x}\_{t} = \mathfrak{s}, \quad \mathbf{x}'\_{\varsigma}\mathfrak{x}\_{t} = \mathfrak{s}, \quad \mathbf{x}'\_{m}\mathfrak{x}\_{t} = \mathbf{0}, \quad \mathbf{x}'\_{\tau}\mathfrak{x}\_{m} = -m, \quad \mathbf{x}'\_{m}\mathfrak{x}\_{m} = m \tag{5}$$

under model (2) for *θ* ¼ *τ*, *γ<sup>s</sup>* ð Þ , *γ<sup>m</sup>* 0 . Hence, the information matrix can be expressed in terms of *p*, *s*, *m* and *h*.

Since the information matrices can be further simply expressed in terms of *h* and *p* only, for a given *p*, the optimal *p*�period N-of-1 trial is completely determined by *h*, and much simpler to construct than previously. We proceed by defining *Id*ð Þ*τ* appropriately to find designs that maximize the information below.

Under an equi-correlated error assumption, the optimal N-of-1 trial for *τ* and *γ* is the one sequence design that consists of pairs of *AB* and *BA* appearing alternatively. Hence, the optimal N-of-1 trials for 4, 6, and 8 periods are the one sequence design, *ABBA*, *ABBAAB* and *ABBAABBA*, respectively. One could switch *A* and *B* to obtain a dual sequence with the same effect.

Under the equi-correlated errors, the optimal N-of-1 trial for estimating the direct treatment contrast is the sequence with only *AB* (*BA*) pairs with no alternation, such as *BABABA* and *ABABABAB*. A closed form for the optimal *h* is complicated for autoregressive errors, and selected numerical results are found when *h* ¼ 1 � *p*.

To summarize, the optimal N-of-1 trials for estimating direct treatment effects are determined by the three feature parameters *h*, *s*, and *m*. However, specifying one of these along with *p* determines the design sequence, as illustrated in **Table 2**. We used *h* to summarize the optimal designs under both the traditional and self and mixed models for 4, 6, 8, 10, and 12-period N-of-1 trials.

It can be shown that under the traditional model, the optimal trial for the direct treatment effect uses the sequence with *h* ¼ �1 for all covariance structures. Therefore, the optimal N-of-1 trial for estimating the direct treatment effect is to alternate between *AB* and *BA* pairs. In case that the carryover effect is of interest, it can be easily shown that these designs are also optimal for estimating the carryover effect, which can be obtained using the same technique for optimal designs in treatment effects. Under the self and mixed effects model, the optimal N-of-1 trial for the direct treatment effect uses a sequence with *h* ¼ �ð Þ *p* � 1 for both uncorrelated and equalcorrelated covariances. Therefore, the optimal N-of-1 trial is to use only *AB* pairs throughout. Under the auto-regressive covariance structure, however, the optimal designs depend on the value of *p* and the auto-regressive correlation *ρ*. Generally, the optimal design uses *AB* and *BA* pairs alternately, but as *ρ* or *p* increases, some abnormalities are observed.
