{"title":"Evaluation of Methods for Joinpoint Analysis of Time Series Using Simulated and Real-World Data","authors":"Lucie Noé , Zaba Valtuille , Emilie Lanoy , Sandrine Katsahian , Florentia Kaguelidou","doi":"10.1016/j.jclinepi.2025.111966","DOIUrl":null,"url":null,"abstract":"<div><h3>Objectives</h3><div>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 “<em>segmented</em>” package in detecting joinpoints using simulated and real-world data on pediatric mental health (MH)–related hospitalizations.</div></div><div><h3>Study Design and Setting</h3><div>Simulated datasets (<em>n</em> = 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).</div></div><div><h3>Results</h3><div>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.</div></div><div><h3>Conclusion</h3><div>The choice of JR software should be guided by the characteristics of the dataset. The R “<em>segmented”</em> 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.</div></div><div><h3>Plain Language Summary</h3><div>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.</div></div>","PeriodicalId":51079,"journal":{"name":"Journal of Clinical Epidemiology","volume":"187 ","pages":"Article 111966"},"PeriodicalIF":5.2000,"publicationDate":"2025-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Clinical Epidemiology","FirstCategoryId":"3","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0895435625002999","RegionNum":2,"RegionCategory":"医学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"HEALTH CARE SCIENCES & SERVICES","Score":null,"Total":0}
引用次数: 0
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.
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.
期刊介绍:
The Journal of Clinical Epidemiology strives to enhance the quality of clinical and patient-oriented healthcare research by advancing and applying innovative methods in conducting, presenting, synthesizing, disseminating, and translating research results into optimal clinical practice. Special emphasis is placed on training new generations of scientists and clinical practice leaders.