# Evaluation of Methods for Joinpoint Analysis of Time Series Using Simulated and Real-World Data

Lucie Noé, Zaba Valtuille, Emilie Lanoy, Sandrine Katsahian, Florentia

Kaguelidou

► To cite this version:

Lucie Noé, Zaba Valtuille, Emilie Lanoy, Sandrine Katsahian, Florentia Kaguelidou. Evaluation of Methods for Joinpoint Analysis of Time Series Using Simulated and Real-World Data. Journal of Clinical Epidemiology, 2025, 187, 10.1016/j.jclinepi.2025.111966. hal-05374790

HAL Id: hal-05374790

https://hal.science/hal-05374790v1

Submitted on 20 Nov 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
ORIGINAL RESEARCH

Evaluation of Methods for Joinpoint Analysis of Time Series Using
Simulated and Real-World Data

Lucie Noé<sup>a,b</sup>, Zaba Valtuille<sup>a,b</sup>, Emilie Lanoy<sup>c</sup>, Sandrine Katsahian<sup>c,d</sup>, Florentia Kaguelidou<sup>a,b,*</sup>

Accepted 28 August 2025; Published online 1 September 2025

**Abstract**

**Objectives:** Joinpoint regression (JR) is implemented in time series analysis to identify trend changes without predefined shift points. This study compares the performance of the Joinpoint Regression Program (JRP) and R "segmented" package in detecting joinpoints using simulated and real-world data on pediatric mental health (MH)—related hospitalizations.

**Study Design and Setting:** Simulated datasets (n = 1000) were generated with varying residual autocorrelation, trend change magnitude, and joinpoint locations to evaluate the performance of both software (accuracy, specificity, coverage of the 95% confidence interval [95% CI] coverage, monthly percent change [MPC], coverage of the last segment). In addition, monthly proportions of pediatric MH-related hospitalizations (January 2016–December 2023) were analyzed to compare the number of joinpoints identified and the average monthly percent change (AMPC).

**Results:** In simulations without residual autocorrelation and no joinpoint, JRP exhibited a specificity of 92.7% compared to 97.9% for R. With an important trend change, the accuracy and 95% CI coverage were 59.0% and 81.7% using JRP and 69.4% and 76.8% using R. The coverage of the MPC of the last time segment varied from 93.0% to 97.9% using JRP and from 0% to 98.3% using R. When residual autocorrelation was introduced with a moderate trend change toward the end of the dataset, the accuracy and 95% CI coverage were 72.6% and 95.0% using JRP and 52.8% and 67.1% using R. The coverage of the MPC of the last time segment varied from 4.8% to 98.6% using JRP and from 0% to 96.9% with R. In the analysis of MH-related hospitalizations, among girls aged 6–11 years, JRP detected four joinpoints (AMPC: 0.11%), while R found 1 (AMPC: 0.05%). For boys aged 12–17 years, JRP identified four joinpoints vs three using R.

**Conclusion:** The choice of JR software should be guided by the characteristics of the dataset. The R "segmented" package may be more appropriate for datasets without residual autocorrelation, whereas JRP appears to provide more reliable estimates when analyzing autocorrelated health care data or data with no underlying trend changes. © 2025 The Author(s). Published by Elsevier Inc. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).

**Keywords:** Joinpoint analysis; simulation; real-world data; mental health; joinpoint regression; health care

# 1. Introduction

Interrupted Time Series (ITS) analysis is a robust,
nonexperimental method used to evaluate population-level
policies or interventions by estimating trends before and af-
ter their implementation [1]. ITS has increasingly been

used to evaluate health care interventions [2]. The joinpoint
regression (JR) analysis is another type of analysis in which
joinpoints refer to unknown timepoints where trends shift
or to time series presenting multiple shifts [3]. By fitting
a series of linear segments to the time series data, this
approach allows to pinpoint the true timepoints of trend
shift and to quantify the trend over the entire study period
and within identified time segments [4]. Analysis of time
series using JR has already been performed in various fields
of medical research [5-7].

The Joinpoint Regression Program (JRP) is a software,
developed by the National Cancer Institute, part of the

<footnote><sup>a</sup>Center of Clinical Investigations, INSERM CIC1426, Robert Debré University Hospital, APHP.Nord, Paris, France</footnote>

<footnote><sup>b</sup>Université Paris Cité, UMR 1343, Perinatal and Pediatric Pharmacology and Therapeutic Assessment, Paris, France</footnote>

<footnote><sup>c</sup>Unité de Recherche Clinique, AP-HP Hôpital Européen Georges Pompidou, AP-HP Centre, Paris, France</footnote>

<footnote><sup>d</sup>UMR 1346, Université Paris Cité, INRIA, INSERM, Paris, France</footnote>

<footnote>* Corresponding author. Center of Clinical Investigations, Inserm CIC1426, Robert Debré University Hospital, Paris Cité University, 48 boulevard Sérurier, Paris 75019, France.</footnote>

<footnote>E-mail address: florentia.kaguelidou@aphp.fr (F. Kaguelidou).</footnote>
## Plain Language Summary

This study compares two methods for analyzing changes in trends over time. The two tools examined are the Joinpoint Regression Program (JRP) and the R "segmented" package. Using both simulated data and real-world hospital data, we assessed the performance of these tools. The simulated data included two scenarios: one without residual autocorrelation (simpler) and another with residual autocorrelation (where data points are related to previous ones, often seen in health care data). In the simpler scenario, the R package outperformed JRP by being more accurate in detecting changes and avoiding false detections. It also provided more precise estimates, with smaller uncertainty around the change points. However, when dealing with the more complex scenario involving residual autocorrelation, the JRP performed better, especially when changes occurred later in the timeline. However, early trend changes in the time series were challenging to detect for both JRP and R software. When analyzing real-world data on children's mental health hospitalizations, the JRP tended to identify more changes in trends than the R package. However, both softwares produced broadly similar results for the overall trends. The JRP is user-friendly and works well with data that include complex patterns like residual autocorrelation, but it does not account for seasonal effects and may detect more changes than are truly present. The R package, on the other hand, offers greater precision and flexibility for simpler data but requires more advanced programming skills and does not perform as well when handling data with residual autocorrelation. In summary, the choice between these tools should be driven by the type of data being analyzed: the R package is better for straightforward data, while the JRP is more suited for complex datasets such as those found in health care.

National Institutes of Health, to perform JR analyses [8,9]. A package is also available in R, named "segmented" package, to perform these analyses [10]. Previously published studies conducted JR analyses used the JRP software [6,11]. Yet, JRP does not account for potential data seasonality nor does it allow residual analyses to be performed. The "segmented" R package provides a more flexible approach, accounting for seasonality and residual analyses, but it is less widely used. We aimed to compare the estimates of a joinpoint analysis using the JRP software with those using the R "segmented" package on simulated and real-world time series data.

# 2. Methods

## 2.1. Software

For the analysis using JRP, we accessed the JRP (version 5.1.0) for data analyses at https://surveillance.cancer.gov/joinpoint/download (last accessed July 17, 2024) [8]. Documentation and instructions are available online [12]. For the analysis using the "segmented" R package, hereafter called "R analysis," we used R (version 4.3.3) at https://cran.r-project.org/bin/windows/base/ (last accessed July 28, 2024). Then, we used the "segmented" and "aapc" functions to perform the JR and estimate trend changes over the entire study period, both available in the R "segmented" package [10,13,14]. R was implemented for all data management and data graphical visualization.

## 2.2. Joinpoint regression model

The JR analysis identified time points in months where changes of the time series trend occurred, hereafter called

joinpoints. For that, we implemented a log-linear regression using the following model:

$$ \log(Y_t) = \beta_0 + \beta_1 t + \delta_1 \times (Time - \tau_1)^+ + \dots + \delta_k \times (Time - \tau_k)^+ + \varepsilon_t \quad (1) $$

where, *Time* is a continuous variable measuring the time elapsed since the start of the study, *Y*<sub>*t*</sub> the value of the outcome, *β*<sub>0</sub> the baseline outcome level, and *β*<sub>1</sub> the trend since the start of the study. The vector *τ* = (*τ*<sub>1</sub>, ..., *τ*<sub>*k*</sub>) is the location of the unknown *k* joinpoints. The variable (*Time* − *τ*<sub>1</sub>)<sup>+</sup> is written as a continuous variable measuring zero if (*Time* − *τ*<sub>*k*</sub>) ≤ 0, and the time elapsed since the kth joinpoint if (*Time* − *τ*<sub>*k*</sub>) > 0. Lastly, *δ*<sub>*k*</sub> measures the change in trend at each joinpoint *τ*<sub>*k*</sub> [8,9]. The JR model provides an estimation of the trend change over the distinct time segments identified by the analysis, called monthly percent change (MPC), and the trend change in the entire study period, called average monthly percent change (AMPC).

## 2.3. Data-generating mechanism

We generated controlled datasets to evaluate both software performances under varying trend changes, joinpoint locations, and presence or absence of residual autocorrelation. A "burn in" period—initial phase of a simulation process where results are discarded to ensure that any starting biases or transient effects do not affect the final datasets—of 300 random numbers was added between each dataset [15].

For each scenario, we generated 1000 datasets of 100 months using an autoregressive (AR) model of order
**What is new?**

**Key findings**

* In simulated data, JRP exhibited superior performance metrics in the presence of residual autocorrelation, while R outperformed it in the absence of autocorrelation.

* In real-world data, JRP consistently identified more joinpoints in the time series and estimated wider confidence intervals.

* Both JRP and R software exhibited limitations in identifying early trend changes within the time series.

**What this adds to what was known?**

* This study provides evidence on the performance of joinpoint analysis in JRP and R software using both simulated and real-world health care data.

**What is the implication and what should change now?**

* The choice of the joinpoint analysis software should be guided by the characteristics of the time series.

* Researchers analyzing health care time series data should consider using JRP in cases where residual autocorrelation is anticipated, as it handles this complexity more effectively.

1 [16]. We created three scenarios without residual autocorrelation, one with no joinpoint (0% trend change) and two with 1 joinpoint at month 50 (ie, middle of the dataset) and a change in trend ($\delta_1$) of 0.1 or 0.2 (ie, moderate or important change, respectively) in logarithmic scale [17].

Residual autocorrelation, the correlation between an observation and the immediately preceding observation in a time series, is often present in health data. Health outcomes occurring 1 month tend to be more similar to those in neighboring months within the same time of year eg, the number of mental health (MH)-related hospitalizations is usually higher in winter months [18]. These seasonal variations in disease occurrence are mostly responsible for residual autocorrelation. To mimic this, we created seven scenarios with residual autocorrelation by multiplying the first-term error, $\epsilon_t$ (Equation 1), by a $\sqrt{\frac{1}{1-\rho^2}}$ factor, with $\rho$ being the autocorrelation coefficient set in this study at 0.2 [17,19,20]. The joinpoint was located at month 25, 50, or 75 (ie, early, in the middle, and late in the datasets). We planned and reported our study using the structured approach of Morris et al. for simulation studies [16].

## 2.4. Real-world data

We used hospital data from the French National Hospital Discharge Database (Programme de Médicalisation des Systèmes d'Information) accessible via the Agence technique de l'information sur l'hospitalisation platform [21]. This medico-administrative database contains anonymized patient demographics, discharge diagnoses, and procedures performed during hospital stays [22,23]. It comprises patient health claims data from all public and private health institutions in France [24].

We retrieved all overnight hospitalizations related to MH disorders in school-aged children (6–17 years), between January 1, 2016, and December 31, 2023, in mainland France (excluding overseas territories). Eligible hospitalizations were those with an F01-F99 code from the International Classification of Diseases, 10th version, as the principal discharge diagnosis (ie, primary reason for hospitalization) [25–28]. Then, we performed a JR analysis of the monthly proportion of MH-related hospitalizations calculated as the number of MH-related hospitalizations over the total number of hospitalizations. Analysis was stratified by age and sex groups (4 groups: girls/boys 6–11 years/12–17 years). To account for seasonality, we performed a multiplicative decomposition of the time series data in R prior to both analyses.

## 2.5. Study estimands

The primary estimands assessed in all simulated datasets were the number and location of the joinpoint(s) identified. The estimands of the analysis on real-world data were the number of joinpoint(s) identified and the AMPC.

## 2.6. Statistical methods

In the JRP, the residual autocorrelation was accounted for by allowing the software to calculate the autocorrelation parameter using the “First-order autocorrelation estimated from the data” option [29]. In R, residual autocorrelation was corrected using the Newey-West method with a lag equal to 1 [30,31]. In the scenarios where no residual autocorrelation was introduced, we fitted uncorrelated models on both software. Lastly, we set a maximum of three joinpoints for our analyses on the simulated data (our generated datasets comprised none or 1 joinpoint) and four joinpoints for those on the real-world data (for clinical relevance and interpretation) [8,32]. Further, for model selection, we used the Bayesian Information Criteria (BIC), and the model with the lowest BIC was selected as the best fitted model [33,34].

## 2.7. Performance measures for simulated data

For JRP analysis on simulated data, we calculated 4 metrics to compare the performances of both software: (1) the accuracy: defined as the percentage of datasets, out of the
1000 replicates, where 1 joinpoint was identified and the 95% confidence interval (95% CI) of the estimated joinpoint included the true time point of change; (2) the specificity (ie, type I error): defined as the percentage of datasets, out of the 1000 replicates, where no joinpoint was identified; (3) the coverage of the 95% CI: defined as the percentage of datasets, among those where 1 joinpoint was identified, whose 95% CI of the estimated joinpoint included the true time point of change; and (4) the coverage of the 95% CI of the MPC for the last segment: defined as the percentage of simulated datasets where either no joinpoint was correctly identified and the 95% CI of the estimated MPC included the true MPC, or where 1 joinpoint was correctly identified, the 95% CI of the joinpoint included the true change point, and the 95% CI of the estimated MPC for the last segment included the true MPC for that segment.

# 3. Results

## 3.1. Analysis of simulated data

### 3.1.1. Without residual autocorrelation of data

In the scenario with no change in trend (no joinpoint), JRP and R analysis demonstrated strong specificity (Fig 1 and Table 1). Specifically, R analysis exhibited the highest specificity at 97.9%, while that of JRP was 92.7% of the datasets. The coverage of the 95% CI of the MPC for the last segment was very different between the two software: 93.0% using the JRP and 0% using R.

In the scenario with a moderate trend change ($δ_1$ = 0.1), JRP identified 1 joinpoint in 85.3% of the datasets, but the accuracy was estimated at 79.6% (Fig 1 and Table 1). The 95% CI coverage was 93.3%, and the mean size of the 95% CI was 25.5 months. Conversely, analysis with R detected 1 joinpoint in 97.5% of the datasets, with an accuracy of 89.3%. The 95% CI coverage was of 91.6%, and the mean size of 95% CI was estimated at 18.1 months. The coverage of the 95% CI of the MPC for the last segment was 97.7% using the JRP and 98.2% using R.

In the scenario of an important trend change ($δ_1$ = 0.2), JRP's performance declined: accuracy was estimated at 59.0%, coverage at 81.7%, and mean size of the 95% CI of 12.1 months (Fig 1 and Table 1). Conversely, R successfully identified 1 joinpoint in 69.4% of the datasets, with the 95% CI coverage was estimated at 76.8% and the mean size of the 95% CI at 10.1 months. The coverage of the 95% CI of the MPC for the last segment was 97.9% using the JRP and 98.3% using R.

### 3.1.2. With residual autocorrelation of data

In the scenario with no trend change, JRP and R exhibited a specificity exceeding 90% (Fig 1 and Table 1). JRP did not identify any joinpoint in 90.5% of datasets, and R in 93.7% of datasets. The coverage of the 95% CI of the MPC for the last segment was 92.9% using the JRP and 0% using R.

In scenarios involving a moderate change in trend, when the change was placed at month 25, both software showed a decline in accuracy, with 44.3% for JRP and 40.1% for R.

<figure><img src="image_2.png" /><figcaption>**Figure 1.** Distribution of the number of joinpoints identified by the JRP and R for the different scenarios. JRP, Joinpoint Regression Program; R, R "segmented" package.</figcaption></figure>
(Fig 1 and Table 1). JRP showed a coverage of the 95% CI of 92.1% and the mean size of the 95% CI of 48.2 months. R displayed 95% CI coverage of 74.0% and mean size of 18.3 months. Both software had a low coverage of the 95% CI of the MPC for the last segment: 4.8% for JRP and 0.7% for R. When the trend change was introduced in the middle of the dataset (month 50), the performance of both software improved. JRP showed an accuracy of 74.6%, 95% CI coverage of 92.4%, mean size of the 95% CI of 34.6 months, and coverage of the 95% CI of the MPC for the last segment of 96.7%. On the other hand, R displayed an accuracy of 77.0%, 95% CI coverage of 84.2%, mean size of the 95% CI of 18.5 months, and coverage of the 95% CI of the MPC for the last segment of 95.5%. In cases where the trend change was introduced toward the end of the dataset (month 75), JRP achieved an accuracy of 72.6%, 95% CI coverage was 95.0%, mean size of the 95% CI was 48.2 months, and coverage of the 95% CI of the MPC for the last segment was 91.8%. On the other hand, R showed an accuracy of 52.8%, coverage of the 95% CI of 67.1%, mean size of 21.0 months, and coverage of the 95% CI of the MPC for the last segment was 90.7%.

In the scenarios involving the highest level of trend change, when the change occurred early in the datasets, JRP identified 1 joinpoint in 13.5% of the datasets and R in 17.5% (Fig 1 and Table 1). Both software detected two joinpoints in the majority of the datasets, with 65.1% for the JRP and 72.0% for R. For the analysis using JRP, the accuracy dropped to 9.8%, the coverage of the 95% CI was 72.6% with a mean size of the 95% CI of 32.5 months, and the coverage of the 95% CI of the MPC for the last segment was 30.5%. With the R analysis, the accuracy

was at 7.0%, the coverage and size of the 95% CI were 40.0% and 11.8 months, respectively, and the coverage of the 95% CI of the MPC for the last segment was 18.6%. When the change in trend occurred at month 50, JRP displayed an accuracy of 60.4%, 95% CI coverage of 83.8%, mean size of the 95% CI of 14.8 months, and coverage of the 95% CI of the MPC for the last segment of 98.6%. In contrast, R showed an accuracy of 62.2%, 95% CI coverage of 74.0%, mean size of the 95% CI of 10.3 months, and coverage of the 95% CI of the MPC for the last segment of 96.9%. In the final scenario, where the change in trend occurred at month 75, JRP had an accuracy of 81.2%, coverage of the 95% CI of 94.3%, mean size of the 95% CI of 17.9 months, and coverage of the 95% CI of the MPC for the last segment of 70.7%. On the other hand, R showed an accuracy of 68.6%, coverage of the 95% CI of 77.5%, mean size of the 95% CI of 11.3 months, and coverage of the 95% CI of the MPC for the last segment of 62.8%.

## 3.2. Analysis on real-world hospital data

In the analysis of the proportions of MH-related hospitalizations among girls aged 6 to 11 years, the JRP identified four joinpoints and an AMPC of 0.11% (95% CI: -0.04% to 0.27%) (Fig 2 and Table 2), whereas the R analysis detected only 1 joinpoint and an AMPC of 0.05% (95% CI: -0.03 to 0.14). Among boys aged 6 to 11 years, both software detected three joinpoints, two of which were identified at the same month. JRP analysis estimated a monthly decrease of 0.10% (95% CI: -0.19%; -0.01%), and the R analysis estimated a monthly decrease of 0.11% (95% CI: -0.18%; -0.04%) over the study period.

<figure><img src="image_3.png" /><figcaption>**Figure 2.** MH-related hospitalizations among children and adolescents between 2016 and 2023, stratified by sex and age group. Observed (gray dots) and estimated monthly MH-related hospitalizations proportion among children (6–11 years) and adolescents (11–17 years), stratified by age-group and sex-group, were based on observed data using the log-linear regression model with JRP (dashed black line) and R (solid black line). The identified joinpoints are represented using vertical lines: dashed and black when using JRP, solid and black when using R, and dotted and red when both software identified the same joinpoint (For interpretation of the references to color in this figure legend, the reader is referred to the Web version of this article.). MH, mental health; JRP, Joinpoint Regression Program; R, R "segmented" package.</figcaption></figure>
<table><caption>**Table 2.** Joinpoints identified in the trends of pediatrics mental-health related hospitalizations by the JRP and R</caption><thead><tr><th></th><th>Sex</th><th>Age category</th><th>Joinpoint 1 (95% CI)</th><th>Joinpoint 2 (95% CI)</th><th>Joinpoint 3 (95% CI)</th><th>Joinpoint 4 (95% CI)</th><th>AMPC (%) (95% CI)</th></tr></thead><tbody><tr><td rowspan="2">JRP</td><td rowspan="2">Girls</td><td>06–11</td><td>12/2019<br>(12/2016; 06/2020)</td><td>04/2020<br>(11/2019; 01/2021)</td><td>02/2021<br>(04/2020; 06/2021)</td><td>06/2021<br>(11/2020; 06/20,203)</td><td>0.11 (–0.04; 0.27)</td></tr><tr><td>12–17</td><td>02/2020<br>(12/2018; 02/2020)</td><td>06/2020<br>(05/2020; 07/2020)</td><td>11/2020<br>(10/2020; 12/2020)</td><td>07/2023<br>(05/2022; 09/2023)</td><td>0.33 (0.29; 0.36)</td></tr><tr><td rowspan="2">Boys</td><td rowspan="2">06–11</td><td>12/2019<br>(06/2019; 01/2020)</td><td>04/2020<br>(03/2020; 06/2020)</td><td>11/2020<br>(09/2020; 01/2021)</td><td></td><td>–0.10 (–0.19; –0.01)</td></tr><tr><td>12–17</td><td>11/2019<br>(06/2019; 02/2020)</td><td>06/2020<br>(04/2020; 09/2020)</td><td>04/2021<br>(01/2021; 08/2021)</td><td>12/2022<br>(06/2022; 05/2023)</td><td>–0.09 (–0.11; –0.06)</td></tr><tr><td rowspan="2">R</td><td rowspan="2">Girls</td><td>06–11</td><td>02/2021<br>(09/2020; 07/2021)</td><td></td><td></td><td></td><td>0.05 (–0.03; 0.14)</td></tr><tr><td>12–17</td><td>03/2020<br>(02/2020; 04/2020)</td><td>05/2020<br>(04/2020; 06/2020)</td><td>01/2021<br>(12/2020; 02/2021)</td><td></td><td>0.37 (0.35; 0.39)</td></tr><tr><td rowspan="2">Boys</td><td rowspan="2">06–11</td><td>01/2020<br>(11/2019; 02/2020)</td><td>04/2020<br>(03/2020; 05/2020)</td><td>11/2020<br>(10/2020; 12/2020)</td><td></td><td>–0.11 (–0.18; –0.04)</td></tr><tr><td>12–17</td><td>01/2018<br>(05/2017; 10/2018)</td><td>12/2021<br>(07/2021; 05/2022)</td><td>12/2022<br>(08/2022; 03/2023)</td><td></td><td>–0.07 (–0.10; –0.04)</td></tr></tbody></table>

JRP, Joinpoint Regression Program; R, R “segmented” package; CI, confidence interval; AMPC, average monthly percent change.

For girls aged 12–17 years, the JRP identified four joinpoints and showed an AMPC of 0.33% (95% CI: 0.29%–0.36%), and the R analysis detected three joinpoints and an AMPC at 0.37% (95% CI: 0.35%–0.39%). For boys aged 12–17 years, the JRP identified four joinpoints and an AMPC of –0.09% (95% CI: –0.11%; –0.06%), and the R analysis detected three joinpoints with an AMPC of –0.07% (95% CI: –0.10%; –0.04%).

## 4. Discussion

In simulated data without residual autocorrelation, analysis using R slightly outperformed JRP in terms of accuracy for all scenarios. Both had similar coverage of the 95% CI of the MPC for the last segment, except when no joinpoint was introduced and R's coverage was 0%. With residual autocorrelation, JRP showed higher accuracy than R when the change in trend occurred late in the time series. When the change in trend occurred in the middle of the datasets, R showed a better accuracy than JRP. The earlier the change in trend in the datasets, the worse the accuracy of both software. Regarding the MPC of the last segment, coverage of the 95% CI was higher with JRP, although it remained low when the change in trend occurred early in the time series. When no joinpoint was introduced, R outperformed the specificity of JRP, but the coverage of the 95% CI of the MPC for the last segment remained 0% using R. For all scenarios, with or without residual autocorrelation, coverage of the 95% CI of the joinpoint was higher when the analysis was performed using the JRP. Finally, in the analysis of real-world data, JRP tended to detect more joinpoints than R, but overall the AMPC were similar.

The primary challenge observed in the simulation study was the difficulty of both software to handle residual

autocorrelation in time series effectively [35]. When residual autocorrelation was introduced, the accuracy of both JRP and R declined, highlighting the difficulty of both software in managing the complexity of autocorrelated data. Our findings indicated that with residual autocorrelation, JRP generally outperforms R. Hence, JRP might handle the complexities introduced by autocorrelated data [36]. In real-world health care data, where residual autocorrelation is frequently present and changes in trend are expected due to interventions or evolving patient populations, JRP may be a more reliable approach to data analysis. However, the tendency of JRP analysis to overdetect data joinpoints and produce wider 95% CI reflect a trade-off between detection reliability and the precision of estimated joinpoints. Nevertheless, wider 95% CI enabled JRP to achieve better coverage of the 95% CI of the MPC for the last segment. Then, neither software performed well for trend changes that occurred early in the time series. Indeed, when a trend change is positioned early or late in the series, there are fewer data points on each side, making it more difficult to reliably estimate the slope (trend change). This asymmetry reduces statistical power and may contribute to the lower detection rate observed [8]. In addition, the grid search algorithm used in JRP tends to place joinpoints where they account for the greatest amount of variance. This often favors more central locations and may result in more joinpoints being detected when the true change point is near the beginning of the time series, as the algorithm seeks to minimize the sum of squared errors [37]. It seems that JRP and R analyses, like other types of analysis, may require a period with a stable trend to accurately detect changes, implying that early trend shifts might be missed or inaccurately characterized by both methods [1,38,39].

Furthermore, our results demonstrated that the R analysis outperformed the JRP in scenarios without residual
autocorrelation. Specifically, R exhibited slightly higher specificity, indicating a lower likelihood of falsely detecting a joinpoint when none is present (i.e, type I error) [13]. However, the coverage of the 95% CI of the MPC for the last segment revealed that R did not accurately estimate the trend when no joinpoint was present.

Of note, the JRP is more user-friendly and accessible to analyze data from various contexts (eg, different numbers of joinpoints) [40]. It supports six model selection methods, providing flexibility in identifying significant trend changes [41]. However, the JRP does not allow to take seasonality into account and only performs linear or log-linear regression [29,32]. In contrast, R requires extensive programming skills and does not support permutation tests for more than two joinpoints, which limits its use for longer datasets but offers a more adaptable and customizable approach with the possibility to perform many types of regression (eg, quasi-Poisson) and residual analysis [42].

We acknowledged some limitations in our study. We only simulated datasets with a single joinpoint, a single autocorrelation coefficient and without seasonality. Indeed, we choose to limit our simulations to these options because they were available in both software. Hence to enable a direct comparison of the two software under equivalent conditions, we did not implement the optimal performance options for each software individually. A comparative evaluation of both software over a range of ρ values and number of joinpoints may yield meaningful insights for future research [13].

## 5. Conclusion

In conclusion, both the JRP and R "segmented" package have distinct strengths, and their use should be guided by the specific characteristics of the time-series dataset. For datasets without residual autocorrelation and a stable baseline—first joinpoint occurring at least after one-third of total length of the time series—the R "segmented" package provides greater specificity and accuracy. However, in datasets typical of health care data, where residual autocorrelation and trend changes are expected, analysis using the JRP may yield more reliable estimates, provided that seasonality is addressed through prior decomposition.

## CRediT authorship contribution statement

**Lucie Noé:** Writing – review & editing, Writing – original draft, Visualization, Validation, Methodology, Formal analysis, Data curation.
**Zaba Valtuille:** Writing – review & editing, Validation, Supervision, Methodology.
**Emilie Lanoy:** Writing – review & editing.
**Sandrine Katsahian:** Writing – review & editing.
**Florentia Kaguelidou:** Writing – review & editing, Validation, Supervision, Project administration, Conceptualization.

## Declaration of competing interest

There are no competing interests for any authors.

## Data availability

The authors do not have permission to share data.

## References

[1] Wagner AK, Soumerai SB, Zhang F, Ross-Degnan D. Segmented regression analysis of interrupted time series studies in medication use research. J Clin Pharm Ther 2002;27:299–309.

[2] Hategeka C, Ruton H, Karamouzian M, Lynd LD, Law MR. Use of interrupted time series methods in the evaluation of health system quality improvement interventions: a methodological systematic review. BMJ Glob Health 2020;5:e003567.

[3] Ewusie JE, Soobiah C, Blondal E, Beyene J, Thabane L, Hamid JS. Methods, applications and challenges in the analysis of interrupted time series data: a scoping review. JMDH 2020;13:411–23.

[4] Sprent P. Some hypotheses concerning two phase regression lines. Biometrics 1961;17:634.

[5] Lange S, Rehm J, Tran A, L Bagge C, Jasilonidis D, Kaplan MS, et al. Comparing gender-specific suicide mortality rate trends in the United States and Lithuania, 1990–2019: putting one of the “deaths of despair” into perspective. BMC Psychiatry 2022;22:127.

[6] Radojčić MR, Pierce M, Hope H, Senior M, Taxiarchi VP, Trefan L, et al. Trends in antipsychotic prescribing to children and adolescents in England: cohort study using 2000–19 primary care data. Lancet Psychiatry 2023;10:119–28.

[7] Logue TC, Wen T, Monk C, Guglielminotti J, Huang Y, Wright JD, et al. Trends in and complications associated with mental health condition diagnoses during delivery hospitalizations. Am J Obstet Gynecol 2022;226:405.e1–405.e16.

[8] Kim H-J, Fay MP, Feuer EJ, Midthune DN. Permutation tests for joinpoint regression with applications to cancer rates. Statist Med 2000;19:335–51.

[9] Liu B, Kim H-J, Feuer EJ, Graubard BI. Joinpoint regression methods of aggregate outcomes for complex survey data. J Surv Stat Methodol 2023;11:967–89.

[10] Muggeo VMR. Estimating regression models with unknown break-points. Stat Med 2003;22:3055–71.

[11] Gunnarsdottir OS, Rafnsson V. Accidental poisoning, intentional self-harm and event of undetermined intent mortality over 20 years in Iceland: a population-based cohort study. BMJ Open 2020;10: e034590.

[12] Frequently Asked Questions. Joinpoint help system. Available at: https://surveillance.cancer.gov/help/joinpoint/tech-help/frequently-asked-questions. Accessed November 4, 2024.

[13] Gillis D, Edwards BPM. The utility of joinpoint regression for estimating population parameters given changes in population structure. Heliyon 2019;5:e02515.

[14] Muggeo V. Segmented: an R package to fit regression models with broken-line relationships. R News 2008;8:20–5.

[15] Huitema BE, McKean JW. Identifying autocorrelation generated by various error processes in interrupted time-series regression designs: a comparison of AR1 and portmanteau tests. Educ Psychol Meas 2007;67:447–59.

[16] Morris TP, White IR, Crowther MJ. Using simulation studies to evaluate statistical methods. Stat Med 2019;38:2074–102.

[17] Turner SL, Forbes AB, Karahalios A, Taljaard M, McKenzie JE. Evaluation of statistical methods used in the analysis of interrupted time series studies: a simulation study. BMC Med Res Methodol 2021;21:181.
[18] Talarico F, Tian J, Song Y, Liu YS, Pierce D, Metes D, et al. Disruption of seasonal trends in mental health help-seeking behaviours during the COVID-19 pandemic. J Affective Disord Rep 2025;20:100881.

[19] Xu X-H, Zhan Z-S, Shi C, Xiao T, Ou CQ. A novel correction method for modelling parameter-driven autocorrelated time series with count outcome. BMC Public Health 2024;24:901.

[20] Petit-Bois M, Baek EK, Van Den Noortgate W, Beretvas SN, Ferron JM. The consequences of modeling autocorrelation when synthesizing single-case studies using a three-level model. Behav Res 2016;48:803-12.

[21] ATIH. Agence technique de l'information sur l'hospitalisation. Available at: https://www.atih.sante.fr/. Accessed November 4, 2024.

[22] Durrieu G, Batz A, Rousseau V, Bondon-Guitton E, Petiot D, Montastruc JL. Use of administrative hospital database to identify adverse drug reactions in a pediatric university hospital. Eur J Clin Pharmacol 2014;70:1519-26.

[23] Kovess-Masfety V, Rabaté L, Caby D, Nicaise P. French mental health care system: analysis of care utilisation patterns and the case for a stepped care approach. Health Policy 2023;138:104945.

[24] Tuppin P, Rudant J, Constantinou P, Gastaldi-Ménager C, Rachas A, de Roquefeuil L, et al. Value of a national administrative database to guide public decisions: from the système national d'informationterrégimes de l'Assurance Maladie (SNIIRAM) to the système national des données de santé (SNDS) in France. Revue Épidémiol Santé Publique 2017;65:S149-67.

[25] travail M du, solidarités de la santé et des, travail M du. Diagnostic principal (DP). Ministère du travail, de la santé et des solidarités. 2024. Available at: https://sante.gouv.fr/professionnels/gerer-un-etstablissement-de-sante-medico-social/financement/financement-des-etstablissements-de-sante-10795/financement-des-etstablissements-de-sante-glossaire/article/diagnostic-principal-dp. Accessed June 28, 2024.

[26] Neil AL, Islam F, Kariuki M, Laurens KR, Katz I, Harris F, et al. Costs for physical and mental health hospitalizations in the first 13 years of life among children engaged with child protection services. Child Abuse Neglect 2020;99:104280.

[27] Dlouhy M. Mental health care system and mental health expenditures in the Czech Republic. J Ment Health Policy Econ 2004;7:159-65.

[28] Tran QN, Lambeth LG, Sanderson K, de Graaff B, Breslin M, Tran V, et al. Emergency department presentations with a mental health diagnosis in Australia, by jurisdiction and by sex, 2004-05 to 2016-17. Emerg Med Australas 2020;32:383-92.

[29] Hincapie-Castillo JM, Goodin A. Using joinpoint regression for drug utilization research: tutorial and case study of prescription opioid use in the United States. Pharmacoepidemiol Drug 2023;32:509-16.

[30] Bottomley C, Ooko M, Gasparrini A, Keogh RH. In praise of prais-winsten: an evaluation of methods used to account for autocorrelation in interrupted time series. Stat Med 2023;42:1277-88.

[31] Newey WK, West KD. A simple, positive semi-definite, heteroskedasticity and autocorrelation consistent covariance matrix. Econometrica 1987;55:703.

[32] Colonna M. Analyse descriptive de la tendance évolutives d'observations épidémiologiques avec le logiciel Joinpoint: un outil simple, en apparence. Revue Épidémiologie Santé Publique 2011;59:123-33.

[33] Kim H-J, Chen H-S, Midthune D, Wheeler B, Buckman DW, Green D, et al. Data-driven choice of a model selection method in joinpoint regression. J Appl Stat 2023;50:1992-2013.

[34] Schwarz G. Estimating the dimension of a model. Ann Stat 1978;6: 461-4. https://doi.org/10.1214/aos/1176344136.

[35] Bernal JL, Cummins S, Gasparrini A. Interrupted time series regression for the evaluation of public health interventions: a tutorial. Int J Epidemiol 2016;46:348.

[36] Hudson J, Fielding S, Ramsay CR. Methodology and reporting characteristics of studies using interrupted time series design in health-care. BMC Med Res Methodol 2019;19:137.

[37] Grid Search Method - Details. Joinpoint help system. Available at: https://surveillance.cancer.gov/help/joinpoint/setting-parameters/method-and-parameters-tab/method/method-grid-search-or-hudsons. Accessed July 4, 2025.

[38] Penfold RB, Zhang F. Use of interrupted time series analysis in evaluating health care quality improvements. Acad Pediatr 2013;13: S38-44.

[39] Li L, Cuerden MS, Liu B, Shariff S, Jain AK, Mazumdar M. Three statistical approaches for assessment of intervention effects: a primer for practitioners. Risk Manag Healthc Policy 2021;14:757.

[40] Kim H-J, Yu B, Feuer EJ. Inference in segmented line regression: a simulation study. J Stat Comput Simulation 2008;78:1087-103.

[41] Kim H-J, Chen H-S, Byrne J, Wheeler B, Feuer EJ. Twenty years since joinpoint 1.0: two major enhancements, their justification, and impact. Stat Med 2022;41:3102-30.

[42] Lindelöv J. mcp: an R package for regression with multiple change points. 2020. Available at: https://osf.io/fzqxv_v1. Accessed September 15, 2025.