Analysis of N-of-1 trials using Bayesian distributed lag model with autocorrelated errors
An N-of-1 trial is a multi-period crossover trial performed in a single individual, with a primary goal to estimate treatment effect on the individual instead of population-level mean responses. As in a conventional crossover trial, it is critical to understand carryover effects of the treatment in an N-of-1 trial, especially when no washout periods between treatment periods are instituted to reduce trial duration. To deal with this issue in situations where high volume of measurements is made during the study, we introduce a novel Bayesian distributed lag model that facilitates the estimation of carryover effects, while accounting for temporal correlations using an autoregressive model. Specifically, we propose a prior variance-covariance structure on the lag coefficients to address collinearity caused by the fact that treatment exposures are typically identical on successive days. A connection between the proposed Bayesian model and penalized regression is noted. Simulation results demonstrate that the proposed model substantially reduces the root mean squared error in the estimation of carryover effects and immediate effects when compared to other existing methods, while being comparable in the estimation of the total effects. We also apply the proposed method to assess the extent of carryover effects of light therapies in relieving depressive symptoms in cancer survivors.
Keywords:
Bayesian distributed lag model, Carryover effects, N-of-1 trials, Personalized treatment, Regression with autocorrelated errors, Time series
Corresponding Author:††Ying Kuen Cheung, ††Department of Biostatistics, Mailman School of Public Health, Columbia University, New York, NY, USA.††Email: yc632@columbia.edu
1 Introduction
N-of-1 trials are multi-period crossover studies that compare two or more interventions in single individuals, and are suitable for evaluating personalized treatment effects in those with chronic conditions where the outcome is relatively stable. [1] Advances in mobile and sensor technology [2] and better understanding of patient preferences [3] have improved the implementation of N-of-1 trials. However, their uptake remains very small in clinical practice. In particular, the duration of N-of-1 trials remains a key barrier. To reduce the duration needed to conduct an N-of-1 trial and to reduce the burden of participation, it is often necessary to preclude scheduling washout periods between treatments. When physical washout periods are not feasible, it is critical to have provisions for dealing with carryover effects analytically. To motivate our work, consider an N-of-1 trial series that compare bright white light (10,000 lux) and dim red light (50 lux) in cancer patients with depressive symptoms, where light therapy was delivered by portable light boxes with instructions. [4] Briefly, each individual would use one of two light boxes for 30 minutes each morning over a 12 weeks. Along with the light boxes, a smartphone application would be used to give treatment reminders and to assess daily depressive symptoms and fatigue level over the entire 12-week period. While theory suggests bright white light may reduce cancer-related depression and fatigue, its effects may vary from individual to individual. [5] Thus, the primary analytical goal in light therapy study is to identify for each individual whether bright white light is superior in terms of symptom control and make light therapy suggestion for their further clinical treatment. Figure 1 shows the daily assessments of two patients during the study course.

In a systematic review of 108 N-of-1 trial series published between 1985 and 2010, Gabler et al. reported on the analytic methods used to compare the effectiveness of two or more treatments being studied in an N-of-1 trial, including graphical comparison, hypothesis tests (e.g., t-test, nonparametric tests), and regression models.[6] While there is no single agreed upon analysis method, these methods ignore two key features of experimental N-of-1 data. First, most methods do not account for temporal dependence (i.e., autocorrelation) between assessments. Second, the methods do not capture the carryover effects of an intervention. The second data feature, which motivates this article, can be partly addressed by using a distributed lagged model (DLM), which is widely used in economics, [7, 8] advertising, [9] and environmental health studies. [10, 11] A DLM postulates that the current value of the outcome variable depends on the previous values (lags) of an exposure as well as the current exposure value, thus allowing the total exposure effect to be distributed over a time period and facilitating explicit modeling of carryover effects. A potential challenge in fitting a DLM is collinearity of the exposure lags. The N-of-1 trial design will further aggravate the problem: as illustrated in Figure 1, the exposure (light box) often remains the same as in the previous day in order to avoid switching intervention too frequently during a trial. A strategy to handle collinearity in DLM is by putting parametric constraints on the lag coefficients such as geometric lags, [7] or polynomial lags. [8] Alternatively, one may consider putting informative prior on the coefficients in a Bayesian framework. [10]
In this article, we adopt the Bayesian framework and propose a Bayesian distributed lag model with autocorrelated errors (BDLM-AR) as an extension of DLMs for N-of-1 trial data. The model is novel in several ways. First, we propose a prior distribution that constrains the lag coefficients with shrinkage factors that increase over time. Second, we impose a fused ridge-type penalty to address collinearity, which may be viewed as a variant of the fused lasso method. [12] Third, while current DLM methods assume independent error terms, we incorporate temporal correlations using an autoregressive error model. We will introduce the proposed BDLM-AR with details in Section 2, and describe the posterior computations in Section 3. The performance of BDLM-AR will be evaluated and compared with other methods by simulation studies presented in Section 4. We will apply the proposed method to the light therapy data in Section 5, and will conclude this article with a discussion in Section 6.
2 Bayesian Distributed Lag Model with Autocorrelated Error
2.1 Proposed Model
Suppose we observe data from a patient on consecutive days. On day , let and denote the binary treatment indicator and the outcome of interest, respectively. We consider a distributed lag autoregressive model for , described as follows:
(1) |
for , where the error term follows an autoregressive process,
(2) |
is a white Gaussian noise with mean zero and unknown variance , and and are pre-specified. Note that for , the maximum lag effect is of order , and terms involving with non-positive subscript are not included in the model.
Model (1) is composed of two parts. First, for the structural component, the mean model is specified by lag coefficients and control mean . The immediate treatment effect is measured by , and the carryover effect due to treatment on days ago is measured by for . In the model, we assume the carryover effect beyond day is zero. As such, the total carryover treatment effect is captured as
Hence, the model naturally breaks down total treatment effect into and .
Second, for the stochastic component, temporal dependency between errors is specified using an order- autoregressive error model with autoregression coefficient . Let denote the backshift operator, that is, having so that the autoregression model for the error terms can be written as . It is often convenient to work with the transformed data and in the estimation steps. Thus, applying to both sides of model (1), we will rewrite the model
(3) |
for , where . To stack the data in vector form, we have
(4) |
where , is a matrix with being the -th element of , is a 1-vector of length , and is the identity matrix of dimension . We denote and , so that .
2.2 Prior Distribution on the Mean Model
We consider normal prior distribution for , that is, having
(5) |
where so that the prior variance of is and the prior variance-covariance matrix of is . We note that the prior variance depends on the variance of the observations: such dependence renders a fused ridge penalized estimation procedure that is free of the variance parameters, resulting in computational stability; see Equation (7) below. We will postulate a non-informative prior on by setting to be a small number, and we will consider of the following form:
(6) |
where the hyperparameters , for are constrained to increase over . As a result of the monotonicity constraint, a lag coefficient at a greater lag is associated with a larger diagonal element in precision , thus shrinking toward the prior mean (zero) to a greater extent. This effectively addresses collinearity of the lag coefficients without imposing strong parametric structure to . In addition, using the normal prior (5) with precision matrix (6), we can show that the maximum a posteriori probability estimate of minimizes a fused ridge-type penalty:
(7) |
where , thus giving insights on how the proposed prior constrains the lag coefficients: it regularizes not only the -norm of the coefficients but also their successive differences, thereby enhancing local smoothness. The equivalence between the Bayesian inference and the fused ridge regularization (7) is proved in Appendix A.
There are many ways to specify and to meet the monotonicity constraints. In this article, we consider and for , so that controls the rate at which the ridge penalty in (7) increases, and controls the increasing rate of smoothness of the coefficient curve . Instead of treating these hyperparameters as fixed, we postulate a truncated standard exponential hyperprior on , that is, having probability density function
(8) |
where the support includes all pairs with which the precision matrix is positive definite. As such, the degree of ridge and smooth penalization can be determined according to the posterior distribution of the pair.
2.3 Prior Distribution on the Error Model
We put the Jeffreys prior for the error variance , that is, having density function
(9) |
Note that any inverse-gamma prior for would maintain conjugacy, and the Jeffreys prior can be regarded as an improper limit of inverse-gamma prior distribution.
For the autoregressive process, we consider a truncated normal prior for subject to the constraint that the error process is stationary. Specifically, we postulate
(10) |
3 Conditional Posterior Distributions
The proposed Bayesian model includes several conditionally conjugate priors, which facilitate posterior computations via a hybrid Metropolis-Hastings/Gibbs algorithm. We describe the conditional posterior distributions in this section.
Working with the likelihood (4) based on the transformed data , we obtain that is conditionally normally distributed a posteriori:
(11) |
and that has an inverse-gamma conditional posterior:
(12) |
Working with model (2) and (10), we obtain the conditional posterior distribution of is truncated multivariate normal:
(13) |
where , , and is a matrix with being the -th element. Because of conjugacy, the parameters and can be easily updated in a Gibbs sampling fashion.
Using the likelihood (4) and prior of and , the conditional posterior distribution can be expressed as
(14) |
We propose to sample using a Metropolis-Hastings (MH) step with a uniform proposal distribution, that is, having an updating step , where the tuning parameter is chosen such that the acceptance rate of proposed sample is around 50%. [14] Note that updating the hyperparameter involves the calculation of the precision matrix , which needs to be positive definite. The precision matrix is a special case of tridiagonal matrix. The computational cost of regular algorithms for checking whether a given matrix is positive definite is at most . In this article, we implement an efficient computation algorithm with cost of . Specifically, define an -dimensional vector by
El-Mikkawy showed that the is positive definite if and only if for . Thus, the problem boils down to checking the positiveness of elements in .[15] The complete algorithm is summarized in Appendix B.
4 Simulation study
4.1 Comparison Methods
In this section, we evaluate the performance of the proposed BDLM-AR using simulation studies. At the end of each simulated trial, we fitted BDLM-AR with lag and AR(1), that is, having
(15) |
where and . Posterior distributions were derived using the hybrid Metropolis Hastings/Gibbs algorithm described in the previous section with 50,000 iterations, a burn-in period of 25,000, and for sampling in the MH step.
We compared BDLM-AR with some existing methods including the Bayesian distributed lag model (BDLagM),[10] Bayesian ridge DLM (BR-DLM) with a mean zero normal prior for , and a non-informative prior Bayesian DLM (NB-DLM) with a flat improper priors on each parameter in . These existing methods would use the same mean model (15) but assume independent errors without accounting for autocorrelation.
In addition, as a benchmark, we include the parametric Koyck’s DLM [7] which assumes the knowledge of the true autoregressive coefficients. For Bayesian models, we estimate the parameters using the posterior means and for Koyck model, we use the maximum likelihood estimates.
4.2 Simulation Scenarios and Data Generation
In each simulated N-of-1 trial, measurements were collected daily for 120 days, under one of two possible treatment sequences. In the first sequence, a participant would receive on the first 30 days and the last 30 days, and receive between days 31 and 90; that is,
In the second treatment sequence, a participant would switch treatments more frequently; specifically,
For each treatment sequence, the data were generated according to model (15) under five sets of lag coefficients (lag curves, LC):
-
LC1.
Exponential decay curve: ;
-
LC2.
Exponential decay curve with oscillation: ;
-
LC3.
Slow absorption curve: ;
-
LC4.
Slow absorption curve with oscillation: ;
-
LC5.
No carryover effect: .
The exponential decay curves (LC1 and LC2) specify coefficients that diminish in magnitude as lag lengthens. Specifically, the coefficients under LC1 decrease geometrically, which is aligned with the assumption of Koyck DLM. The slow absorption curves (LC3 and LC4) reflect scenarios where the carryover effect peaks at day 2 after treatment. LC5 is the null scenario where there is no carryover effect. The magnitudes of the coefficients were chosen in these scenarios so that ; in addition, the total carryover effects () are 4.69, 0.94, 8.48, -2.30 and 0 respectively for LC1-LC5. We consider and for the stochastic component in data generation. For each of these scenarios, the methods were evaluated using 100 simulated trials.
4.3 Simulation Results
Figure 2 shows the bias and root mean squared error (RMSE) of the posterior means of individual lag coefficients. As expected, the biases of NB-DLM are relatively small; however, the method also has the largest RMSE uniformly because of the use of non-informative prior. The biases of the other methods are comparable, and are generally small compared to RMSE. While the penalty in BR-DLM on the lag coefficients reduces variability when compared to NB-DLM, the additional constraints on diminishing coefficients imposed by BDLagM and the proposed BDLM-AR further reduce RMSE for large lag . Additionally, since the proposed BDLM-AR explicitly incorporates ridge-type regularization on the lag coefficients, it results in smaller RMSE for and the earlier lag coefficients (e.g. ). However, as a trade-off, the bias of BDLM-AR for early lag coefficients will be slightly inflated as compared to BDLagM, BR-DLM and NB-DLM, especially when true lag coefficient curve has frequent fluctuation. The benchmark method, Koyck DLM, performs best in the exponential decay case, where the true coefficient of autoregressive error () is assumed to be known. The proposed BDLM-AR has very similar performance as Koyck DLM. Note that the coefficient of autoregressive error is estimated directly from the proposed BDLM-AR model, which is more practical in real application. In summary, the proposed BDLM-AR generally results in smallest RMSE for all lag coefficients.

To further examine the performance of each method in estimating the lag curve in aggregate, Figure 3 (top panel) plots the Euclidean distance between the vector of estimated lag coefficients and the vector of true lag coefficients. Under LC1 (exponential decay), the Koyck DLM has the best performance overall. This is not surprising because (i) the Koyck model mimics the coefficients under LC1 closely, and (ii) Koyck DLM assumes knowledge of the true autoregressive coefficients used in the simulation and hence it is not a method that can be implemented in practice. Thus, this comparison serves as a benchmark about the efficiency of the proposed BDLM-AR and other methods. The figure demonstrates that the proposed BDLM-AR produces smaller distance from the true lag curve than the other methods.

Table 1 gives the bias and RMSE in the estimation of the total effect (), the total carryover effect () and the immediate effect () under different lag curves with and under treatment sequence . Results for other values of , and treatment sequence are similar and are provided in Figure A1 to A3 in the online Supporting Information. Overall, the proposed BDLM-AR yields consistently lower RMSE in estimating total effect, carryover effects, and immediate effects than other comparison methods, except for Koyck DLM. This is consistent with what we observe in Figures 2 and 3. We note that the advantages of BDLM-AR in terms of RMSE for the total carryover effect and immediate effect are more pronounced than that for total effect (). This is indeed the motivation that we set out to accomplish: to decompose the treatment effects and separate carryover effect from the immediate effect.
Truth | BDLM-AR | Koyck DLM | BDLagM | BR-DLM | NB-DLM | ||
---|---|---|---|---|---|---|---|
Bias | Total Effect | ||||||
LC1. Exponential decay | 10 | -1.82 | 0.41 | 0.65 | 0.21 | 0.02 | |
LC2. Exponential decay (Oscillated) | 5.94 | -1.24 | 0.61 | 0.61 | 0.20 | -0.79 | |
LC3. Slow absorption | 10 | -2.04 | 0.12 | 0.71 | 0.30 | -0.42 | |
LC4. Slow absorption (Oscillated) | -0.79 | 0.73 | 0.73 | 0.59 | 0.46 | -0.15 | |
LC5. No carryover | 10 | -1.60 | 0.65 | 0.58 | 0.14 | 0.25 | |
Total Carryover Effect | |||||||
LC1. Exponential decay | 4.69 | -1.57 | 0.10 | 0.01 | 1.13 | -0.44 | |
LC2. Exponential decay (Oscillated) | 0.94 | 0.31 | 2.14 | -0.15 | 1.50 | -0.17 | |
LC3. Slow absorption | 8.48 | -4.19 | -3.61 | -0.11 | -0.31 | 0.40 | |
LC4. Slow absorption (Oscillated) | -2.30 | 1.78 | 2.23 | -0.70 | 0.71 | 0.06 | |
LC5. No carryover | 0 | 2.05 | 4.98 | 0.94 | 3.25 | 0.23 | |
Immediate Effect | |||||||
LC1. Exponential decay | 5 | -0.25 | 0.30 | 0.64 | -0.92 | 0.46 | |
LC2. Exponential decay (Oscillated) | 5 | -1.55 | -1.53 | 0.76 | -1.30 | -0.62 | |
LC3. Slow absorption | 1.51 | 2.15 | 3.73 | 0.81 | 0.61 | -0.82 | |
LC4. Slow absorption (Oscillated) | 1.51 | -1.05 | -1.51 | 1.29 | -0.25 | -0.21 | |
LC5. No carryover | 10 | -3.65 | -4.33 | -0.35 | -3.11 | 0.02 | |
RMSE | Total Effect | ||||||
LC1. Exponential decay | 10 | 3.61 | 3.87 | 4.05 | 4.17 | 3.96 | |
LC2. Exponential decay (Oscillated) | 5.94 | 2.95 | 3.90 | 4.05 | 4.11 | 3.93 | |
LC3. Slow absorption | 10 | 3.81 | 3.85 | 4.06 | 4.16 | 4.40 | |
LC4. Slow absorption (Oscillated) | -0.79 | 2.28 | 3.93 | 4.04 | 4.01 | 3.99 | |
LC5. No carryover | 10 | 3.54 | 3.91 | 4.04 | 4.18 | 3.93 | |
Total Carryover Effect | |||||||
LC1. Exponential decay | 4.69 | 3.03 | 2.01 | 6.57 | 4.83 | 7.61 | |
LC2. Exponential decay (Oscillated) | 0.94 | 2.25 | 2.87 | 6.56 | 4.83 | 6.31 | |
LC3. Slow absorption | 8.48 | 5.13 | 4.15 | 6.58 | 4.64 | 6.94 | |
LC4. Slow absorption (Oscillated) | -2.30 | 2.96 | 2.94 | 6.62 | 4.44 | 6.39 | |
LC5. No carryover | 0 | 3.39 | 5.36 | 6.65 | 6.06 | 6.56 | |
Immediate Effect | |||||||
LC1. Exponential decay | 5 | 2.71 | 2.23 | 6.00 | 3.85 | 7.21 | |
LC2. Exponential decay (Oscillated) | 5 | 2.99 | 2.62 | 6.01 | 3.85 | 6.72 | |
LC3. Slow absorption | 1.51 | 3.42 | 4.30 | 6.03 | 3.61 | 6.67 | |
LC4. Slow absorption (Oscillated) | 1.51 | 2.62 | 2.52 | 6.12 | 3.18 | 6.49 | |
LC5. No carryover | 10 | 4.77 | 4.90 | 5.99 | 5.39 | 5.87 |
4.4 Effects of Design
Figure 3 shows that the Euclidean distance between the vector of estimated lag coefficients and the truth under (bottom panel) is smaller than that under (top panel) suggesting frequently switching treatments will help improve the information content in N-of-1 trial data. This is in line with what we expect because collinearity of exposure lags will be lessened as treatments change frequently, while the total duration is held fixed. An implication in practice is that we should alternate intervention as frequent as it is feasible. The relative performance among methods is the same regardless of the treatment sequence, that is, the proposed BDLM-AR yields the shortest distance from the true lag coefficients .
4.5 Effects of Model Misspecification
In the previous subsections, BDLM-AR and other methods use a working mean model with and an AR(1) model for autoregressive errors. These working models correctly specify (or include the data generation model) in the previous simulation study. In this subsection, we investigate the robustness of BDLM-AR under model mis-specifications. Specifically, we will consider (1) the working mean model with ; (2) the stochastic components that assume autoregressive error order of . That is, we consider a total of 24 BDLM-AR models.
In data generation, we use LC1 as the true mean model, where for , and we consider true scenarios for the errors:
-
E1.
AR(1) with ;
-
E2.
Autoregressive model with .
Note that, under the scenario LC1/E1, a working model with or under-specifies the true model. Likewise, under L1/E2, a working model with or under-specifies the true model.
Table 2 summarizes the RMSE of these 24 models under the two scenarios (LC1/E1 and LC/E2) with under . It can be seen that misspecified lag length has little influence on estimating total effect, total carryover effect and immediate effect, while under-specified error AR order will increase RMSE of parameters to a higher level than over-specified error AR order. Note that when choosing a small lag length value, we can hardly acquire estimation about the whole DL curve, as well as the information on the duration of carryover effect. Therefore, when the lag length is unknown, we suggest to fit data with a reasonable long lag length. For error autoregressive order, when the true orders are unknown, it is also suggested to fit a model with high autoregressive order.
Truth for errors: E1 | Truth for errors: E2 | |||||||
---|---|---|---|---|---|---|---|---|
Lag | AR(7) | AR(1) | AR(0) | AR(7) | AR(1) | AR(0) | ||
Total Effect | 7 | 4.32 | 3.85 | 3.95 | 5.85 | 8.32 | 10.72 | |
6 | 4.37 | 3.88 | 3.92 | 5.92 | 8.25 | 10.62 | ||
5 | 4.44 | 3.91 | 3.93 | 5.89 | 8.21 | 10.55 | ||
4 | 4.49 | 3.98 | 3.94 | 6.01 | 8.06 | 10.48 | ||
3 | 4.59 | 4.02 | 3.93 | 6.02 | 7.81 | 10.40 | ||
2 | 4.63 | 4.07 | 3.91 | 6.08 | 7.68 | 10.34 | ||
1 | 4.75 | 4.15 | 3.87 | 6.12 | 7.43 | 10.26 | ||
0 | 4.01 | 3.71 | 3.77 | 5.82 | 8.58 | 10.52 | ||
Total Carryover Effect | 7 | 3.56 | 3.18 | 3.85 | 3.55 | 5.24 | 6.69 | |
6 | 3.51 | 3.17 | 3.73 | 3.60 | 5.15 | 6.38 | ||
5 | 3.42 | 3.15 | 3.61 | 3.60 | 4.95 | 6.08 | ||
4 | 3.41 | 3.12 | 3.49 | 3.73 | 4.67 | 5.68 | ||
3 | 3.41 | 3.12 | 3.36 | 3.70 | 4.29 | 5.33 | ||
2 | 3.38 | 3.10 | 3.15 | 3.73 | 4.00 | 4.62 | ||
1 | 3.58 | 3.33 | 2.92 | 3.86 | 3.88 | 3.54 | ||
0 | - | - | - | - | - | - | ||
Immediate Effect | 7 | 3.09 | 2.91 | 3.54 | 3.61 | 4.54 | 8.52 | |
6 | 3.02 | 2.91 | 3.47 | 3.56 | 4.50 | 8.46 | ||
5 | 3.03 | 2.87 | 3.38 | 3.58 | 4.52 | 8.40 | ||
4 | 3.04 | 2.85 | 3.31 | 3.57 | 4.54 | 8.29 | ||
3 | 3.03 | 2.88 | 3.28 | 3.54 | 4.66 | 8.25 | ||
2 | 3.09 | 2.97 | 3.29 | 3.64 | 4.91 | 8.28 | ||
1 | 3.15 | 3.15 | 3.49 | 3.71 | 5.21 | 8.48 | ||
0 | 5.39 | 5.62 | 6.00 | 6.35 | 9.02 | 11.75 |
5 Application to Light Therapy Study
The data set we used is from the light therapy study,[4] which studies the effectiveness of bright white light therapy for depressive symptoms within cancer survivors. Besides bright white intervention (10,000 lux), dim red (50 lux) was used as a control intervention, which lacks sufficient light intensity to affect cells from retina. Patients were instructed to use one of two portable lightboxes each morning for 30 minutes per day. For each patient, the whole study duration was 12 weeks. One intervention was assigned on the first three weeks and last three weeks and the other intervention was assigned between the fourth week and the ninth week. The initial intervention was randomized, either bright white lightbox or dim red lightbox. The collected outcomes were depressive symptom and fatigue symptom, which were tracked using a smartphone application. The outcomes were measured by patient’s self-reported standard single-item visual analog scale from 0-not at all depressed/tired to 10-extremely depressed/tired. Some occasional missing outcomes were imputed using average non-missing value in the corresponding treatment block.
We fit the data with the proposed BDLM-AR model with . Two autoregressive order of BDLM-AR model AR(1) and AR(7) were used. Convergence of all the MCMC were checked using both trace plots and the Gelman–Rubin diagnostics. [16] To be specific, the potential scale reduction factor for lag coefficients, autoregressive coefficients and model variance all are smaller than 1.2, indicating the convergence of posterior samples. [17] In addition to the comparison Bayesian distributed lag models, we also fit frequentist autoregressive regression models (RegAR) with and 7.
Table 3 shows the posterior means of the coefficients by the Bayesian methods and the maximum likelihood estimates by RegAR using depressive symptom outcome. For patient 7706, the RegAR and other Bayesian DLM models indicate a weak insignificant total effect of bright white intervention in relieving depressive symptom. However, BDLM-AR(7) model identifies a significant strong effect of bright white intervention as -0.52 (90% CI: -1.07, -0.02). Due to the adjustment on outcome serial correlation and ridge-type penalty on DL coefficients, the credible intervals of DL coefficients are much smaller than those estimated from models using white noise. To check the fitness of each model, we used Ljung–Box test to examine autocorrelation of the residuals,[18] and the corresponding p-values of -test are also shown in Table 3. No statistically significant autocorrelation is found in residuals of BDLM-AR model. We also found a second peak of treatment effect within patient 7706 two days after the immediate effect. For patient 7708, we observe a similar estimation between different models in terms of total effect. Treatment total effect estimated from BDLM-AR(7) model is -1.13 (90% CI: -3.14, 0.28), which is slightly lower than that from other models. Extra information obtained from BDLM-AR model is that the majority of treatment effect lasts for around two days. For RegAR(1) model, BDLagM, BR-DLM and NB-DLM, statistically significant autocorrelation is found in residuals, indicating an inadequacy of model fitting. Analysis results using fatigue symptom outcome can be found in Table A1 in the online Supporting Information.
Subject ID: 7706 | |||||||
BDLM-AR(1) | BDLM-AR(7) | RegAR(1) | RegAR(7) | BDLagM | BR-DLM | NB-DLM | |
2.56 (2.20,2.91) | 2.02 (0.07,2.88) | 2.58 (2.21,2.95) | 3.14 (2.05,4.23) | 2.56 (2.34,2.79) | 2.57 (2.36,2.77) | 2.58 (2.35,2.80) | |
Total effect | -0.01 (-0.39,0.38) | -0.52 (-1.07,-0.02) | -0.02 (-0.52,0.49) | -0.36 (-0.93,0.21) | 0.04 (-0.31,0.39) | 0.02 (-0.29,0.35) | 0 (-0.38,0.38) |
Total carryover effect | 0.02 (-0.23,0.34) | -0.22 (-0.74,0.14) | - | 0.28 (-0.52,1.07) | 0.09 (-0.32,0.55) | 0.24 (-0.62,1.10) | |
-0.03 (-0.41,0.32) | -0.30 (-0.72,0.08) | -0.02 (-0.52,0.49) | -0.36 (-0.93,0.21) | -0.23 (-1.02,0.56) | -0.07 (-0.47,0.26) | -0.24 (-1.10,0.61) | |
0.01 (-0.20,0.22) | -0.01 (-0.30,0.37) | - | - | 0.05 (-0.86,0.97) | -0.02 (-0.43,0.37) | -0.02 (-1.20,1.16) | |
0.01 (-0.11,0.15) | -0.08 (-0.35,0.10) | - | - | 0.10 (-0.30,0.49) | 0.03 (-0.37,0.46) | 0.09 (-1.10,1.28) | |
0.01 (-0.07,0.10) | -0.08 (-0.34,0.05) | - | - | 0.05 (-0.14,0.24) | 0.06 (-0.33,0.51) | 0 (-1.16,1.19) | |
0.01 (-0.03,0.07) | -0.03 (-0.21,0.07) | - | - | 0.03 (-0.08,0.14) | 0.13 (-0.22,0.69) | 0.90 (-0.27,2.07) | |
0 (-0.04,0.03) | -0.02 (-0.15,0.06) | - | - | 0.02 (-0.05,0.09) | -0.10 (-0.64,0.26) | -0.90 (-2.08,0.27) | |
0 (-0.02,0.02) | 0 (-0.09,0.07) | - | - | 0.01 (-0.03,0.05) | 0 (-0.39,0.42) | 0.26 (-0.91,1.43) | |
0 (-0.01,0.01) | 0 (-0.06,0.06) | - | - | 0.01 (-0.02,0.03) | -0.02 (-0.40,0.33) | -0.09 (-0.94,0.77) | |
0.53 (0.36,0.70) | 0.08 (-0.13,0.29) | 0.52 (0.34,0.67) | 0.31 (0.13,0.49) | - | - | - | |
- | 0.18 (-0.02,0.39) | - | 0.13 (-0.06,0.32) | - | - | - | |
- | 0.07 (-0.11,0.25) | - | -0.05 (-0.25,0.15) | - | - | - | |
- | 0.22 (0.04,0.39) | - | 0.20 (0.01,0.40) | - | - | - | |
- | 0.09 (-0.08,0.26) | - | 0.09 (-0.14, 0.32) | - | - | - | |
- | 0.06 (-0.10,0.23) | - | 0.07 (-0.15, 0.29) | - | - | - | |
- | 0.06 (-0.10,0.22) | - | 0.06 (-0.17,0.28) | - | - | - | |
p-value | 0.18 | 0.72 | <0.001 | 0.97 | <0.001 | <0.001 | <0.001 |
Subject ID: 7708 | |||||||
BDLM-AR(1) | BDLM-AR(7) | RegAR(1) | RegAR(7) | BDLagM | BR-DLM | NB-DLM | |
2.62 (1.73,3.50) | 2.80 (-1.3,7.57) | 2.76 (1.91,3.62) | 4.64(2.38,6.89) | 2.82 (2.25,3.39) | 2.74 (2.17,3.30) | 2.85 (2.25,3.44) | |
Total effect | -0.99 (-2.28,0.17) | -1.13 (-3.14,0.28) | -1.42 (-2.64,-0.19) | -1.72 (-3.14,-0.31) | -1.53 (-2.44,-0.61) | -1.38 (-2.32,-0.43) | -1.62 (-2.63,-0.6) |
Total carryover effect | -0.36 (-1.58,0.50) | -0.40 (-1.96,0.52) | - | - | -0.45 (-2.59,1.66) | -0.86 (-2.09,0.41) | -0.46 (-2.73,1.80) |
-0.63 (-1.80,0.48) | -0.72 (-2.26,0.45) | -1.42 (-2.64,-0.19) | -1.72 (-3.14,-0.31) | -1.07 (-3.15,1.02) | -0.52 (-1.73,0.45) | -1.15 (-3.42,1.11) | |
-0.22 (-1.03,0.45) | -0.32 (-1.46,0.39) | - | - | -0.02 (-2.46,2.43) | -0.26 (-1.49,0.92) | -0.11 (-3.22,2.98) | |
-0.08 (-0.61,0.36) | -0.08 (-0.74,0.44) | - | - | -0.15 (-1.21,0.91) | -0.13 (-1.33,1.14) | 0.10 (-3.03,3.22) | |
-0.03 (-0.38,0.26) | -0.04 (-0.51,0.34) | - | - | -0.12 (-0.63,0.39) | -0.08 (-1.27,1.18) | 0.34 (-2.76,3.44) | |
-0.03 (-0.29,0.15) | -0.04 (-0.41,0.22) | - | - | -0.07 (-0.37,0.22) | -0.29 (-1.63,0.86) | -1.33 (-4.43,1.77) | |
0 (-0.15,0.13) | 0.03 (-0.14,0.34) | - | - | -0.04 (-0.22,0.13) | 0.09 (-1.06,1.44) | 0.99 (-2.14,4.11) | |
0 (-0.10,0.09) | 0.02 (-0.12,0.22) | - | - | -0.03 (-0.13,0.08) | -0.01 (-1.17,1.23) | 0.13 (-2.95,3.22) | |
0 (-0.06,0.05) | 0.01 (-0.08,0.13) | - | - | -0.02 (-0.08,0.05) | -0.18 (-1.31,0.84) | -0.58 (-2.85,1.69) | |
0.44 (0.26,0.62) | 0.43 (0.22,0.64) | 0.43 (0.24,0.59) | 0.36 (0.17,0.54) | - | - | - | |
- | 0 (-0.22,0.23) | - | -0.01 (-0.21,0.19) | - | - | - | |
- | -0.02 (-0.25,0.22) | - | 0 (-0.20,0.21) | - | - | - | |
- | 0.19 (-0.04,0.42) | - | 0.13 (-0.07,0.33) | - | - | - | |
- | 0.09 (-0.15,0.32) | - | 0.11 (-0.10,0.31) | - | - | - | |
- | 0.06 (-0.18,0.30) | - | 0.06 (-0.16,0.28) | - | - | - | |
- | -0.05 (-0.28,0.17) | - | -0.09 (-0.29,0.12) | - | - | - | |
p-value | 0.76 | 0.83 | <0.001 | 0.91 | <0.001 | <0.001 | <0.001 |
6 Discussion
In this paper, we introduce a novel method to analyze data from N-of-1 trials. The method handles temporal correlation between measurements and carryover effects via distributed lag structure and parameters are estimated using Bayesian approach with (fused) ridge type regularization. From the design perspective, N-of-1 trial can be viewed as a multi-period crossover trial in an individual. Traditional crossover trial requires physical washout period to eliminate carryover effects, resulting in pauses of study intervention and potentially lengthening study duration. Instead of using physical washout period, our proposed method provides an alternative to address the carryover effects analytically, which can be applied to N-of-1 trial even without washout period. This is specifically suited to applications where outcomes are measured continuously over the study period. Our simulation studies show that the proposed BDLM-AR model generally outperforms Koyck DLM, BDLagM, BR-DLM and NB-DLM in estimating carryover effects while comparable in estimating the total effects. Furthermore, we showed that BDLM-AR can simultaneously estimate autoregressive error. The advantage of BDLM-AR model increases when strong serial correlation exists.
We adopt a Bayesian estimation framework, which facilitates modeling and inference of N-of-1 trial data in several ways. First, a key in modeling carryover effects in N-of-1 trial data is to address multicollinearity in the lag treatment effects. Under a Bayesian framework, we achieve this by postulating a prior precision matrix on the lag coefficients to provide the appropriate constraints on the lag coefficients. Specifically, the designed form of this prior precision matrix is motivated by and connected to a fused ridge penalized estimation procedure (7), which imposes shrinkage and smoothness of the lag coefficients; see Appendix A for details. Second, while cross validation is often a method of choice in tuning the penalty terms ( and via and ) in penalized estimation, it is not feasible to split the sample at random time points because of the temporal order in N-of-1 trial data. Bayesian formulation provides a natural way to tune the penalties in a data-driven manner via posterior inference. Third, we have applied our model to a real application of using white light therapy for depressive symptoms, along with other Bayesian approaches (BDLagM, BR-DLM, NB-DLM). These approaches allow for using posterior credible intervals of individual lag coefficients as inferential tools. While there are varying degrees of variability, the proposed BDLM-AR gives the shortest intervals. The posterior intervals offer additional insights on the whole time course of treatment effect.
Data availability
R code for our Bayesian distributed lag model and corresponding simulations is available via the following GitHub repository, https://github.com/williammomo/BDLM-AR.
Appendix
Appendix A
Let denote conditional distribution of given all other variables in the model. The posterior distribution of is
The MAP estimate of is
Note that the model variance is included in the prior distribution of as a scaling parameter. In this way, the ridge and smoothness penalties are only controlled by and , without depending on the model variance and prior covariance matrix of .
Appendix B
References
- [1] R. Kravitz, N. Duan, I. Eslick, N. Gabler, H. Kaplan, et al., “Design and implementation of n-of-1 trials: a user’s guide,” Agency for healthcare research and quality, US Department of Health and Human Services, 2014.
- [2] E. J. Topol, “Transforming medicine via digital innovation,” Science translational medicine, vol. 2, no. 16, pp. 16cm4–16cm4, 2010.
- [3] Y. K. Cheung, D. Wood, K. Zhang, T. A. Ridenour, L. Derby, T. St Onge, N. Duan, J. Duer-Hefele, K. W. Davidson, I. Kronish, et al., “Personal preferences for personalised trials among patients with chronic diseases: an empirical bayesian analysis of a conjoint survey,” BMJ open, vol. 10, no. 6, p. e036056, 2020.
- [4] I. M. Kronish, Y. K. Cheung, J. Julian, F. Parsons, J. Lee, S. Yoon, H. Valdimarsdottir, P. Green, J. Suls, D. L. Hershman, et al., “Clinical usefulness of bright white light therapy for depressive symptoms in cancer survivors: Results from a series of personalized (n-of-1) trials,” in Healthcare, vol. 8, p. 10, Multidisciplinary Digital Publishing Institute, 2020.
- [5] J. A. Johnson, S. N. Garland, L. E. Carlson, J. Savard, J. S. A. Simpson, S. Ancoli-Israel, and T. S. Campbell, “Bright light therapy improves cancer-related fatigue in cancer survivors: a randomized controlled trial,” Journal of Cancer Survivorship, vol. 12, no. 2, pp. 206–215, 2018.
- [6] N. B. Gabler, N. Duan, S. Vohra, and R. L. Kravitz, “N-of-1 trials in the medical literature: a systematic review,” Medical care, pp. 761–768, 2011.
- [7] L. M. Koyck, Distributed lags and investment analysis, vol. 4. North-Holland Publishing Company, 1954.
- [8] S. Almon, “The distributed lag between capital appropriations and expenditures,” Econometrica: Journal of the Econometric Society, pp. 178–196, 1965.
- [9] F. M. Bass and D. G. Clarke, “Testing distributed lag models of advertising effect,” Journal of Marketing Research, vol. 9, no. 3, pp. 298–308, 1972.
- [10] L. J. Welty, R. Peng, S. Zeger, and F. Dominici, “Bayesian distributed lag models: estimating effects of particulate matter air pollution on daily mortality,” Biometrics, vol. 65, no. 1, pp. 282–291, 2009.
- [11] A. Zanobetti, M. Wand, J. Schwartz, and L. Ryan, “Generalized additive distributed lag models: quantifying mortality displacement,” Biostatistics, vol. 1, no. 3, pp. 279–292, 2000.
- [12] R. Tibshirani and P. Wang, “Spatial smoothing and hot spot detection for cgh data using the fused lasso,” Biostatistics, vol. 9, no. 1, pp. 18–29, 2008.
- [13] S. Chib, “Bayes regression with autoregressive errors: A gibbs sampling approach,” Journal of Econometrics, vol. 58, no. 3, pp. 275–294, 1993.
- [14] A. Gelman, G. O. Roberts, W. R. Gilks, et al., “Efficient metropolis jumping rules,” Bayesian statistics, vol. 5, no. 599-608, p. 42, 1996.
- [15] M. E. El-Mikkawy, “A fast algorithm for evaluating nth order tri-diagonal determinants,” Journal of computational and applied mathematics, vol. 166, no. 2, pp. 581–584, 2004.
- [16] A. Gelman, D. B. Rubin, et al., “Inference from iterative simulation using multiple sequences,” Statistical science, vol. 7, no. 4, pp. 457–472, 1992.
- [17] S. P. Brooks and A. Gelman, “General methods for monitoring convergence of iterative simulations,” Journal of computational and graphical statistics, vol. 7, no. 4, pp. 434–455, 1998.
- [18] G. M. Ljung and G. E. Box, “On a measure of lack of fit in time series models,” Biometrika, vol. 65, no. 2, pp. 297–303, 1978.
- [19] R. Tibshirani, M. Saunders, S. Rosset, J. Zhu, and K. Knight, “Sparsity and smoothness via the fused lasso,” Journal of the Royal Statistical Society: Series B (Statistical Methodology), vol. 67, no. 1, pp. 91–108, 2005.
- [20] H. B. Valdimarsdottir, M. G. Figueiro, W. Holden, S. Lutgendorf, L. M. Wu, S. Ancoli-Israel, J. Chen, A. Hoffman-Peterson, J. Granski, N. Prescott, et al., “Programmed environmental illumination during autologous stem cell transplantation hospitalization for the treatment of multiple myeloma reduces severity of depression: A preliminary randomized controlled trial,” Cancer medicine, vol. 7, no. 9, pp. 4345–4353, 2018.
- [21] D. A. Belsley, “A guide to using the collinearity diagnostics,” Computer Science in Economics and Management, vol. 4, no. 1, pp. 33–50, 1991.
- [22] D. V. Lindley and A. F. Smith, “Bayes estimates for the linear model,” Journal of the Royal Statistical Society: Series B (Methodological), vol. 34, no. 1, pp. 1–18, 1972.
- [23] A. E. Hoerl and R. W. Kennard, “Ridge regression: Biased estimation for nonorthogonal problems,” Technometrics, vol. 12, no. 1, pp. 55–67, 1970.