bluuebunny/crossref_metadata_2025 huggingface dataset:
The Impact of Different Sources of Body Mass Index Assessment on Smoking Onset: An Application of Multiple-Source Information Models
Authors: Caria Maria Paola , Galanti Maria Rosaria , Bellocco Rino , Horton Nicholas J.
Published: November 2018

Multiple-source data are often collected to provide better information of some underlying construct that is difficult to measure or likely to be missing. In this article, we describe regression-based methods for analyzing multiple-source data in Stata. We use data from the BROMS Cohort Study, a cohort of Swedish adolescents who collected data on body mass index that was self-reported and that was measured by nurses. We draw together into a single frame of reference both source reports and relate these to smoking onset. This unified method has two advantages over traditional approaches: 1) the relative predictiveness of each source can be assessed and 2) all subjects contribute to the analysis. The methods are applicable to other areas of epidemiology where multiple-source reports are used.
A Closer Examination of Three Small-Sample Approximations to the Multiple-Imputation Degrees of Freedom
Authors: Wagstaff David A. , Harel Ofer
Published: November 2018

Incomplete data is a common complication in applied research. In this study, we use simulation to compare two approaches to the multiple imputation of a continuous predictor: multiple imputation through chained equations and multivariate normal imputation. This study extends earlier work by being the first to 1) compare the small-sample approximations to the multiple-imputation degrees of freedom proposed by Barnard and Rubin (1999, Biometrika 86: 948– 955); Lipsitz, Parzen, and Zhao (2002, Journal of Statistical Computation and Simulation 72: 309–318); and Reiter (2007, Biometrika 94: 502–508) and 2) ask if the sampling distribution of the t statistics is in fact a Student's t distribution with the specified degrees of freedom.

In addition to varying the imputation method, we varied the number of imputations ( m = 5,10, 20,100) that were averaged over 500,000 replications to obtain the combined estimates and standard errors for a linear model that regressed the log price of a home on its age (years) and size (square feet) in a sample of 25 observations. Six age values were randomly set equal to missing for each replication.

As assessed by the absolute percentage and relative percentage bias, the two approaches performed similarly. The absolute bias of the regression coefficients for age and size was roughly −0.1% across the levels of m for both approaches; the absolute bias for the constant was 0.6% for the chained-equations approach and 1.0% for the multivariate normal model. The absolute biases of the standard errors for age, size, and the constant were 0.2%, 0.3%, and 1.2%, respectively. In general, the relative percentage bias was slightly smaller for the chained-equations approach. Graphical and numerical inspection of the empirical sampling distributions for the three t statistics suggested that the area from the shoulder to the tail was reasonably well approximated by a t distribution and that the small-sample approximations to the multiple-imputation degrees of freedom proposed by Barnard and Rubin and by Reiter performed satisfactorily.
Speaking Stata: Fun and Fluency with Functions
Authors: Cox Nicholas J.
Published: November 2018

Functions are the unsung heroes of Stata. This column is a tour of functions that might easily be missed or underestimated, with a potpourri of tips, tricks, and examples for a wide range of basic problems.
Stata Graph Library for Network Analysis
Authors: Miura Hirotaka
Published: November 2018

Network analysis is a multidisciplinary research method that is quickly becoming a popular and exciting field. Though some statistical programs possess sophisticated packages for analyzing networks, similar capabilities have yet to be made available in Stata. In an effort to motivate the use of Stata for network analysis, I designed in Mata the Stata graph library (SGL), which consists of algorithms that construct matrix representations of networks, compute centrality measures, calculate clustering coefficients, and solve maximum-flow problems. The SGL is designed for both directed and undirected one-mode networks containing edges that are either unweighted or weighted with positive values. Performance tests conducted between C++ and Stata graph library implementations indicate gross inefficiencies in current SGL routines, making the SGL impractical for large networks. The obstacles are, however, welcome challenges in the effort to spread the use of Stata for analyzing networks. Future developments will focus toward addressing computational time complexities and integrating additional capabilities into the SGL.
tt: Treelet Transform with Stata
Authors: Gorst-Rasmussen Anders
Published: November 2018

The treelet transform is a recent data reduction technique from the field of machine learning. Sharing many similarities with principal component analysis, the treelet transform can reduce a multidimensional dataset to the projections on a small number of directions or components that account for much of the variation in the original data. However, in contrast to principal component analysis, the treelet transform produces sparse components. This can greatly simplify interpretation. I describe the tt Stata add-on for performing the treelet transform. The addon includes a Mata implementation of the treelet transform algorithm alongside other functionality to aid in the practical application of the treelet transform. I demonstrate an example of a basic exploratory data analysis using the tt add-on.
Speaking Stata: Output to Order
Authors: Cox Nicholas J.
Published: November 2018

Wanting to present Stata output in a different way is a very common desire that lies behind many substantial user-written programs. Here I start at the beginning with some basic tips and tricks. I discuss using display to replay the results you want; putting results into new variables so that they can be listed, tabulated, or plotted; and using existing reduction commands to produce new datasets containing results.
Faster Estimation of a Discrete-Time Proportional Hazards Model with Gamma Frailty
Authors: Farnworth Michael G.
Published: November 2018

Fitting a complementary log-log model that accounts for gamma-distributed unobserved heterogeneity often takes a significant amount of time. This is in part because numerical derivatives are used to approximate the gradient vector and Hessian matrix. The main contribution of this article is the use of Mata and a gf2 evaluator to express the gradient vector and Hessian matrix. Gradient vector expression allows one to use a few different options and postestimation commands. Furthermore, expression of the gradient vector and Hessian matrix increases the speed at which a likelihood function is maximized.

In this article, I present a complementary log-log model, show how the gamma distribution has been incorporated, and point out why the gradient vector and Hessian matrix can be expressed. I then discuss the speed at which a maximum is achieved, and I apply sampling weights that require an expression of the gradient vector. I introduce a new command for fitting this model. To demonstrate how this model can be applied, I will examine information on when young males first try marijuana.
Threshold Regression for Time-to-Event Analysis: The Stthreg Package
Authors: Xiao Tao , Whitmore G. A. , He Xin , Lee Mei-Ling Ting
Published: November 2018

In this article, we introduce the stthreg package of Stata commands to fit the threshold regression model, which is based on the first hitting time of a boundary by the sample path of a Wiener diffusion process and is well suited to applications involving time-to-event and survival data. The threshold regression model serves as an important alternative to the Cox proportional hazards model. The four commands that comprise this package for the threshold regression model are the model-fitting command stthreg, the postestimation command trhr for hazard-ratio calculation, the postestimation command trpredict for prediction, and the model diagnostics command sttrkm. These commands can also be used to implement an extended threshold regression model that accommodates applications where a cure rate exists.
Using the Margins Command to Estimate and Interpret Adjusted Predictions and Marginal Effects
Authors: Williams Richard
Published: November 2018

Many researchers and journals place a strong emphasis on the sign and statistical significance of effects—but often there is very little emphasis on the substantive and practical significance of the findings. As Long and Freese (2006, Regression Models for Categorical Dependent Variables Using Stata [Stata Press]) show, results can often be made more tangible by computing predicted or expected values for hypothetical or prototypical cases. Stata 11 introduced new tools for making such calculations—factor variables and the margins command. These can do most of the things that were previously done by Stata's own adjust and mfx commands, and much more.

Unfortunately, the complexity of the margins syntax, the daunting 50-page reference manual entry that describes it, and a lack of understanding about what margins offers over older commands that have been widely used for years may have dissuaded some researchers from examining how the margins command could benefit them.

In this article, therefore, I explain what adjusted predictions and marginal effects are, and how they can contribute to the interpretation of results. I further explain why older commands, like adjust and mfx, can often produce incorrect results, and how factor variables and the margins command can avoid these errors. The relative merits of different methods for setting representative values for variables in the model (marginal effects at the means, average marginal effects, and marginal effects at representative values) are considered. I shows how the marginsplot command (introduced in Stata 12) provides a graphical and often much easier means for presenting and understanding the results from margins, and explain why margins does not present marginal effects for interaction terms.
Speaking Stata: Transforming the Time Axis
Authors: Cox Nicholas J.
Published: November 2018

The time variable is most commonly plotted precisely as recorded in graphs showing change over time. However, if the most interesting part of the graph is very crowded, then transforming the time axis to give that part more space is worth consideration. In this column, I discuss logarithmic scales, square root scales, and scale breaks as possible solutions.
The Chen–Shapiro Test for Normality
Authors: Brzezinski Michal
Published: November 2018

The Chen–Shapiro test for normality (Chen and Shapiro, 1995, Journal of Statistical Computation and Simulation 53: 269–288) has been shown in simulation studies to be generally slightly more powerful than the commonly used Shapiro–Wilk and Shapiro–Francia tests, implemented in Stata official commands swilk and sfrancia. I present the chens command, which performs the Chen– Shapiro test in Stata.
Adjusting for Age Effects in Cross-Sectional Distributions
Authors: Almås Ingvild , Havnes Tarjei , Mogstad Magne
Published: November 2018

Income and wealth differ over the life cycle. In cross-sectional distributions of income or wealth, classical inequality measures such as the Gini could therefore find substantial inequality even if everyone has the same lifetime income or wealth. We describe the adjusted Gini index (Almås and Mogstad, 2012, Scandinavian Journal of Economics 114: 24–54), which is a generalization of the classical Gini index with attractive properties, and we describe the adgini command, which provides the adjusted Gini index and the classical Gini index. The adgini command also provides options to produce other well-known age-adjusted inequality measures, such as the Paglin–Gini (Paglin, 1975, American Economic Review 65: 598–609) and the Wertz–Gini (Wertz, 1979, American Economic Review 69: 670–672), and provides efficient estimation of the classical Gini coefficient.
A Review of Stata Commands for Fixed-Effects Estimation in Normal Linear Models
Authors: McCaffrey Daniel F. , Lockwood J. R. , Mihaly Kata , Sass Tim R.
Published: November 2018

Availability of large multilevel longitudinal databases in various fields of research, including labor economics (with workers and firms observed over time) and education (with students, teachers, and schools observed over time), has increased the application of models with one level or multiple levels of fixed effects (for example, teacher and student effects). There has been a corresponding rapid development of Stata commands designed for fitting these types of models. The commands parameterize the fixed-effects portions of models differently. In cases where estimates of the fixed-effects parameters are of interest, it is critical to understand precisely what parameters are being estimated by different commands. In this article, we catalog the estimates of reported fixed effects provided by different commands for several canonical cases of both one-level and two-level fixed-effects models. We also discuss issues regarding computational efficiency and standard-error estimation.
Importing Presidential Approval Poll Results
Authors: Dicle Mehmet F. , Dicle Betul
Published: November 2018

The American Presidency Project ( http://www.presidency.ucsb.edu ) provides presidential job approval poll results. These data are available for each U.S. president since President Franklin D. Roosevelt and for all the job approval polls conducted since his presidency. In this article, we propose the Stata command approval, which downloads these approval poll results in their original format, an HTML table. approval then parses the HTML table and prepares the data as a usable Stata dataset.
Partial Frontier Efficiency Analysis
Authors: Tauchmann Harald
Published: November 2018

Despite their frequent use in applied work, nonparametric approaches to efficiency analysis—namely, data envelopment analysis and free disposal hull— have bad reputations among econometricians. This is mainly because data envelopment analysis and free disposal hull represent deterministic approaches that are highly sensitive to outliers and measurement errors. However, so-called partial frontier approaches have recently been developed, namely, order- m and order-α. These approaches generalize free disposal hull by allowing for superefficient observations to be located beyond the estimated production-possibility frontier. Although these methods are also purely nonparametric, the sensitivity to outliers is substantially reduced by partial frontier approaches enveloping just a subsample of observations. In this article, I introduce the new Stata commands orderm and orderalpha, which implement order- m, order-α, and free disposal hull efficiency analysis in Stata. The commands allow for several options, such as statistical inference based on subsampling bootstrapping.
Incorporating Complex Sample Design Effects when Only Final Survey Weights are Available
Authors: West Brady T. , McCabe Sean Esteban
Published: November 2018

In this article, we consider the situation that arises when a survey data producer has collected data from a sample with a complex design (possibly featuring stratification of the population, cluster sampling, and unequal probabilities of selection) and for various reasons only provides secondary analysts of those survey data with a final survey weight for each respondent and “average” design effects for survey estimates computed from the data. In general, these “average” design effects, presumably computed by the data producer in a way that fully accounts for all the complex sampling features, already incorporate possible increases in sampling variance due to the use of the survey weights in estimation. The secondary analyst of the survey data—who uses the provided information to compute weighted estimates; computes design-based standard errors reflecting variance in the weights (by using Taylor series linearization, for example); and inflates the estimated variances using the “average” design effects provided—is applying a “double” adjustment to the standard errors for the effect of weighting on the variance estimates, leading to overly conservative inferences. We propose a simple method to prevent this problem and provide a Stata program for applying appropriate adjustments to variance estimates in this situation. We illustrate two applications of the method with survey data from the Monitoring the Future study and conclude with suggested directions for future research in this area.
Robinson's Square Root of N Consistent Semiparametric Regression Estimator in Stata
Authors: Verardi Vincenzo , Debarsy Nicolas
Published: November 2018

In this article, we describe Robinson's (1988, Econometrica 56: 931– 954) double residual semiparametric regression estimator and Härdle and Mammen's (1993, Annals of Statistics 21: 1926–1947) specification test implementation in Stata. We use some simple simulations to illustrate how this newly coded estimator outperforms the already available semiparametric plreg command (Lokshin, 2006, Stata Journal 6: 377–383).
Review of Data Analysis Using Stata, Third Edition, by Kohler and Kreuter
Authors: Schumm L. Philip
Published: November 2018

This article reviews Data Analysis Using Stata, Third Edition, by Ulrich Kohler and Frauke Kreuter (2012 [Stata Press]).
Creating and Managing Spatial-Weighting Matrices with the Spmat Command
Authors: Drukker David M. , Peng Hua , Prucha Ingmar R. , Raciborski Rafal
Published: November 2018

We present the spmat command for creating, managing, and storing spatial-weighting matrices, which are used to model interactions between spatial or more generally cross-sectional units. spmat can store spatial-weighting matrices in a general and banded form. We illustrate the use of the spmat command and discuss some of the underlying issues by using United States county and postal-code-level data.
Extending the Flexible Parametric Survival Model for Competing Risks
Authors: Hinchliffe Sally R. , Lambert Paul C.
Published: November 2018

Competing risks are present when the patients within a dataset could experience one or more of several exclusive events and the occurrence of any one of these could impede the event of interest. One of the measures of interest for analyses of this type is the cumulative incidence function. stpm2cif is a postestimation command used to generate predictions of the cumulative incidence function after fitting a flexible parametric survival model using stpm2. There is also the option to generate confidence intervals, cause-specific hazards, and two other measures that will be discussed in further detail. The new command is illustrated through a simple example.
Standardizing Anthropometric Measures in Children and Adolescents with Functions for Egen: Update
Authors: Vidmar Suzanna I. , Cole Tim J. , Pan Huiqi
Published: November 2018

In this article, we describe an extension to the egen functions zanthro() and zbmicat() (Vidmar et al., 2004, Stata Journal 4: 50–55). All functionality of the original version remains unchanged. In the 2004 version of zanthro(), z scores could be generated using the 2000 U.S. Centers for Disease Control and Prevention Growth Reference and the British 1990 Growth Reference. More recent growth references are now available. For measurement-for-age charts, age can now be adjusted for gestational age. The zbmicat() function previously categorized children according to body mass index (weight/height2) as normal weight, overweight, or obese. “Normal weight” is now split into normal weight and three grades of thinness. Finally, this updated version uses cubic rather than linear interpolation to calculate the values of L, M, and S for the child's decimal age between successive ages (or length/height for weight-for-length/height charts).
Allocation of Ordered Exclusive Choices
Authors: Sangnier Marc
Published: November 2018

In this article, I describe the alloch command, which helps to allocate exclusive choices among individuals who have ordered preferences over available alternatives.
Flexible Parametric Illness-Death Models
Authors: Hinchliffe Sally R. , Scott David A. , Lambert Paul C.
Published: November 2018

It is usual in time-to-event data to have more than one event of interest, for example, time to death from different causes. Competing risks models can be applied in these situations where events are considered mutually exclusive absorbing states. That is, we have some initial state—for example, alive with a diagnosis of cancer—and we are interested in several different endpoints, all of which are final. However, the progression of disease will usually consist of one or more intermediary events that may alter the progression to an endpoint. These events are neither initial states nor absorbing states. Here we consider one of the simplest multistate models, the illness-death model. stpm2illd is a postestimation command used after fitting a flexible parametric survival model with stpm2 to estimate the probability of being in each of four states as a function of time. There is also the option to generate confidence intervals and transition hazard functions. The new command is illustrated through a simple example.
Little's Test of Missing Completely at Random
Authors: Li Cheng
Published: November 2018

In missing-data analysis, Little's test (1988, Journal of the American Statistical Association 83: 1198–1202) is useful for testing the assumption of missing completely at random for multivariate, partially observed quantitative data. I introduce the mcartest command, which implements Little's missing completely at random test and its extension for testing the covariate-dependent missingness. The command also includes an option to perform the likelihood-ratio test with adjustment for unequal variances. I illustrate the use of mcartest through an example and evaluate the finite-sample performance of these tests in simulation studies.
Testing for Zero Inflation in Count Models: Bias Correction for the Vuong Test
Authors: Desmarais Bruce A. , Harden Jeffrey J.
Published: November 2018

The proportion of zeros in event-count processes may be inflated by an additional mechanism by which zeros are created. This has given rise to statistical models that accommodate zero inflation; these are available in Stata through the zip and zinb commands. The Vuong (1989, Econometrica 57: 307–333) test is regularly used to determine whether estimating a zero-inflation component is appropriate or whether a single-equation count model should be used. The use of the Vuong test in this case is complicated by the fact that zero-inflated models involve the estimation of several more parameters than the single-equation models. Although Vuong (1989, Econometrica 57: 307–333) suggested corrections to the test statistic to address the comparison of models with different numbers of parameters, Stata does not implement any such correction. The result is that the Vuong test used by Stata is biased toward supporting the model with a zero-inflation component, even when no zero inflation exists in the generative process. We provide new Stata commands for computing the Vuong statistic with corrections based on the Akaike and Bayesian (Schwarz) information criteria. In an extensive Monte Carlo study, we illustrate the bias inherent in using the uncorrected Vuong test, and we examine the relative merits of the Akaike and Schwarz corrections. Then, in an empirical example from international relations research, we show that errors in selecting an event-count model can have clear implications for substantive conclusions.
Parametric Inference using Structural Break Tests
Authors: Flynn Zachary L. , Magnusson Leandro M.
Published: November 2018

We present methods for testing hypotheses and estimating confidence sets for structural parameters of economic models in the presence of instabilities and breaks of unknown form. These methods constructively explore information generated by changes in the data-generating process to improve the inference of parameters that remain stable over time. The proposed methods are suitable for models cast in the generalized method of moments framework, which makes their application wide. Moreover, they are robust to the presence of weak instruments. The genstest command in Stata implements these methods to conduct hypothesis tests and to estimate confidence sets.
Sreweight: A Stata Command to Reweight Survey Data to External Totals
Authors: Pacifico Daniele
Published: November 2018

This article describes sreweight, a Stata command to reweight survey data to external aggregate totals.
Net Survival Estimation with Stns
Authors: Clerc-Urmès Isabelle , Grzebyk Michel , Hédelin Guy
Published: November 2018

In this article, we introduce a new Stata command to estimate the net survival function and the net cumulative hazard. The command includes graphic facilities. It was designed to have a similar syntax to sts, the Stata command dedicated to estimate survival and related functions. We present two examples to illustrate the use of this new command.
Estimating the Dose–Response Function through a Generalized Linear Model Approach
Authors: Guardabascio Barbara , Ventura Marco
Published: November 2018

In this article, we revise the estimation of the dose–response function described in Hirano and Imbens (2004, Applied Bayesian Modeling and Causal Inference from Incomplete-Data Perspectives, 73–84) by proposing a flexible way to estimate the generalized propensity score when the treatment variable is not necessarily normally distributed. We also provide a set of programs that accomplish this task. To do this, in the existing Dose-response program (Bia and Mattei, 2008, Stata Journal 8: 354–373), we substitute the maximum likelihood estimator in the first step of the computation with the more flexible generalized linear model.
Estimation and Testing of Binomial and Beta-Binomial Regression Models with and without Zero Inflation
Authors: Hardin James W. , Hilbe Joseph M.
Published: November 2018

We present new Stata commands for carrying out several regression commands suitable for binomial outcomes. The zib command extends Stata's binreg command to allow zero inflation. The betabin command fits binomial regression models allowing for beta overdispersion, and the zibbin command fits a beta-binomial regression model with zero inflation. All the new commands allow the specification of links within the glm command's collection for both outcome and zero inflation. The zero-inflated commands optionally calculate a Vuong test comparing the zero-inflated model with the nonzero-inflated model, and the zibbin command optionally includes a likelihood-ratio test of the overdispersion parameter.
A Smooth Covariate Rank Transformation for Use in Regression Models with a Sigmoid Dose–Response Function
Authors: Royston Patrick
Published: November 2018

We consider how to represent sigmoid-type regression relationships in a practical and parsimonious way. A pure sigmoid relationship has an asymptote at both ends of the range of a continuous covariate. Curves with a single asymptote are also important in practice. Many smoothers, such as fractional polynomials and restricted cubic regression splines, cannot accurately represent doubly asymptotic curves. Such smoothers may struggle even with singly asymptotic curves. Our approach to modeling sigmoid relationships involves applying a preliminary scaled rank transformation to compress the tails of the observed distribution of a continuous covariate. We include a step that provides a smooth approximation to the empirical cumulative distribution function of the covariate via the scaled ranks. The procedure defines the approximate cumulative distribution transformation of the covariate. To fit the substantive model, we apply fractional polynomial regression to the outcome with the smoothed, scaled ranks as the covariate. When the resulting fractional polynomial function is monotone, we have a sigmoid function. We demonstrate several practical applications of the approximate cumulative distribution transformation while also illustrating its ability to model some unusual functional forms. We describe a command, acd, that implements it.
Power Analyses for Detecting Effects for Multiple Coefficients in Regression
Authors: Aberson Christopher L.
Published: November 2018

I present applications of Stata to conduct power analysis for multiple regression. Simple power analyses are provided through the Stata command power and the user-written command powerreg. However, tools for power analysis for multiple regression coefficients are limited. I present strategies for detecting significant regression coefficients in a single study (for example, power estimates for two or more coefficients). I also address the power for detecting multiple effects (that is, the probability that all coefficients are statistically significant) in the same sample through the Monte Carlo approaches afforded by the simulate command.
Speaking Stata: Self and Others
Authors: Cox Nicholas J.
Published: November 2018

Data for people in a family, firms in a sector, or members of any kind of group are often analyzed using data for the other members in each group. Examples are the number of older children for each child in a family or the mean investment of other firms in the same year. Many such problems yield to simple logic, spelled out here in terms of useful Stata functions and commands. Operations under by:, or an equivalent by() option, are frequently called for, while the egen command offers a key tool for many calculations. Even when looping is needed, some helpful tricks can be identified.
Ivtreatreg: A Command for Fitting Binary Treatment Models with Heterogeneous Response to Treatment and Unobservable Selection
Authors: Cerulli Giovanni
Published: November 2018

In this article, I present ivtreatreg, a command for fitting four different binary treatment models with and without heterogeneous average treatment effects under selection-on-unobservables (that is, treatment endogeneity). Depending on the model specified by the user, ivtreatreg provides consistent estimation of average treatment effects by using instrumental-variables estimators and a generalized two-step Heckman selection model. The added value of this new command is that it allows for generalization of the regression approach typically used in standard program evaluation by assuming heterogeneous response to treatment. It also serves as a sort of toolbox for conducting joint comparisons of different treatment methods, thus readily permitting checks on the robustness of results.
Merger Simulation with Nested Logit Demand
Authors: Björnerstedt Jonas , Verboven Frank
Published: November 2018

In this article, we show how to implement merger simulation in Stata as a postestimation command, that is, after estimating an aggregate nested logit demand system with a linear regression model. We also show how to implement merger simulation when the demand parameters are not estimated but instead calibrated to be consistent with outside information on average price elasticities and profit margins. We allow for a variety of extensions, including the role of (marginal) cost savings, remedies (divestiture), and conduct different from Bertrand–Nash behavior.
Treatrew: A User-Written Command for Estimating Average Treatment Effects by Reweighting on the Propensity Score
Authors: Cerulli Giovanni
Published: November 2018

Reweighting is a popular statistical technique to deal with inference in the presence of a nonrandom sample, and various reweighting estimators have been proposed in the literature. This article presents the user-written command treatrew, which implements reweighting on the propensity-score estimator as proposed by Rosenbaum and Rubin (1983, Biometrika 70: 41–55) in their seminal article. The main contribution of this command lies in providing analytical standard errors for the average treatment effects in the whole population, in the subpopulation of the treated, and in that of the untreated. Standard errors are calculated using the approximation suggested by Wooldridge (2010, 920–930, Econometric Analysis of Cross Section and Panel Data [MIT Press]), but bootstrapped standard errors can also be easily computed. Because an implementation of this estimator with analytic standard errors and nonnormalized weights is missing in Stata, this article and the accompanying ado-file aim to provide the community with an easy-to-use method for reweighting on the propensity-score. The estimator proves to be a valuable tool for estimating average treatment effects under selection on observables.
Adaptive Markov Chain Monte Carlo Sampling and Estimation in Mata
Authors: Baker Matthew J.
Published: November 2018

I describe algorithms for drawing from distributions using adaptive Markov chain Monte Carlo (MCMC) methods; I introduce a Mata function for performing adaptive MCMC, amcmc(); and I present a suite of functions, amcmc_ *(), that allows an alternative implementation of adaptive MCMC. amcmc() and amcmc_ *() can be used with models set up to work with Mata's moptimize( ) (see [M-5] moptimize( )) or optimize( ) (see [M-5] optimize( )) or with standalone functions. To show how the routines can be used in estimation problems, I give two examples of what Chernozhukov and Hong (2003, Journal of Econometrics 115: 293–346) refer to as quasi-Bayesian or Laplace-type estimators—simulation-based estimators using MCMC sampling. In the first example, I illustrate basic ideas and show how a simple linear model can be fit by simulation. In the next example, I describe simulation-based estimation of a censored quantile regression model following Powell (1986, Journal of Econometrics 32: 143–155); the discussion describes the workings of the command mcmccqreg. I also present an example of how the routines can be used to draw from distributions without a normalizing constant and used in Bayesian estimation of a mixed logit model. This discussion introduces the command bayesmixedlogit.
Tools for Checking Calibration of a Cox Model in External Validation: Approach Based on Individual Event Probabilities
Authors: Royston Patrick
Published: November 2018

The Cox proportional hazards model has been used extensively in medicine over the last 40 years. A popular application is to develop a multivariable prediction model, often a prognostic model to predict the clinical outcome of patients with a particular disorder from “baseline” factors measured at some initial time point. For such a model to be useful in practice, it must be “validated”; that is, it must perform satisfactorily in an external sample of patients independent of the sample on which the model was originally developed. One key aspect of performance is calibration, which is the accuracy of prediction, particularly of survival (or equivalently, failure or event) probabilities at any time after the time origin. We believe systematic evaluation of the calibration of a Cox model has been largely ignored in the literature. In this article, we suggest an approach to assessing calibration using individual event probabilities estimated at different time points. We exemplify the method by detailed analysis of two datasets in the disease primary biliary cirrhosis; the datasets comprise a derivation and a validation dataset. We describe a new command, stcoxcal, that performs the necessary calculations. Results for stcoxcal can be displayed graphically, which makes it easier for users to picture calibration (or lack thereof) according to follow-up time.
Iop: Estimating Ex-Ante Inequality of Opportunity
Authors: Juárez Florian Wendelspiess Chávez , Soloaga Isidro
Published: November 2018

This article describes the user-written command iop to estimate ex-ante inequality of opportunity for different types of variables. Inequality of opportunity is the part of inequality that is due to circumstances beyond the control of the individual. Therefore, it is the ethically offensive part of inequality. Several estimation procedures have been proposed over the past years, and iop is a comprehensive and easy-to-use command that implements many of them. It handles continuous, dichotomous, and ordered variables. In addition to the point estimates, iop also provides bootstrap standard errors and two decomposition methods.
Femlogit—Implementation of the Multinomial Logit Model with Fixed Effects
Authors: Pforr Klaus
Published: November 2018

Fixed-effects models have become increasingly popular in social-science research. The possibility to control for unobserved heterogeneity makes these models a prime tool for causal analysis. Fixed-effects models have been derived and implemented for many statistical software packages for continuous, dichotomous, and count-data dependent variables. Chamberlain (1980, Review of Economic Studies 47: 225–238) derived the multinomial logistic regression with fixed effects. However, this model has not yet been implemented in any statistical software package. Possible applications would be analyses of effects on employment status, with special consideration of part-time or irregular employment, and analyses of effects on voting behavior that implicitly control for long-time party identification rather than measuring it directly. This article introduces an implementation of this model with the new command femlogit. I show its application with British election panel data.
Adjcatlogit, Ccrlogit, and Ucrlogit: Fitting Ordinal Logistic Regression Models
Authors: Fagerland Morten W.
Published: November 2018

In this article, I present three commands that perform adjacent-category logistic regression (adjcatlogit), constrained continuation-ratio logistic regression (ccrlogit), and unconstrained continuation-ratio logistic regression (ucrlogit) for ordered response data.
Collecting and Organizing Stata Graphs
Authors: Wolfe Joseph D. , Bauldry Shawn
Published: November 2018

Stata includes a powerful set of tools for constructing a wide array of graphs. Stata's graphing capabilities are well suited for describing exploratory or preliminary data analyses as well as producing publication-quality graphics. Currently, however, Stata does not have a built-in suite of commands for constructing various types of files (for example, HTML, TEX, or RTF files) to display multiple graphs. Such files can be invaluable for organizing and facilitating the interpretation of the numerous graphs needed throughout an analysis or in the final stage of a project. In this article, we provide an overview of two commands, graphsto and graphout, designed to organize and process multiple graphs across various file types.
Speaking Stata: Design Plots for Graphical Summary of a Response Given Factors
Authors: Cox Nicholas J.
Published: November 2018

Design plots, as defined in this article, show summaries of a response variable given the classes or distinct levels of numeric or string variables presented as influencing factors. Any summarize results can be plotted using statsby as an engine to produce summaries for groups of observations defined by classes and their cross-combinations. graph dot is used by default, but graphs may readily be recast using graph hbar or graph bar. Such plots offer scope for detailed yet concise data exploration and reporting.
Twopm: Two-Part Models
Authors: Belotti Federico , Deb Partha , Manning Willard G. , Norton Edward C.
Published: November 2018

In this article, we describe twopm, a command for fitting two-part models for mixed discrete-continuous outcomes. In the two-part model, a binary choice model is fit for the probability of observing a positive-versus-zero outcome. Then, conditional on a positive outcome, an appropriate regression model is fit for the positive outcome. The twopm command allows the user to leverage the capabilities of predict and margins to calculate predictions and marginal effects and their standard errors from the combined first- and second-part models.
More Power through Symbolic Computation: Extending Stata by using the Maxima Computer algebra system
Authors: Magno Giovanni L. Lo
Published: November 2018

Maxima is a free and open-source computer algebra system that can perform symbolic computations such as solving equations, determining derivatives of functions, obtaining Taylor series, and manipulating algebraic expressions. In this article, I present the Maxima Bridge System, which is a collection of software programs that allows Stata to interface with Maxima so that Maxima can be used for symbolic computation to transfer data from Stata to Maxima and to retrieve results from Maxima. The cooperation between Stata and Maxima provides an environment for statistical analysis in which symbolic computation can be easily used together with all the facilities supplied by Stata. In this environment, symbolic computation algorithms can be used to manage the complexity of algebra and calculus, whereas numerical computation can be used when speed matters. I also discuss the software architecture of the Maxima Bridge System, and I present several examples to illustrate how to develop new Stata commands that exploit the capabilities of Maxima.
Estimating Net Survival using a Life-Table Approach
Authors: Coviello Enzo , Seppä Karri , Dickman Paul W. , Pokhrel Arun
Published: November 2018

Cancer registries are often interested in estimating net survival (NS), the probability of survival if the cancer under study is the only possible cause of death. Pohar Perme, Stare, and Estéve (2012, Biometrics 68: 113–120) proposed a new estimator of NS based on inverse probability weighting. They demonstrated that existing estimators of NS based on relative survival were biased, whereas the new estimator was unbiased. The new estimator was developed for continuous survival times, yet cancer registries often have only discrete survival times (for example, survival time in completed months or years). Therefore, we propose an approach to estimation for when survival times are discrete. In this article, we describe the stnet command for life-table estimation of NS, adapting the Pohar Perme estimation approach to life-table estimation. Estimates can be made using a period or hybrid approach in addition to the traditional cohort (or complete) approach, and age-standardized survival estimates are available.
Estimating and Modeling Relative Survival
Authors: Dickman Paul W. , Coviello Enzo
Published: November 2018

When estimating patient survival using data collected by population-based cancer registries, it is common to estimate net survival in a relative-survival framework. Net survival can be estimated using the relative-survival ratio, which is the ratio of the observed survival of the patients (where all deaths are considered events) to the expected survival of a comparable group from the general population. In this article, we describe a command, strs, for life-table estimation of relative survival. We discuss three methods for estimating expected survival, as well as the cohort, period, and hybrid approaches for estimating relative survival. We also implement a life-table version of the Pohar Perme (2012, Biometrics 68: 113–120) estimator of net survival, and we describe two methods for age standardization. We also explain how, in addition to net probabilities of death, crude probabilities of death due to cancer and due to other causes can be estimated using the method of Cronin and Feuer (2000, Statistics in Medicine 19: 1729–1740). We conclude this article with discussion and examples of modeling excess mortality using various approaches, including the full-likelihood approach (using the ml command) and Poisson regression (using the glm command with a user-specified link function).
Dynemp: A Routine for Distributed Microdata Analysis of Business Dynamics
Authors: Criscuolo Chiara , Gal Peter N. , Menon Carlo
Published: November 2018

In this article, we introduce a new command, dynemp, that implements a distributed microdata analysis of business and employment dynamics and firm demographics. As its data source, dynemp requires business registers or comparable firm- or establishment-level longitudinal databases that cover the (near-)universe of companies in all business sectors. Access to such confidential data is usually restricted, and the microlevel data cannot be brought together to a single platform for cross-country analysis. To solve this confidentiality problem while also maintaining a high level of harmonization of the key economic concepts, dynemp can be distributed in a network of researchers who have access to the national confidential microdata. This way, the rich firm-level employment dynamics can be analyzed from new angles (such as firm age and size), significantly expanding the scope of analyses relying only on more aggregated data.
Global Search Regression: A New Automatic Model-selection Technique for Cross-section, Time-series, and Panel-data Regressions
Authors: Gluzmann Pablo , Panigo Demian
Published: November 2018

In this article, we present gsreg, a new automatic model-selection technique for cross-section, time-series, and panel-data regressions. Like other exhaustive search algorithms (for example, vselect), gsreg avoids characteristic path-dependence traps of standard approaches as well as backward- and forward-looking approaches (like PcGets or relevant transformation of the inputs network approach). However, gsreg is the first code that 1) guarantees optimality with out-of-sample selection criteria; 2) allows residual testing for each alternative; and 3) provides (depending on user specifications) a full-information dataset with outcome statistics for every alternative model.
Person-centered Treatment (PeT) Effects: Individualized Treatment Effects Using Instrumental Variables
Authors: Basu Anirban
Published: November 2018

I describe a command, petiv, that uses a local instrumental-variables (LIV) approach to estimate person-centered treatment effects for a variety of specifications for the LIV estimand as outlined in Basu (2014, Journal of Applied Econometrics 29: 671–691). The petiv command creates a new variable in the dataset that contains the person-centered treatment effects for each individual in the dataset. However, the command takes the validity of the instrumental variables and the specification of the LIV estimand as given. Appropriateness of these features of an LIV analysis should be determined before running the petiv command. The individual effects can be used to answer distributional questions and can also be easily aggregated to obtain mean treatment-effects estimates.
Multiple Imputation of Covariates by Substantive-model Compatible Fully Conditional Specification
Authors: Bartlett Jonathan W. , Morris Tim P.
Published: November 2018

Multiple imputation is a practical, principled approach to handling missing data. When used to impute missing values in covariates of regression models, imputation models may be misspecified if they are not compatible with the substantive model of interest for the outcome. In this article, we introduce the smcfcs command, which imputes covariates by substantive-model compatible fully conditional specification. This modifies the popular fully conditional specification or chained-equations approach to multiple imputation by imputing each covariate compatibly with a user-specified substantive model. We compare the smcfcs command with standard fully conditional specification imputation using mi impute chained in a simulation study and illustrative analysis of data from a study investigating time to tumor recurrence in breast cancer.
Top 10 Stata “Gotchas”
Authors: Shaw Jonathan
Published: November 2018

Stata is a powerful and user-friendly package for setting up data and performing statistical analysis. Nevertheless, some features often cause unexpected errors that users either fail to notice or spend hours trying to correct. In this article, I list my top 10 Stata “gotchas” and suggest ways to combat them. Awareness of these “gotchas” will hopefully help newer users—particularly those making their first forays into Stata programming—avoid the most common pitfalls.