{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,30]],"date-time":"2026-07-30T19:21:30Z","timestamp":1785439290752,"version":"3.56.0"},"reference-count":42,"publisher":"Frontiers Media SA","license":[{"start":{"date-parts":[[2023,8,16]],"date-time":"2023-08-16T00:00:00Z","timestamp":1692144000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["frontiersin.org"],"crossmark-restriction":true},"short-container-title":["Front. Comput. Sci."],"abstract":"<jats:sec><jats:title>Introduction<\/jats:title><jats:p>Methods and tools evaluating treatment effect have been primarily developed for binary type of treatment. Yet, treatment is rarely binary outside the experimental setting, varies by dosage, frequency and time. Treatment is routinely adjusted, initiated or stopped when being administered over a period of time.<\/jats:p><\/jats:sec><jats:sec><jats:title>Methods<\/jats:title><jats:p>Both Gaussian Process (GP) regression and Bayesian additive regression tree (BART) have been used successfully for handling complex setting involving time-varying treatments that is either adaptive or non-adaptive. Here, we introduce an application programming interface (API) that implements both BART and GP for estimating averaged treatment effect (ATE) and conditional averaged treatment (CATE) for the two-stage time-varying treatment strategies.<\/jats:p><\/jats:sec><jats:sec><jats:title>Results<\/jats:title><jats:p>We provide two real applications for evaluating comparative effectiveness of time-varying treatment strategies. The first example evaluates an early aggressive treatment strategies for caring children with newly diagnosed Juvenile Idiopathic Arthritis (JIA). The second evaluates the persistent per-protocol treatment effectiveness in a large randomized pragmatic trial. The examples demonstrate the use of the API calling from R and Python, for handling both non-adaptive or adaptive treatments, with presences of partially observed or missing data issues. Summary tables and interactive figures of the results are downloadable.<\/jats:p><\/jats:sec>","DOI":"10.3389\/fcomp.2023.1183380","type":"journal-article","created":{"date-parts":[[2023,8,17]],"date-time":"2023-08-17T14:40:03Z","timestamp":1692283203000},"update-policy":"https:\/\/doi.org\/10.3389\/crossmark-policy","source":"Crossref","is-referenced-by-count":2,"title":["An application programming interface implementing Bayesian approaches for evaluating effect of time-varying treatment with R and Python"],"prefix":"10.3389","volume":"5","author":[{"given":"Chen","family":"Chen","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Bin","family":"Huang","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Michal","family":"Kouril","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jinzhong","family":"Liu","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Hang","family":"Kim","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Siva","family":"Sivaganisan","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jeffrey A.","family":"Welge","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Melissa P.","family":"DelBello","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1965","published-online":{"date-parts":[[2023,8,16]]},"reference":[{"key":"B1","volume-title":"Annual Atlantic Causal Inference Conference - Data Challenge","year":"2019"},{"key":"B2","unstructured":"BodoryH.\n            HuberM.\n            KueckJ.\n          causalweight: Estimation Methods for Causal Inference Based on Inverse Probability Weighting, R package version 1.0.42023"},{"key":"B3","doi-asserted-by":"publisher","first-page":"1771","DOI":"10.1002\/art.11156","article-title":"Understanding the window of opportunity concept in early rheumatoid arthritis","volume":"48","author":"Boers","year":"2003","journal-title":"Arthrit. Rheumatol"},{"key":"B4","doi-asserted-by":"publisher","first-page":"247","DOI":"10.1214\/14-AOAS788","article-title":"Inferring causal impact using bayesian structural time-series models","volume":"9","author":"Brodersen","year":"2014","journal-title":"Ann. Appl. Stat"},{"key":"B5","unstructured":"CefaluM.\n            RidgewayG.\n            McCaffreyD.\n            MorralA.\n            GriffinB. A.\n            BurgetteL.\n          twang: Toolkit for Weighting and Analysis of Nonequivalent Groups, R package version 2.52021"},{"key":"B6","article-title":"Causalml: Python package for causal machine learning","author":"Chen","year":"2020","journal-title":"arXiv [Preprint]. arXiv"},{"key":"B7","doi-asserted-by":"publisher","first-page":"266","DOI":"10.1214\/09-AOAS285","article-title":"Bart: Bayesian additive regression trees","volume":"4","author":"Chipman","year":"2010","journal-title":"Ann. Appl. Stat"},{"key":"B8","doi-asserted-by":"publisher","first-page":"658","DOI":"10.1002\/art.24516","article-title":"Development and validation of a composite disease activity score for juvenile idiopathic arthritis","volume":"61","author":"Consolaro","year":"2009","journal-title":"Arthri. Rheumat"},{"key":"B9","author":"Dorie","year":"2020","journal-title":"Bartcause: Causal Inference Using Bayesian Additive Regression Trees. R Package Version 1.0\u20132"},{"key":"B10","doi-asserted-by":"crossref","DOI":"10.1201\/b16018","volume-title":"Bayesian Data Analysis","author":"Gelman","year":"2013"},{"key":"B11","doi-asserted-by":"publisher","first-page":"758","DOI":"10.1093\/aje\/kwv254","article-title":"Using big data to emulate a target trial when a randomized trial is not available","volume":"183","author":"Hern\u00e1n","year":"2016","journal-title":"Am. J. Epidemiol"},{"key":"B12","doi-asserted-by":"publisher","first-page":"1391","DOI":"10.1056\/NEJMsm1605385","article-title":"Per-protocol analyses of pragmatic trials","volume":"377","author":"Hern\u00e1n","year":"2017","journal-title":"N. Engl. J. Med"},{"key":"B13","doi-asserted-by":"publisher","first-page":"2446","DOI":"10.1001\/jama.2022.21383","article-title":"Target trial emulation","volume":"328","author":"Hern\u00e1n","year":"2022","journal-title":"JAMA"},{"key":"B14","doi-asserted-by":"publisher","first-page":"251","DOI":"10.1146\/annurev-statistics-031219-041110","article-title":"Bayesian additive regression trees: a review and look forward","volume":"7","author":"Hill","year":"2020","journal-title":"Ann. Rev. Stat. Appl"},{"key":"B15","doi-asserted-by":"publisher","first-page":"217","DOI":"10.1198\/jcgs.2010.08162","article-title":"Bayesian nonparametric modeling for causal inference","volume":"20","author":"Hill","year":"2011","journal-title":"J. Comput. Graph. Stat"},{"key":"B16","doi-asserted-by":"publisher","DOI":"10.1002\/0470090456.ch7","article-title":"\u201cThe propensity score with continuous treatments,\u201d","author":"Hirano","year":"2004","journal-title":"Applied Bayesian Modeling and Causal Inference From Incomplete-Data Perspectives"},{"key":"B17","doi-asserted-by":"publisher","first-page":"1","DOI":"10.18637\/jss.v042.i08","article-title":"MatchIt: Nonparametric preprocessing for parametric causal inference","volume":"42","author":"Ho","year":"2011","journal-title":"J. Statist. Softw"},{"key":"B18","unstructured":"HollowayS. T.\n            LaberE. B.\n            LinnK. A.\n            ZhangB.\n            DavidianM.\n            TsiatisA. A.\n          DynTxRegime: Methods for Estimating Optimal Dynamic Treatment Regimes, R package version 4.122023"},{"key":"B19","doi-asserted-by":"publisher","DOI":"10.25302\/11.2020.ME.140819894","author":"Huang","year":"2020","journal-title":"New Statistical Methods to Compare the Effectiveness of Adaptive Treatment Plans"},{"key":"B20","doi-asserted-by":"publisher","DOI":"10.3389\/fams.2023.1122114","article-title":"Gpmatch: a bayesian causal inference approach using gaussian process covariance function as a matching tool","author":"Huang","year":"2023","journal-title":"Front. Appl. Math. Stat"},{"key":"B21","article-title":"\u201cComparative effectiveness research using electronic health records data: ensure data quality,? in SAGE Research Methods Cases Medicine Health","author":"Huang","year":"2020"},{"key":"B22","doi-asserted-by":"publisher","first-page":"935","DOI":"10.1002\/sim.4155","article-title":"Estimating transformations for repeated measures modeling of continuous bounded outcome data","volume":"30","author":"Hutmacher","year":"2011","journal-title":"Stat. Methods Med. Res"},{"key":"B23","doi-asserted-by":"publisher","first-page":"854","DOI":"10.1198\/016214504000001187","article-title":"Causal inference with general treatment regimes: generalizing the propensity score","volume":"99","author":"Imai","year":"2004","journal-title":"J. Am. Stat. Assoc"},{"key":"B24","doi-asserted-by":"publisher","first-page":"1","DOI":"10.18637\/jss.v070.i04","article-title":"bartMachine: Machine learning with bayesian additive regression trees","volume":"70","author":"Kapelner","year":"2016","journal-title":"J. Statist. Softw"},{"key":"B25","doi-asserted-by":"publisher","first-page":"376","DOI":"10.1089\/cap.2019.0184","article-title":"The importance of second-generation antipsychotic-related weight gain and adherence barriers in youth with bipolar disorders: patient, parent, and provider perspectives","volume":"30","author":"Klein","year":"2020","journal-title":"J. Child Adolesc. Psychopharmacol"},{"key":"B26","doi-asserted-by":"publisher","first-page":"1","DOI":"10.18637\/jss.v081.i01","article-title":"ltmle: an r package implementing targeted minimum loss-based estimation for longitudinal data","volume":"81","author":"Lendle","year":"2017","journal-title":"J. Stat. Softw"},{"key":"B27","doi-asserted-by":"publisher","first-page":"6612","DOI":"10.1002\/sim.3432","article-title":"A comparison of three random effects approaches to analyze repeated bounded outcome scores with an application in a stroke revalidation study","volume":"27","author":"Molas","year":"2008","journal-title":"Stat. Methods Med. Res"},{"key":"B28","first-page":"553","article-title":"\u201cEstimation of the causal effects of time-varying exposures,?","volume-title":"Longitudinal Data Analysis","author":"Robins","year":"2009"},{"key":"B29","doi-asserted-by":"publisher","first-page":"550","DOI":"10.1097\/00001648-200009000-00011","article-title":"Marginal structural models and causal inference in epidemiology","volume":"11","author":"Robins","year":"2000","journal-title":"Epidemiology"},{"key":"B30","doi-asserted-by":"publisher","first-page":"41","DOI":"10.1093\/biomet\/70.1.41","article-title":"The central role of the propensity score in observational studies for causal effects","volume":"70","author":"Rosenbaum","year":"1983","journal-title":"Biometrika"},{"key":"B31","doi-asserted-by":"publisher","first-page":"34","DOI":"10.1214\/aos\/1176344064","article-title":"Bayesian inference for causal effects: the role of randomization","volume":"6","author":"Rubin","year":"1978","journal-title":"Ann. Stat"},{"key":"B32","doi-asserted-by":"publisher","first-page":"263","DOI":"10.1002\/acr.22117","article-title":"Determinants of health-related quality of life in children newly diagnosed with juvenile idiopathic arthritis","volume":"66","author":"Seid","year":"2014","journal-title":"Arthrit. Care Res"},{"key":"B33","unstructured":"SharmaA.\n            KicimanE.\n          DoWhy: A Python package for causal inference, Python package version 0.9.12019"},{"key":"B34","doi-asserted-by":"publisher","first-page":"335","DOI":"10.1080\/15598608.2011.10412032","article-title":"A comparison of posterior simulation and inference by combining rules for multiple imputation","volume":"5","author":"Si","year":"2011","journal-title":"J. Stat. Theory Pract"},{"key":"B35","doi-asserted-by":"publisher","first-page":"112","DOI":"10.1093\/bioinformatics\/btr597","article-title":"Missforest - nonparametric missing value imputation for mixed-type data","volume":"28","author":"Stekhoven","year":"2012","journal-title":"Bioinformatics"},{"key":"B36","doi-asserted-by":"publisher","first-page":"1605","DOI":"10.1136\/ard.2010.143347","article-title":"Aggressive combination drug therapy in very early polyarticular juvenile idiopathic arthritis (acute-jia): a multicentre randomised open-label clinical trial","volume":"70","author":"Tynj\u00e4l\u00e4","year":"2011","journal-title":"Ann. Rheum. Dis"},{"key":"B37","doi-asserted-by":"publisher","first-page":"1","DOI":"10.18637\/jss.v045.i03","article-title":"Mice: multivariate imputation by chained equations in r","volume":"45","author":"van Buuren","year":"2011","journal-title":"J. Stat. Softw"},{"key":"B38","doi-asserted-by":"publisher","first-page":"2012","DOI":"10.1002\/art.34343","article-title":"Trial of early aggressive therapy in polyarticular juvenile idiopathic arthritis","volume":"64","author":"Wallace","year":"2012","journal-title":"Arthrit. Rheumat"},{"key":"B39","doi-asserted-by":"publisher","first-page":"60","DOI":"10.1016\/j.jaacop.2023.03.004","article-title":"Metformin for overweight and obese children with bipolar spectrum disorders treated with second-generation antipsychotics (mobility): Protocol and methodological considerations for a large pragmatic randomized clinical trial","volume":"1","author":"Weldge","year":"2023","journal-title":"J. Am. Acad. Child Adolesc. Psychatry Open"},{"key":"B40","unstructured":"WongL.\n          Causal Inference in Python: A Vignette, Python package version 0.1.32015"},{"key":"B41","doi-asserted-by":"publisher","first-page":"921","DOI":"10.1080\/01621459.2015.1086353","article-title":"Bayesian nonparametric estimation for dynamic treatment regimes with sequential transition times","volume":"111","author":"Xu","year":"2016","journal-title":"J. Am. Stat. Assoc"},{"key":"B42","doi-asserted-by":"publisher","first-page":"159","DOI":"10.1198\/tast.2010.09109","article-title":"A note on bayesian inference after multiple imputation","volume":"64","author":"Zhou","year":"2010","journal-title":"Am. Stat"}],"container-title":["Frontiers in Computer Science"],"original-title":[],"link":[{"URL":"https:\/\/www.frontiersin.org\/articles\/10.3389\/fcomp.2023.1183380\/full","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2023,8,17]],"date-time":"2023-08-17T14:40:08Z","timestamp":1692283208000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.frontiersin.org\/articles\/10.3389\/fcomp.2023.1183380\/full"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,8,16]]},"references-count":42,"alternative-id":["10.3389\/fcomp.2023.1183380"],"URL":"https:\/\/doi.org\/10.3389\/fcomp.2023.1183380","relation":{},"ISSN":["2624-9898"],"issn-type":[{"value":"2624-9898","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,8,16]]},"article-number":"1183380"}}