Template-Type: ReDIF-Paper 1.0 Title: Writing R markdown documents in Stata Abstract: R Markdown, an extension of Pandoc Markdown, is promoted as a grand unified solution to writing computer-generated scientific documents. It inputs a text document and outputs documents in .docx, .html, and .pdf (via LaTeX) formats. The output documents can contain publication-quality tables, graphics, and also equations (in .html or .odf formats). Unsurprisingly, the input text file can be generated with Stata, using the official Stata file command, together with the SSC Archive packages listtab to make the tables and tfinsert to make the rest of the document. I demonstrate how this might be done. Author-Name: Roger Newson Author-Workplace-Name: Queen Mary University Author-Person: pne37 Creation-Date: 20260905 File-URL: http://repec.org/lsug2026/Newson_ohp1.pdf File-URL: http://repec.org/lsug2026/Newson_examples.zip Handle: RePEc:boc:lsug26:01 Template-Type: ReDIF-Paper 1.0 Title: Bootstrapping time-dependent stationary processes Abstract: We present the community-contributed blockboot command to bootstrap time-dependent stationary processes using four schemes that preserve the processes' dependence structure by resampling blocks of observations. These schemes include the nonoverlapping block bootstrap of Carlstein (1986, Annals of Statistics, 14: 1171–1179); the moving block bootstrap of Kunsch (1989, Annals of Statistics, 17: 1217–1241) and Liu and Singh (1992, Exploring the Limits of Bootstrap, ed. LePage and Billard: Wiley); the circular block bootstrap of Politis and Romano (1992, Exploring the Limits of Bootstrap); and the stationary block bootstrap of Politis and Romano (1994, Journal of the American Statistical Association, 89: 1303–1313). An illustration of these four block bootstrap schemes for time-series data in the context of computing the size of unit-root tests extends and updates the findings of Schwert, ”Tests for Unit Roots: A Monte Carlo Investigation“ (1989, Journal of Business and Economic Statistics, 7: 147–159). We find that the results are most sensitive to the choice of block length, which can be specified in the command or computed automatically. Author-Name: Kit Baum Author-Workplace-Name: Boston College Author-Person: pba1 Author-Name: Jesus Otero Author-Workplace-Name: Universidad del Rosario Author-Person: pot11 Creation-Date: 20260905 File-URL: http://repec.org/lsug2026/Baum_blockboot_UK26.pdf Handle: RePEc:boc:lsug26:02 Template-Type: ReDIF-Paper 1.0 Title: Fitting the bivariate mixed Poisson regression model by maximum simulated likelihood Abstract: We introduce bimpoisson, a program to fit the bivariate mixed Poisson regression model by maximum simulated likelihood using the two approaches proposed by Munkin and Trivedi (Simulated maximum likelihood estimation of multivariate mixed-Poisson regression models, with application, Econometrics Journal: 2, 29–48). By default, bimpoisson uses their sampling function approach; optionally their standard MSL approach is available. bimpoisson allows either pseudo–random uniform draws or Halton draws for simulation. Additional options allow use of antithetic acceleration and a first-order bias correction. Like Jumamyradov and Munkin (Biases in maximum simulated likelihood estimation of bivariate models, Journal of Econometric Methods: 11, 55–70), we use a modified version of Munkin and Trivedi’s sampling function to provide better coverage. We also provide postestimation tools to predict conditional count probabilities and expected counts. We examine bimpoisson’s performance using Monte Carlo simulation analysis, and our empirical illustrations fit models using the same bivariate count data as used by Xu and Hardin (Regression models for bivariate count outcomes, The Stata Journal: 16, 301–315) and Munkin and Trivedi (1999). Author-Name: Stephen P. Jenkins Author-Workplace-Name: London School of Economics Author-Person: pje7 Author-Name:Fernando Rios-Avila Author-Workplace-Name: Universidad Privada Boliviana Author-Workplace-Name: London School of Economics Author-Person: pri214 Creation-Date: 20260905 Handle: RePEc:boc:lsug26:03 Template-Type: ReDIF-Paper 1.0 Title: Heteroskedasticity-consistent instrument-free inference in linear regressions with endogenous regressors Abstract: The kinkyreg command (Kripfganz and Kiviet, 2021) implements instrument-free estimation and inference procedures for linear regression models with endogenous regressors. By exploiting nonorthogonality conditions under a range of suppositions on the degree of endogeneity, the ordinary least-squares estimator can be modified to obtain asymptotically valid inference. This avoids appealing too hard to validate external instrumental variables and enables a sensitivity analysis. We propose a refinement of this instrument-free approach to realize robustness regarding both endogeneity and unknown heteroskedasticity under symmetrically distributed disturbances, which can be done with a suitable modification of the moment conditions. Although the resulting estimator is more complex because of nonlinearity in the moment conditions, asymptotic inference is straightforward using standard results for method-of-moments estimators. Author-Name: Sebastian Kripfganz Author-Workplace-Name: University of Exeter Business School Author-Person: pkr246 Author-Name: Jan F. Kiviet Author-Workplace-Name: Universiteit van Amsterdam Author-Person: pki2 Creation-Date: 20260905 Handle: RePEc:boc:lsug26:04 Template-Type: ReDIF-Paper 1.0 Title: Augmenting Stata with artificial intelligence Abstract: Artificial intelligence is rapidly transforming empirical research by reshaping how analysts write code, design workflows, and extend statistical software. This presentation examines how AI can enhance the use of Stata by improving productivity, lowering programming barriers, and enabling more powerful analytical tools. It illustrates practical applications of AI in Stata programming, including code generation, debugging, and optimization, and showcases how AI-assisted approaches can streamline common development tasks. A central focus is the use of AI in the development and modernization of Stata packages, with a detailed case study demonstrating how an existing command can be redesigned and reimplemented using a Stata plugin architecture, yielding substantial performance gains through compiled code and high-efficiency backends while preserving Stata's usability. The presentation discusses how integrating AI into Stata workflows creates opportunities for faster computation and expanded community-driven innovation, reinforcing Stata's role as a flexible and evolving tool for empirical research. Author-Name: Miguel Portela Author-Workplace-Name: Universidade do Minho Author-Name: Tiago Tavares Author-Workplace-Name: Universidade do Minho Author-Person: ppo44 Creation-Date: 20260905 Handle: RePEc:boc:lsug26:05 Template-Type: ReDIF-Paper 1.0 Title: Autonomous research agents for mathematical conjecture testing: Bridging Stata 19 and agentic AI Abstract: As large language models (LLMs) transition from generative chatbots to autonomous reasoning agents, the potential for automating complex scientific discovery workflows has expanded. This presentation introduces an agentic AI framework designed to solve and verify mathematical conjectures—such as those in extremal combinatorics and geometric structures—by leveraging Stata 19 as a primary engine for rigorous statistical validation and structural deep learning. Author-Name: Prasad Kothari Author-Workplace-Name: Blockchain for Healthcare Today Creation-Date: 20260905 Handle: RePEc:boc:lsug26:06 Template-Type: ReDIF-Paper 1.0 Title: Using large language models and coding agents to translate Stata packages: Benefits and risks Abstract: Packages written in Stata are often focused on solving specific problems in specific research domains. Within the research domain, many people use Stata, so code sharing and reuse is possible. The code itself, however, may be high quality and useful to other research domains, but this may be prevented by limited use of Stata in other domains. Translating Stata code to other programming languages may therefore help researchers to reach beyond their own domain, increasing research impact. Translation requires skills in the source and target language, and the research domain, making it unlikely that any individual will be able to perform translation. Large language models (LLM) support translation by amalgamating language and domain-specific knowledge from many sources. We will discuss our experiences in developing a Claude Code plugin that supports domain experts in statistics in translating community-contributed Stata packages to R and Python. The plugin implements four skills: Analyze and plan: Is the package well documented? Which target language? Create a new library or contribute to an existing library. Translation to pseudocode: Translate to pseudocode to support human review without language expertise. Excludes any existing tests. Pseudocode to target language: Translate; add infrastructure to support ongoing open-source development (continuous integration testing, contributing guidelines, licenses). Tests and documentation: Implement any existing Stata tests in target language; summarize test correspondence; highlight missing tests. Review documentation (examples, papers), and translate to target language (for example, Vignettes in R). We used the plugin in workshops with statisticians to translate a selection of Stata packages. We will discuss our experiences in code translation, discussing the quality and applicability of the results. Author-Name: Stephen Thompson Author-Workplace-Name: University College London Author-Name: James Carpenter Author-Workplace-Name; University College London Author-Name: Tra My Pham Author-Workplace-Name; University College London Author-Name: Asif Tamuri Author-Workplace-Name; University College London Author-Name: David Fisher Author-Workplace-Name; University College London Author-Name: David Perez-Suarez Author-Workplace-Name; University College London Author-Name: Matteo Quartagno Author-Workplace-Name; University College London Author-Name:Carlos Diaz Montana Author-Workplace-Name; University College London Creation-Date: 20260905 Handle: RePEc:boc:lsug26:07 Template-Type: ReDIF-Paper 1.0 Title: Beyond hazard ratios: Method-specific reporting for reproducible competing-risk prediction in Stata Abstract: Reporting guidance for prediction models increasingly emphasizes transparency, reproducibility, and external validation. However, competing-risk prognostic models pose specific challenges for reporting absolute risk. Patient-level cumulative incidence predictions cannot usually be reproduced from coefficients or hazard ratios alone; they also depend on event definitions, competing-event coding, covariate transformations, baseline functions, prediction horizons, postestimation routines, and software implementation details. We aim to develop practical, method-specific recommendations for reporting competing-risk prognostic prediction models, focusing on what authors should provide so that another analyst can reproduce predicted cumulative incidence in software such as Stata. Author-Name: Aisha Vayani Author-Workplace-Name: University of Leicester Author-Name: Mark Rutherford Author-Workplace-Name: University of Leicester Creation-Date: 20260905 Handle: RePEc:boc:lsug26:08 Template-Type: ReDIF-Paper 1.0 Title: Applying topological data analysis ball mapper in Stata Abstract: Multivariate datasets are mappable to a multidimensional space in which the coordinate of a data point in each dimension corresponds to the value of a given variable observed for that data point. In two dimensions, with two variables, the result is a scatterplot. Extending the number of variables creates a visualization challenge. This presentation introduces the ballmapper package for implementing topological data analysis ball mapper (TDABM) in Stata. TDABM creates an abstract, topologically faithful, two-dimensional visualization of a dataset without requiring dimensionality reduction or information loss. The value of TDABM is being realized by a growing corpus of applications papers in the humanities and natural sciences. First, the need for TDABM is introduced. Second, the TDABM algorithm is briefly explained through illustrations from the Stata package. Finally, an example implementation is shown such that users can understand how to visualize their own data in Stata. Author-Name: Simon Rudkin Author-Workplace-Name: University of Manchester Author-Person: pru235 Author-Name: Wanling Rudkin Author-Workplace-Name: University of Exeter Creation-Date: 20260905 Handle: RePEc:boc:lsug26:09 Template-Type: ReDIF-Paper 1.0 Title: Financial statistics in Stata Abstract: This talk introduces a suite of new commands in Stata for financial statistics. These new commands are finreturns for easily building various types of asset returns from prices; finportfolio for constructing portfolios; finsummarize for computing summary statistics; finregress for running capital asset pricing model and Fama–MacBeth regressions; and finvalrisk for evaluating historical and model-based value at risk. I combine these commands with Stata's extensive time-series toolkit to demonstrate a workflow for analyzing financial data. Author-Name: David Schenck Author-Workplace-Name: StataCorp Creation-Date: 20260905 Handle: RePEc:boc:lsug26:10 Template-Type: ReDIF-Paper 1.0 Title: Introduction to explainable machine learning using Stata Abstract: Machine learning (ML) has become a powerful tool for modeling complex data and providing accurate predictions. However, the “black-box” nature of many ML models often raises concerns about their explainability and trustworthiness. Explainable machine learning (XML) seeks to address these concerns by enhancing the transparency and understanding of ML predictions. This talk aims to provide a practical guide to XML techniques. It begins with an overview of ensemble decision tree models such as random forests and gradient boosting, which are widely used but often difficult to interpret. I then introduce methods for explaining predictions using both global and local XML techniques. These include state-of-the-art approaches such as SHAP values, individual conditional expectation (ICE) plots, variable importance measures, partial dependence plots, and global surrogate models. Author-Name: Aramayis Dallakyan Author-Workplace-Name: StataCorp Handle: RePEc:boc:lsug26:11 Template-Type: ReDIF-Paper 1.0 Title: Mediation-aligned analysis with a survival outcome and missing data using med4way: Decomposing the effect of contingency management on appointment attendance through therapeutic alliance Abstract: Contingency management (CM)—a behavioral intervention using positive reinforcement such as financial incentives—has strong evidence supporting its use in opioid use disorder (OUD) treatment. Individuals being treated for OUD receive opiate agonist treatment and regular keywork appointments at the start of treatment, with continuous attendance representing a positive outcome. Therapeutic alliance (TA) between patient and keyworker is a proposed process variable through which some of the effect of CM may operate. This presentation examines the extent to which CM's effect on treatment attendance is transmitted via TA, relative to treatment as usual (TAU). This presented two analytic challenges: modeling the time-to-nonattendance outcome as a survival outcome and addressing the substantial amount of missing TA data. We present a principled approach to both challenges within a mediation framework, implemented using the med4way command with the bootstrap function, and multiple imputation procedures in Stata. Author-Name: Louise MacGregor Author-Workplace-Name: Kings College London Author-Name: Kimberley Goldsmith Author-Workplace-Name: Kings College London Author-Name: Nicola Metrebian Author-Workplace-Name: Kings College London Handle: RePEc:boc:lsug26:12 Template-Type: ReDIF-Paper 1.0 Title: From sequential binary models to first-best multinomial choice: A Stata implementation Abstract: This presentation introduces a Stata implementation of a Gentzkow-style framework for studying complementarity between two binary decisions. Building on Gentzkow (2007) and Li and Mora (2022), the approach models the four possible bundles jointly and treats the multinomial choice as the first-best benchmark. Standard bivariate probit models, even with correlated errors, do not capture Hicksian complementarity. Sequential binary models can be informative because they estimate whether one choice affects the other; we establish the bridge between these sequential representations and the first-best multinomial model. This bridge identifies three types of decision-makers: those for whom no sequence is compatible with the first best, those for whom only one ordering is compatible, and those for whom both orderings are compatible. The accompanying Stata module, gentzkow, currently estimates the model using a mixed logit specification and reports complementarity patterns and type probabilities implied by the estimated utilities. We illustrate the usefulness of the approach with household-level data on three-generation families, focusing on whether families live together and whether they share childcare. Author-Name: Ricardo Mora Author-Workplace-Name: Universidad Carlos III Madrid Author-Name: Yunrong Li Author-Workplace-Name: Universidad Carlos III Madrid Handle: RePEc:boc:lsug26:13 Template-Type: ReDIF-Paper 1.0 Title: A flexible Monte Carlo quantitative bias analysis for unmeasured confounding: The qbaconfound command Abstract: Unmeasured confounding is a persistent concern in observational studies. We can quantitatively assess the impact of unmeasured confounding using a quantitative bias analysis (QBA). A probabilistic QBA incorporates external information about the unmeasured confounders via prior distributions for certain parameters (known as bias parameters) that specify the relationship between the unmeasured confounders and the study data. It can be implemented as a Bayesian or Monte Carlo QBA. A Bayesian QBA combines the prior distribution with the data's likelihood function, while a Monte Carlo QBA samples the bias parameters directly from its prior distributions. Software implementations of probabilistic QBAs to unmeasured confounding are scarce and mainly limited to unadjusted analyses of binary variables. We present a new Stata command, qbaconfound, that implements our flexible Monte Carlo QBA. It is applicable to a generalized linear model or survival proportional hazards model and allows for (i) binary, continuous, or categorical exposure and measured confounders; (ii) correlation between; and (iii) one or multiple binary or continuous. To minimize the number of bias parameters, our proposed Monte Carlo QBA does not model directly but instead models the part not explained. (For more information, see Kawabata et. al preprint https://doi.org/10.1101/2025.08.12.25333217.) We illustrate qbaconfound with an example analysis from the National Health and Nutrition Examination Survey study. Author-Name: Rachael Hughes Author-Workplace-Name: University of Bristol Author-Name: Emily Kawabata Author-Workplace-Name: University of Bristol Author-Name: Chin Yang Shapland Author-Workplace-Name: University of Bristol Author-Name: Tom Palmer Author-Workplace-Name: University of Bristol Author-Name: David Carslake Author-Workplace-Name: University of Bristol Author-Name: Kate Tilling Author-Workplace-Name: University of Bristol Handle: RePEc:boc:lsug26:14 Template-Type: ReDIF-Paper 1.0 Title: Panel-data threshold regression with interactive fixed effects Abstract: Threshold regression provides a flexible framework for capturing regime-dependent relationships and has become a widely used tool for uncovering structural breaks, nonlinearities, and state-dependent patterns in data across diverse fields. This presentation introduces a new community-contributed command called xtthreshold, which provides researchers with a complete toolbox for analyzing threshold regression in panel data with interactive fixed effects. The new command can estimate both discontinuous threshold regression and kink regression, both with interactive fixed effects. It further accommodates three alternative specifications of slope heterogeneity: fully homogeneous, fully heterogeneous, and semihomogeneous models. Model selection is facilitated by a modified information criterion capable of discriminating among competing specifications, and inference is supported through confidence intervals and hypothesis testing for all model parameters, in addition to bootstrap-based tests for the existence of nonlinearity. Author-Name: Jan Ditzen Author-Workplace-Name: Libera Università di Bolzano Author-Person: pdi434 Author-Name: Yiannis Karavias Author-Workplace-Name: Brunel University of London Author-Person: pka744 Author-Name: Joakim Westerlund Author-Workplace-Name: Lund University Author-Person: pwe289 Handle: RePEc:boc:lsug26:15 Template-Type: ReDIF-Paper 1.0 Title: Optimal policy learning under budget and coverage constraints: A Stata implementation Abstract: This presentation introduces opl_budget, a new community-contributed command for optimal policy learning under budget and minimum coverage constraints. Using estimated conditional average treatment effects (CATEs) and heterogeneous treatment costs, the command computes welfare-maximizing binary treatment assignment rules subject to a fixed budget and a minimum number of treated units. The command reports welfare gains, treatment coverage, and total policy costs and also allows evaluation of user-defined treatment rules for comparative policy analysis. An empirical example illustrates the use of the command in data-driven policy design and causal inference applications. Author-Name: Giovanni Cerulli Author-Workplace-Name: CNR-IRCrES Author-Person: pce40 Handle: RePEc:boc:lsug26:16 Template-Type: ReDIF-Paper 1.0 Title: mixedpower: A new program for calculating power and sample size for longitudinal mixed models Abstract: Power and sample-size calculations for clinical trials with longitudinal continuous outcome measures are typically performed using simulation, with a perception that analytic solutions are either complex or intractable. However, there is a straightforward general approach using matrix algebra that is perhaps not widely appreciated and has been under-utilized. A new community-contributed command, mixedpower, instantaneously performs these calculations for two-level mixed models, allowing for a wide variety of treatment-effect specifications and covariance structures, including “marginal” models where the within-subject error terms are correlated across time. The command can also estimate the impact on power and resulting bias from incorrectly assuming a specific treatment effect, such as a proportionate slope change. Other essential requirements of a realistic trial, such as dropout, staggered recruitment, and unequal allocation ratios are also readily incorporated. A key feature is the ability to enter variance parameters either manually or automatically, extracted from a fitted model in memory, saving both time and potential mistakes. Other companion programs are introduced such as mvmixedpower for multivariate mixed models when there is more than one outcome, and trial counts, which helps the user easily specify plausible levels of data missingness due to partial follow-up and dropout. Author-Name: Matthew Burnell Author-Workplace-Name: University College London Handle: RePEc:boc:lsug26:17 Template-Type: ReDIF-Paper 1.0 Title: Rolling estimation methods in Stata for robust estimation of treatment effects with staggered interventions Abstract: I will provide an overview of how commonly used treatment-effects estimators, including doubly robust estimators, can be applied after simple time-series transformations with panel data. Demeaning using pretreatment time periods leads to estimators comparable with existing estimators in the context of staggered interventions—sometimes with better statistical properties. In addition, I will show how unit-specific detrending before applying the treatment-effect estimators allows explicit violation of conditional parallel trends. The recent community-contributed command lwdid will be used to implement the methods. Author-Name: Jeffrey Wooldridge Author-Workplace-Name: Michigan State University Author-Person: pwo39 Handle: RePEc:boc:lsug26:18