Template-Type: ReDIF-Article 1.0 Author-Name: Nicholas J. Cox Author-Workplace-Name: Durham University Author-Person: pco34 Author-Name: Stephen P. Jenkins Author-Workplace-Name: London School of Economics Author-Email: s.jenkins@lse.ac.uk Author-Person: pje7 Title: The Stata Journal Editors’ Prize 2022: Christopher F. Baum Journal: Stata Journal Pages: 727-733 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221140932 File-URL: http://www.stata-journal.com/article.html?article=gn0092 File-Function: link to article purchase Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:727-733 Template-Type: ReDIF-Article 1.0 Author-Name: Takuya Hasebe Author-Workplace-Name: Sophia University Author-Email: thasebe@sophia.ac.jp Author-Person: pha1037 Title: Endogenous models of binary choice outcomes: Copula-based maximum-likelihood estimation and treatment effects Journal: Stata Journal Pages: 734-771 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221140943 Abstract: In this article, I describe the commands that implement the estimation of three endogenous models of binary choice outcome. The command esbinary fits the endogenously switching model, where a potential outcome differs across two treatment states. The command edbinary fits the endogenous dummy model, which includes a dummy variable indicating the treatment state as one of the explanatory variables. After one estimates the parameters of these models, various treatment effects can be estimated as postestimation statistics. The command ssbinary fits the sample-selection model, where an outcome is observed in only one of the states. The commands fit these models using copula-based maximum- likelihood estimation. Keywords: esbinary, edbinary, ssbinary, endogeneity, treatment effects, binary outcome, copula-based maximum-likelihood estimation, endogenous switching model, sample selection File-URL: http://www.stata-journal.com/article.html?article=st0691 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0691/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:734-771 Template-Type: ReDIF-Article 1.0 Author-Name: Giovanni Cerulli Author-Workplace-Name: IRCrES-CNR Author-Email: giovanni.cerulli@ircres.cnr.it Author-Person: pce40 Title: Machine learning using Stata/Python Journal: Stata Journal Pages: 772-810 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221140944 Abstract: I present two related commands, r_ml_stata_cv and c_ml_stata_cv, for fitting popular machine learning methods in both a regression and a classification setting. Using the recent Stata/Python integration platform introduced in Stata 16, these commands provide hyperparameters’ optimal tuning via K-fold cross-validation using grid search. More specifically, they use the Python Scikit- learn application programming interface to carry out both cross-validation and outcome/label prediction. Keywords: r_ml_stata_cv, c_ml_stata_cv, get_test_train, machine learning, Python, optimal tuning File-URL: http://www.stata-journal.com/article.html?article=pr0076 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/pr0076/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:772-810 Template-Type: ReDIF-Article 1.0 Author-Name: John A. Gallis Author-Workplace-Name: Duke University Author-Email: john.gallis@duke.edu Author-Name: Xueqi Wang Author-Workplace-Name: Yale School of Public Health Author-Email: xueqi.wang@yale.edu Author-Name: Paul J. Rathouz Author-Workplace-Name: University of Texas at Austin Author-Email: paul.rathouz@austin.utexas.edu Author-Name: John S. Preisser Author-Workplace-Name: University of North Carolina at Chapel Hill Author-Email: jpreisse@bios.unc.edu Author-Name: Fan Li Author-Workplace-Name: Yale School of Public Health Author-Email: fan.f.li@yale.edu Author-Name: Elizabeth L. Turner Author-Workplace-Name: Duke University Author-Email: liz.turner@duke.edu Title: power swgee: GEE-based power calculations in stepped wedge cluster randomized trials Journal: Stata Journal Pages: 811-841 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221140953 Abstract: Stepped wedge cluster randomized trials (SW-CRTs) are increasingly being used to evaluate interventions in medical, public health, educational, and social science contexts. With the longitudinal and crossover natures of an SW- CRT, complex analysis techniques are often needed, which makes appropriately powering SW-CRTs challenging. In this article, we introduce a newly developed SW-CRT power calculator embedded within the power command in Stata. The power calculator assumes a marginal model (that is, generalized estimating equa- tions) for the primary analysis of SW-CRTs, for which other currently available SW-CRT power calculators may not be suitable. The command accommodates complete cross-sectional and closed-cohort designs and includes multilevel correla- tion structures appropriate for such designs. We discuss the methods and formulas underlying our SW-CRT calculator and provide illustrative examples of the use of power swgee. We provide suggestions about the choice of parameters in power swgee and conclude by discussing areas of future research that may improve the command. Keywords: power swgee, stepped wedge cluster randomized trials, staggered rollout designs, statistical power, group randomized trials, marginal models, generalized estimating equations File-URL: http://www.stata-journal.com/article.html?article=st0692 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0692/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:811-841 Template-Type: ReDIF-Article 1.0 Author-Name: Guanpeng Yan Author-WorkPlace-Name: Shandong University Author-Email: guanpengyan@yeah.net Author-Name: Qiang Chen Author-WorkPlace-Name: Shandong University Author-Email: qiang2chen2@126.com Author-Person: pch913 Title: rcm: A command for the regression control method Journal: Stata Journal Pages: 842-883 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221140960 Abstract: The regression control method, also known as the panel-data approach for program evaluation (Hsiao, Ching, and Wan, 2012, Journal of Applied Econo- metrics 27: 705–740; Hsiao and Zhou, 2019, Journal of Applied Econometrics 34: 463–481), is a convenient method for causal inference in panel data that ex- ploits cross-sectional correlation to construct counterfactual outcomes for a single treated unit by linear regression. In this article, we present the rcm command, which efficiently implements the regression control method with or without co- variates. Available methods for model selection include best subset, lasso, and forward stepwise and backward stepwise regression, while available selection cri- teria include the corrected Akaike information criterion, the Akaike information criterion, the Bayesian information criterion, the modified Bayesian information criterion, and cross-validation. Estimation and counterfactual predictions can be made by ordinary least squares, lasso, or postlasso ordinary least squares. For statistical inference, both the in-space placebo test using fake treatment units and the in-time placebo test using a fake treatment time can be implemented. The rcm command produces a series of graphs for visualization along the way. We demon- strate the use of the rcm command by revisiting classic examples of political and economic integration between Hong Kong and mainland China (Hsiao, Ching, and Wan 2012) and German reunification (Abadie, Diamond, and Hainmueller, 2015, American Journal of Political Science 59: 495–510). Keywords: rcm, regression control method, panel-data approach, program evaluation, causal inference, counterfactual outcomes File-URL: http://www.stata-journal.com/article.html?article=st0693 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0693/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:842-883 Template-Type: ReDIF-Article 1.0 Author-Name: Noori Akhtar-Danesh Author-Workplace-Name: McMaster University Author-Email: daneshn@mcmaster.ca Author-Name: Stephen C. Wingreen Author-Workplace-Name: University of Canterbury Author-Email: wingreen@bellsouth.net Title: qpair: A command for analyzing paired Q-sorts in Q-methodology Journal: Stata Journal Pages: 884-907 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141002 Abstract: In this article, we introduce qpair as a new command written in Stata for the analysis of paired Q-sorts in Q-methodology, which is used for studying subjective issues and is a combination of qualitative and quantitative techniques. The quantitative component of Q-methodology employs a by-person factor anal- ysis technique. However, currently there is no systematic approach for analyzing paired Q-sorts or longitudinal data in Q-methodology. We introduce the only statistical command available for the analysis of paired Q-sorts. The qpair com- mand employs the factor extraction and factor rotation techniques in Stata. The command is illustrated using a dataset representing perceptions of 50 information technology professionals on person–organization fit regarding their training and development priorities. Keywords: qpair, Q-methodology, by-person factor analysis, paired Q-sort, person–organization fit File-URL: http://www.stata-journal.com/article.html?article=st0694 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj18-1/st0694/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:884-907 Template-Type: ReDIF-Article 1.0 Author-Name: Xiangmei Ma Author-Email: xiangmei.ma@duke-nus.edu.sg Author-WorkPlace-Name: Duke–NUS Medical School Author-Name: Yin Bun Cheung Author-Email: yinbun.cheung@duke-nus.edu.sg Author-WorkPlace-Name: Duke–NUS Medical School Title: crtrest: A command for ratio estimators of intervention effects on event rates in cluster randomized trials Journal: Stata Journal Pages: 908-923 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141012 Abstract: We describe five asymptotically unbiased estimators of intervention effects on event rates in nonmatched and matched-pair cluster randomized trials, and we present a bias-corrected version of the estimators for use when the number of clusters is small. The estimators are the ratio of mean counts (r1), ratio of mean cluster-level event rates (r2), ratio of event rates (r3), double ratio of counts (r4), and double ratio of event rates (r5). r1, r2, and r3 estimate the total effect, which comprises the direct and indirect effects; r4 and r5 estimate the direct effect. We describe a new command, crtrest, that provides these ratio estimators and their standard errors in nonmatched and matched-pair cluster randomized trials. Keywords: crtrest, ratio estimator, intervention effects, event rate, cluster randomized trial File-URL: http://www.stata-journal.com/article.html?article=st0695 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0695/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:908-923 Template-Type: ReDIF-Article 1.0 Author-Name: Jia Li Author-Email: jiali@smu.edu.sg Author-WorkPlace-Name: Singapore Management University Author-Name: Zhipeng Liao Author-Email: zhipeng.liao@ucla.edu Author-WorkPlace-Name: University of California–Los Angeles Author-Name: Rogier Quaedvlieg Author-Email: rogier.quaedvlieg@ecb.europa.eu Author-WorkPlace-Name: European Central Bank Author-Person: pqu119 Author-Name: Wenyu Zhou Author-Email: wenyuzhou@intl.zju.edu.cn Author-WorkPlace-Name: Zhejiang University Title: Conditional evaluation of predictive models: The cspa command Journal: Stata Journal Pages: 924-940 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141014 Abstract: In this article, we introduce a new command, cspa, that implements the conditional superior predictive ability test developed in Li, Liao, and Quaed- vlieg (2022, Review of Economic Studies 89: 843–875). With the conditional per- formance of predictive methods measured nonparametrically by the conditional expectation functions of their predictive losses, we test the null hypothesis that a benchmark model weakly outperforms a collection of competitors uniformly across the conditioning space. The proposed command can implement this test for both independent cross-sectional data and serially dependent time-series data. Confi- dence sets for the most superior model can be obtained by inverting the test, for which the cspa command also offers a convenient implementation. Keywords: cspa, conditional moment inequality, forecast evaluation, functional inference, series estimation File-URL: http://www.stata-journal.com/article.html?article=st0696 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0696/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:924-940 Template-Type: ReDIF-Article 1.0 Author-Name: Hongbing Zhu Author-Email: zhuhongbing@hhu.edu.cn Author-WorkPlace-Name: Hohai University Author-Name: Lihua Yang Author-Email: yanglihua@hhu.edu.cn Author-WorkPlace-Name: Hohai University Title: portfolio: A command for conducting portfolio analysis in Stata Journal: Stata Journal Pages: 941-957 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141021 Abstract: Portfolio analysis is widely used in empirical asset pricing to explore the cross-sectional relation between two or more variables. In this article, we introduce the methodology of portfolio analysis and describe a new command, portfolio, that provides a one-step solution for portfolio analysis. portfolio calculates the equal- or value-weighted returns with a t statistic for the portfolio and tests the significance of a long-short strategy in portfolios. portfolio also provides the Newey–West standard-error adjustment option for alleviating the impact of potential autocorrelation and heteroskedasticity in financial time series. Keywords: portfolio, portfolio analysis, nonparametric analysis, hedging strategy File-URL: http://www.stata-journal.com/article.html?article=st0697 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0695/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:941-957 Template-Type: ReDIF-Article 1.0 Author-Name: Max D. Weinreb Author-Email: maxweinreb@utexas.edu Author-WorkPlace-Name: University of Texas at Austin Author-Name: Jenny Trinitapoli Author-Email: jennytrini@uchicago.edu Author-WorkPlace-Name: University of Chicago Title: printcase: A command for visualizing single observations Journal: Stata Journal Pages: 958-968 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141022 Abstract: In this article, we introduce the printcase command, which outputs data from a specific observation into an easy-to-read Microsoft Word or PDF docu- ment. printcase allows analysts to focus on a single observation within a dataset and view that observation in its entirety. The output displays fields in table format, with all variables identified by their corresponding labels and all responses iden- tified by their corresponding value labels. We explain how printcase works, give examples of circumstances under which this type of table-based quasiquestionnaire would be useful, and provide code for printing single observations. Keywords: printcase, survey research, fieldwork, data quality, interviewer training File-URL: http://www.stata-journal.com/article.html?article=dm0109 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/dm0109/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:958-968 Template-Type: ReDIF-Article 1.0 Author-Name: Matteo Bottai Author-Email: matteo.bottai@ki.se Author-WorkPlace-Name: Karolinska Institutet Title: Estimating the risk of events with stprisk Journal: Stata Journal Pages: 969-974 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141057 Abstract: Incidence rates are popular summary measures of the occurrence over time of events of interest. They are also called mortality rates or failure rates, depending on the context. The incidence rate is defined as the ratio between the total number of events and total follow-up time and can be estimated with the strate command. When the event of interest can occur multiple times on any given subject over a time period, like infections, the incidence rate represents an average count per unit of time, such as the average number of infections per year. When the event of interest can occur only once, such as death, an alternative summary measure is the risk, or probability, of occurrence per unit time, such as the risk of dying in one year. In this article, I present the stprisk command, which estimates risks, and illustrate its use and interpretation through a data example. Keywords: stprisk, incidence rates, mortality rates, survival analysis File-URL: http://www.stata-journal.com/article.html?article=st0698 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0698/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:969-974 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: Automating axis labels: Nice numbers and transformed scales Journal: Stata Journal Pages: 975-995 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141058 Abstract: Two common problems with graph axis labels are to decide in advance on some “nice” numbers to use on one or both axes and to show particular labels on some transformed scale. In this column, I discuss the nicelabels and mylabels commands, which address these problems. The first command is new to Stata, and the second is a revision of a previously published command. I also survey the myticks command for tick placement. In all commands, the main output is a local macro in the calling program’s space, in the interest of promoting automation in do-files and programs. Keywords: nicelabels, mylabels, myticks, axis labels, axis ticks, axis scales, transformations, graphics File-URL: http://www.stata-journal.com/article.html?article=gr0092 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/gr0092/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:975-995 Template-Type: ReDIF-Article 1.0 Author-Name: Roger Newson Author-Workplace-Name: King’s College London Author-Email: roger.newson@kcl.ac.uk Author-Person: pne37 Title: Stata tip 147: Porting downloaded packages between machines Journal: Stata Journal Pages: 996-997 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141067 File-URL: http://www.stata-journal.com/article.html?article=st0699 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0699/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:996-997 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 148: Searching for words within strings Journal: Stata Journal Pages: 998-1003 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X221141068 File-URL: http://www.stata-journal.com/article.html?article=dm0110 File-Function: link to article purchase Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/dm0110/ Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:998-1003 Template-Type: ReDIF-Article 1.0 Author-Name: Editors Author-Email: editors@stata.com Title: Software updates Journal: Stata Journal Pages: 1004 Issue: 4 Volume: 22 Year: 2022 Month: December DOI: 10.1177/1536867X211063150 Abstract: Updates for previously published packages are provided. Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj22-4/st0097_2/ Note: Windows users should not attempt to download these files with a web browser. Handle:RePEc:tsj:stataj:v:22:y:2022:i:4:p:1004