Template-Type: ReDIF-Article 1.0 Author-Name: Giovanni Cerulli Author-Workplace-Name: IRCeES-CNR Author-Email: giovanni.cerulli@ircres.cnr.it Author-Person: pce40 Title: Optimal policy learning using Stata Journal: Stata Journal Pages: 309-343 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: In this article, I introduce the package opl for optimal policy learning, facilitating ex ante policy impact evaluation within the Stata environment. De- spite theoretical progress, practical implementations of policy-learning algorithms are still poor within popular statistical software. To address this limitation, opl implements three popular policy-learning algorithms in Stata—threshold based, linear combination, and fixed-depth decision tree—and provides practical demon- strations of them using a real dataset. I also present policy-scenario development proposing a menu strategy, which is particularly useful when selection variables are affected by welfare monotonicity. Overall, this article contributes to bridging the gap between theoretical advancements and practical applications in the field of policy learning. Keywords: opl, make_cate, opl_dt_c, opl_dt, opl_lc_c, opl_lc, opl_tb_c, opl_tb, ex ante policy evaluation, optimal policy learning, optimal treatment assignment, machine learning, conditional average treatment effect File-URL: http://www.stata-journal.com/article.html?article=st0774 File-Function: link to article purchase DOI: 10.1177/1536867X251341143 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/st0774/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:309-343 Template-Type: ReDIF-Article 1.0 Author-Name: Mark D. Chatfield Author-Workplace-Name: University of Queensland Clinical Trials Centre Author-Email: m.chatfield@uq.edu.au Author-Person: pch514 Title: Review of Michael N. Mitchell’s Create and Export Tables Using Stata Journal: Stata Journal Pages: 466-470 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: In this article, I review Create and Export Tables Using Stata, by Michael N. Mitchell (2025, Stata Press). Keywords: book review, reporting, summary statistics, regression, collect, dtable, etable, table File-URL: http://www.stata-journal.com/article.html?article=gn0103 File-Function: link to article purchase DOI: 10.1177/1536867X251341415 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/gn0103/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:466-470 Template-Type: ReDIF-Article 1.0 Author-Name: Demetris Christodoulou Author-Workplace-Name: The University of Sydney Author-Email: demetris.christodoulou@sydney.edu.au Author-Person: pch1698 Title: Stata tip 161: Moving averages of even spans and their endpoints Journal: Stata Journal Pages: 484-490 Issue: 2 Volume: 25 Year: 2025 Month: June File-URL: http://www.stata-journal.com/article.html?article=st0779 File-Function: link to article purchase DOI: 10.1177/1536867X251341417 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/st0779/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:484-490 Template-Type: ReDIF-Article 1.0 Author-Name: Nicholas J. Cox Author-Workplace-Name: Durham University Author-Email: n.j.cox@durham.ac.uk Author-Person: pco34 Title: Speaking Stata: Nine notes on dealing with dates and times Journal: Stata Journal Pages: 471-483 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: This is an informal overview of several key points in dealing with date and time data in Stata. Dates and times in Stata are integers with specified units. Years are usually easy to handle. Otherwise, dates in Stata have origin at the beginning of 1960. Date or time inputs often need translation to Stata dates or times. Conversion from one kind of date or time to another requires a special function, as does extraction of date or time components. Weeks are different. Assigning date or date-time display formats is essential to understand your variables. Once your dates and times are set up, consider tsset or xtset. I also explain how month names or abbreviations may be mapped to integers 1 to 12 and how fraction of year may be calculated, which is useful for fitting sinusoids. Keywords: dates, times, clock, daily, weekly, monthly, quarterly, half- yearly, yearly, format, tsset, xtset File-URL: http://www.stata-journal.com/article.html?article=dm0116 File-Function: link to article purchase DOI: 10.1177/1536867X251341416 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/dm0116/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:471-483 Template-Type: ReDIF-Article 1.0 Author-Name: Nicholas J. Cox Author-Workplace-Name: Durham University Author-Email: n.j.cox@durham.ac.uk Author-Person: pco34 Title: Stata tip 162: Add marginal rugs using marker symbols or axis ticks Journal: Stata Journal Pages: 491-497 Issue: 2 Volume: 25 Year: 2025 Month: June File-URL: http://www.stata-journal.com/article.html?article=gr0101 File-Function: link to article purchase DOI: 10.1177/1536867X251341426 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/gr0101/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:491-497 Template-Type: ReDIF-Article 1.0 Author-Name: Kerui Du Author-Workplace-Name: Xiamen University Author-Email: kerrydu@xmu.edu.cn Author-Name: Qiaowen Chen Author-Workplace-Name: Xiamen University Author-Email: chenqiaowen@stu.xmu.edu.cn Title: framerge: Merging data between frames Journal: Stata Journal Pages: 438-457 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: We introduce a new command, framerge, based on the official Stata commands frlink and frget. Our command allows Stata users to efficiently link frames and copy variables from another frame into the current frame based on match key variables. framerge supports multiple data-matching relationships, including 1:1, m:1, 1:m, and m:m (joinby). In this article, we detail the general idea, syntax, and examples for the framerge command. Keywords: framerge, frlink, frget, merge, joinby, merging data, frames File-URL: http://www.stata-journal.com/article.html?article=dm0115 File-Function: link to article purchase DOI: 10.1177/1536867X251341401 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/dm0115/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:438-457 Template-Type: ReDIF-Article 1.0 Author-Name: Pablo Estrada Author-Workplace-Name: Emory University Author-Email: pestrad@emory.edu Author-Name: Juan Estrada Author-Workplace-Name: Analysis Group Economic Consulting Author-Email: juan.estrada@analysisgroup.com Author-Person: pes207 Author-Name: Kim P. Huynh Author-Workplace-Name: Bank of Canada Author-Email: kim@huynh.tv Author-Person: phu77 Author-Name: David Jacho-Chávez Author-Workplace-Name: Emory University Author-Email: djachocha@emory.edu Author-Person: pja134 Author-Name: Leonardo Sánchez-Aragón Author-Workplace-Name: ESPOL University Author-Email: lfsanche@espol.edu.ec Author-Person: psa1732 Title: netivreg: Estimation of peer effects in endogenous social networks Journal: Stata Journal Pages: 344-373 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: The command netivreg implements the generalized three-stage least- squares estimator developed in Estrada (2022, Causal inference in multilayered networks, PhD thesis) and the generalized method of moments estimator in Chan et al. (2024, Journal of Econometric Methods 13: 205–224) for the endogenous linear-in-means model. The two procedures use full observability of a two-layered multiplex network data structure using Stata’s new multiframes capabilities and Python integration (version 16 and above). Applications of the command include simulated data and three years’ worth of data on peer-reviewed articles published in top general-interest journals in economics. Keywords: netivreg, instrumental variables, multiplex networks, network effects, Python, endogenous network, peer effects, generalized three-stage least squares, gmm File-URL: http://www.stata-journal.com/article.html?article=st0775 File-Function: link to article purchase DOI: 10.1177/1536867X251341145 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/st0775/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:344-373 Template-Type: ReDIF-Article 1.0 Author-Name: Nick Green Author-Workplace-Name: University of Surrey Author-Email: nick.green@surrey.ac.uk Author-Name: J. M. C. Santos Silva Author-Workplace-Name: University of Surrey Author-Email: jmcss@surrey.ac.uk Author-Person: psa51 Title: A cautionary note on goodness-of-fit statistics for models estimated by pseudo maximum likelihood Journal: Stata Journal Pages: 458-465 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: We argue that measures of goodness of fit based on the value of the likelihood function should not be used when models are estimated by pseudo maximum likelihood. We illustrate this point by showing that when the dependent variable is not a count, some measures of goodness of fit for Poisson regression routinely reported by Stata commands depend on the scale of the data and are therefore uninformative. Keywords: glm, poisson, ppml, ppmlhdfe, AIC, BIC, R-squared File-URL: http://www.stata-journal.com/article.html?article=st0778 File-Function: link to article purchase DOI: Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/st0778/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:458-465 Template-Type: ReDIF-Article 1.0 Author-Name: Gustavo Iglésias Author-Workplace-Name: Banco de Portugal Author-Email: giglesias@bportugal.pt Author-Name: Paulo Guimarães Author-Workplace-Name: Banco de Portugal Author-Email: pfguimaraes@bportugal.pt Author-Person: pgu11 Author-Name: Marta Silva Author-Workplace-Name: Banco de Portugal Author-Email: msilva@bportugal.pt Author-Person: psi573 Title: metaxl: A package of tools to handle metadata Journal: Stata Journal Pages: 285-308 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: In this article, we introduce metaxl, a community-contributed package designed for managing metadata in datasets. The package enables users to extract metadata from files into structured Excel files, making it easier to share and ma- nipulate metadata independently of the data. It also allows for applying metadata from Excel files back to datasets, ensuring consistency across data extractions or survey waves. Additionally, metaxl offers functionalities for checking, comparing, and harmonizing metadata files, making it a valuable resource for managing large and complex datasets, particularly in settings where data security and quality are important. Keywords: metadata, Excel, structured Excel files, Excel metadata file File-URL: http://www.stata-journal.com/article.html?article=dm0114 File-Function: link to article purchase DOI: 10.1177/1536867X251341122 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/dm0114/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:285-308 Template-Type: ReDIF-Article 1.0 Author-Name: Atsushi Inoue Author-Workplace-Name: Vanderbilt University Author-Email: atsushi.inoue@vanderbilt.edu Author-Person: pin18 Author-Name: Barbara Rossi Author-Workplace-Name: ICREA—Universitat Pompeu Fabra Author-Email: barbara.rossi@upf.edu Author-Person: pro86 Author-Name: Yiru Wang Author-Workplace-Name: University of Pittsburgh Author-Email: yiru.wang@pitt.edu Author-Person: pwa962 Author-Name: Lingyun Zhou Author-Workplace-Name: Tsinghua University Author-Email: zhouly.23@pbcsf.tsinghua.edu.cn Title: Parameter path estimation in unstable environments: The tvpreg command Journal: Stata Journal Pages: 374-406 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: In this article, we introduce a novel command, tvpreg, that imple- ments two path estimators: 1) the asymptotically weighted average risk minimiz- ing path estimators by Müller and Petalas (2010, Review of Economic Studies 77: 1508–1539) and 2) the path estimators proposed by Inoue, Rossi, and Wang (2024b, Journal of Econometrics: art. 105726), namely, the time-varying-parameter local projections and time-varying-parameter instrumental-variables estimators, with either strong or weak instruments. The postestimation commands tvpplot and predict are designed to, respectively, visualize and store the estimation results. Keywords: tvpreg, tvpplot, time variation, weighted average risk, local projection, vector autoregression, weak instruments File-URL: http://www.stata-journal.com/article.html?article=st0776 File-Function: link to article purchase DOI: 10.1177/1536867X251341170 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/st0776/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:374-406 Template-Type: ReDIF-Article 1.0 Author-Name: David Roodman Author-Workplace-Name: Open Philanthropy Author-Email: david.roodman@openphilanthropy.org Author-Person: pro120 Title: Julia as a universal platform for statistical software development Journal: Stata Journal Pages: 255-284 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: The julia package integrates the Julia programming language into Stata. Users can transfer data between Stata and Julia, issue Julia commands to analyze and plot, and pass results back to Stata. Julia’s econometric ecosystem is not as mature as Stata’s, R’s, or Python’s. But Julia is an excellent envi- ronment for developing high-performance numerical applications, which can then be called from many platforms. For example, the boottest program for wild bootstrap–based inference (Roodman et al., 2019, Stata Journal 19: 4–60) and fwildclusterboot for R (Fischer and Roodman, 2021, “fwildclusterboot: Fast wild cluster bootstrap inference for linear regression models”) can both call the same Julia back end. And the program reghdfejl mimics reghdfe (Correia, 2016, https://scorreia.com/research/hdfe.pdf) in fitting linear models with high- dimensional fixed effects but calls a Julia package for tenfold acceleration on hard problems. reghdfejl also supports nonlinear fixed-effect models that cannot oth- erwise be fit in Stata—though preliminarily because the Julia package for that purpose is immature. Keywords: julia, reghdfe, reghdfejl, boottest, high-dimensional fixed ef- fects, cross-platform communication File-URL: http://www.stata-journal.com/article.html?article=pr0083 File-Function: link to article purchase DOI: 10.1177/1536867X251341105 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/pr0083 Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:255-284 Template-Type: ReDIF-Article 1.0 Author-Name: Guanpeng Yan Author-Workplace-Name: Shandong University of Finance and Economics Author-Email: guanpengyan@yeah.net Author-Name: Qiang Chen Author-Workplace-Name: Shandong University Author-Email: qiang2chen2@126.com Author-Person: pch913 Author-Name: Zhijie Xiao Author-Workplace-Name: Boston College Author-Email: xiaoz@bc.edu Author-Person: pxi26 Title: Quantile control method: Causal inference with one treated unit via random forest Journal: Stata Journal Pages: 407-437 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: The synthetic control and regression control methods are popular ap- proaches for estimating treatment effects in panel data with one treated unit but often rely on placebo tests for informal inference. Chen, Xiao, and Yao (Forth- coming, https: // doi.org / 10.1016 / j.jeconom.2024.105789) propose the quantile control method (QCM), which constructs confidence intervals for treatment ef- fects by estimating the 2.5% and 97.5% quantiles of the counterfactual outcomes through quantile regressions. In particular, a nonparametric ensemble machine learning method known as quantile random forest is used to implement quantile regressions. It is robust to heteroskedasticity, autocorrelation, and model misspec- ifications and easily accommodates high-dimensional data. Simulations showed that QCM confidence intervals enjoy excellent empirical coverage in finite samples. In this article, we introduce the qcm command, which easily implements QCM, and illustrate its use by revisiting the examples of the economic impact of German reunification on West Germany and the effect of carbon taxes on CO2 emissions in Sweden. Keywords: qcm, quantile control method, quantile random forest, quantile regression, synthetic control method, regression control method File-URL: http://www.stata-journal.com/article.html?article=st0777 File-Function: link to article purchase DOI: 10.1177/1536867X251341181 Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/st0777/ Handle: RePEc:tsj:stataj:v:25:y:2025:i:2:p:407-437 Template-Type: ReDIF-Article 1.0 Author-Name: Editors Author-Email: editors@stata.com Title: Software updates Journal: Stata Journal Pages: 498 Issue: 2 Volume: 25 Year: 2025 Month: June Abstract: Updates for previously published packages are provided. Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/st0427_4/ Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj25-2/st0695_1/ Handle:RePEc:tsj:stataj:v:25:y:2025:i:2:p:498