bluuebunny/crossref_metadata_2025 huggingface dataset:
Goodness-of-Fit Tests for Categorical Data
Authors: Bellocco Rino , Algeri Sara
Published: November 2018

A significant aspect of data modeling with categorical predictors is the definition of a saturated model. In fact, there are different ways of specifying it—the casewise, the contingency table, and the collapsing approaches—and they strictly depend on the unit of analysis considered.

The analytical units of reference could be the subjects or, alternatively, groups of subjects that have the same covariate pattern. In the first case, the goal is to predict the probability of success (failure) for each individual; in the second case, the goal is to predict the proportion of successes (failures) in each group. The analytical unit adopted does not affect the estimation process; however, it does affect the definition of a saturated model. Consequently, measures and tests of goodness of fit can lead to different results and interpretations. Thus one must carefully consider which approach to choose.

In this article, we focus on the deviance test for logistic regression models. However, the results and the conclusions are easily applicable to other linear models involving categorical regressors.

We show how Stata 12.1 performs when implementing goodness of fit. In this situation, it is important to clarify which one of the three approaches is implemented as default. Furthermore, a prominent role is played by the shape of the dataset considered (individual format or events–trials format) in accordance with the analytical unit choice. In fact, the same procedure applied to different data structures leads to different approaches to a saturated model. Thus one must attend to practical and theoretical statistical issues to avoid inappropriate analyses.
Simulation-Based Sample-Size Calculation for Designing New Clinical Trials and Diagnostic Test Accuracy Studies to Update an Existing Meta-Analysis
Authors: Crowther Michael J. , Hinchliffe Sally R. , Donald Alison , Sutton Alex J.
Published: November 2018

In this article, we describe a suite of commands that enable the user to estimate the probability that the conclusions of a meta-analysis will change with the inclusion of a new study, as described previously by Sutton et al. (2007, Statistics in Medicine 26: 2479–2500). Using the metasim command, we take a simulation approach to estimating the effects in future studies. The method assumes that the effect sizes of future studies are consistent with those observed previously, as represented by the current meta-analysis. Two-arm randomized controlled trials and studies of diagnostic test accuracy are considered for a variety of outcome measures. Calculations are possible under both fixed- and random-effects assumptions, and several approaches to inference, including statistical significance and limits of clinical significance, are possible. Calculations for specific sample sizes can be conducted (by using metapow). Plots, akin to traditional power curves, can be produced (by using metapowplot) to indicate the probability that a new study will change inferences for a range of sample sizes. Finally, plots of the simulation results are overlaid on extended funnel plots by using extfunnel, described in Crowther, Langan, and Sutton (2012, Stata Journal 12: 605–622), which can help to intuitively explain the results of such calculations of sample size. We hope the command will be useful to trialists who want to assess the potential impact new trials will have on the overall evidence base and to meta-analysts who want to assess the robustness of the current meta-analysis to the inclusion of future data.
Response Mapping to Translate Health Outcomes into the Generic Health-Related Quality-of-Life Instrument EQ-5D: Introducing the mrs2eq and oks2eq Commands
Authors: Ramos-Gonñi Juan Manuel , Rivero-Arias Oliver , Dakin Helen
Published: November 2018

Reliable and accurate mapping techniques that translate health-related quality-of-life data into EQ-5D index values are now in demand by researchers conducting economic evaluation of health care technologies. In this article, we present two commands (mrs2eq and oks2eq) that translate data from two widely used disease-specific instruments into EQ-5D index values and predicted probabilities of being at a particular level on each EQ-5D domain. mrs2eq conducts a response mapping approach to transform data from the stroke-specific modified Rankin scale into index values from the generic quality-of-life EQ-5D instrument. oks2eq uses a response mapping model to estimate EQ-5D index values based on patients’ responses to the Oxford Knee Score.
Valid Tests when Instrumental Variables do not Perfectly Satisfy the Exclusion Restriction
Authors: Riquelme Andrés , Berkowitz Daniel , Caner Mehmet
Published: November 2018

There is a growing consensus that it is difficult to pick instruments that perfectly satisfy the exclusion restriction. Drawing on results from Berkowitz, Caner, and Fang (2012, Journal of Econometrics 166: 255–266), we provide in this article a nontechnical summary of how valid inferences can be made when instrumental variables come close to satisfying the exclusion restriction. Although the Anderson–Rubin (1949, Annals of Mathematical Statistics 20: 46–63) test statistic is robust to weak identification, it assumes that the instruments are perfectly orthogonal to the structural error term and is therefore oversized under mild violations of the orthogonality condition. The fractionally resampled Anderson–Rubin (FAR) test is a modification of the Anderson–Rubin test that accounts for violations of the orthogonality condition. We show that in small samples, the size of the resampling block of the FAR test can be modified to obtain valid critical values and analyze its size and power properties. We focus on power and not on size-adjusted power because the FAR test uses only one critical value in its application. We also describe user-written commands to implement the Anderson–Rubin and FAR tests in Stata.
Distribution-Free Estimation of Heteroskedastic Binary Response Models in Stata
Authors: Blevins Jason R. , Khan Shakeeb
Published: November 2018

In this article, we consider two recently proposed semiparametric estimators for distribution-free binary response models under a conditional median restriction. We show that these estimators can be implemented in Stata by using the nl command through simple modifications to the nonlinear least-squares probit criterion function. We then introduce dfbr, a new Stata command that implements these estimators, and provide several examples of its usage. Although it is straightforward to carry out the estimation with nl, the dfbr implementation uses Mata for improved performance and robustness.
Lclogit: A Stata Command for Fitting Latent-Class Conditional Logit Models via the Expectation-Maximization Algorithm
Authors: Pacifico Daniele , Yoo Hong il
Published: November 2018

In this article, we describe lclogit, a Stata command for fitting a discrete-mixture or latent-class logit model via the expectation-maximization algorithm.
Speaking Stata: Trimming to Taste
Authors: Cox Nicholas J.
Published: November 2018

Trimmed means are means calculated after setting aside zero or more values in each tail of a sample distribution. Here we focus on trimming equal numbers in each tail. Such trimmed means define a family or function with mean and median as extreme members and are attractive as simple and easily understood summaries of the general level (location, central tendency) of a variable. This article provides a tutorial review of trimmed means, emphasizing the scope for trimming to varying degrees in describing and exploring data. Detailed remarks are included on the idea's history, plotting of results, and confidence interval procedures. Examples are given using astronomical and medical data. The new Stata commands trimmean and trimplot are also included.
Attributable and Unattributable Risks and Fractions and other Scenario Comparisons
Authors: Newson Roger B.
Published: November 2018

Scenarios are alternative versions of the same dataset with the same variables but different observations or values. Applied scientists frequently want to predict how much good an intervention will do by comparing outcomes from the same model between different scenarios. Alternatively, they may want to compare outcomes between different models applied to the same scenario, for instance, when standardizing statistics from different subpopulations to a common gender and age distribution. Standard Stata tools for scenario means and comparisons are margins and pwcompare. A suite of packages is presented for estimating scenario means and comparisons by using margins, together with normalizing and variance-stabilizing transformations implemented by using nlcom.margprev estimates marginal prevalences; marglmean estimates marginal arithmetic means; regpar estimates the difference between two marginal prevalences (the population attributable risk); punaf estimates the ratio between two marginal arithmetic means (the population unattributable fraction); and punafcc estimates a marginal mean between-scenario risk or hazard ratio for case–control or survival data (also known as a population unattributable fraction). The population unattributable fraction and its confidence limits are subtracted from 1 to estimate the population attributable fraction. Formulas and examples are presented, including an example from the Global Allergy and Asthma European Network.
Dealing with Identifier Variables in Data Management and Analysis
Authors: Jeanty P. Wilner
Published: November 2018

Identifier variables are prominent in most data files and, more often than not, are essential to fully use the information in a Stata dataset. However, rendering them in the proper format and relevant number of digits appropriate for data management and statistical analysis might pose unnerving challenges to inexperienced or even veteran Stata users. To lessen these challenges, I provide some useful tips and guard against some pitfalls by featuring two official Stata routines: the string() function and its elaborated wrapper, the tostring command. I illustrate how to use these two routines to address the difficulties caused by identifier variables in managing and analyzing data from private institutions and U.S. government agencies.
Implementation of a Double-Hurdle Model
Authors: García Bruno
Published: November 2018

Corner solution responses are frequently observed in the social sciences. One common approach to model phenomena that give rise to corner solution responses is to use the tobit model. If the decision to participate in the market is decoupled from the consumption amount decision, then the tobit model is inappropriate. In these cases, the double-hurdle model presented in Cragg (1971, Econometrica 39: 829–844) is an appropriate alternative to the tobit model. In this article, I introduce a command, dblhurdle, that fits the double-hurdle model. The implementation allows the errors of the participation decision and the amount decision to be correlated. The capabilities of predict after dblhurdle are also discussed.
A Score Test for Group Comparisons in Single-Index Models
Authors: Guimarães Paulo
Published: November 2018

In this article, I derive a score test for the equality of one or more parameters across groups of observations following estimation of a single-index model. The test has a wide array of applications and nests Pearson's chi-squared test as a particular case. The postestimation command scoregrp implements the test and works with logit, logistic, probit, poisson, or regress (see [R] logit, [R] logistic, [R] probit, [R] poisson, and [R] regress). Finally, I show some applications of the test.
Miivfind: A Command for Identifying Model-Implied Instrumental Variables for Structural Equation Models in Stata
Authors: Bauldry Shawn
Published: November 2018

This article presents a new Stata command, miivfind, that implements an algorithm developed by Bollen and Bauer (2004, Sociological Methods and Research 32: 425–452) to find the model-implied instrumental variables (MIIVs) from an identified structural equation model. MIIVs allow researchers to draw on instrumental-variable estimators, such as two-stage least-squares estimators, to obtain estimates for the parameters of a hypothesized structural equation model. It can be difficult to identify MIIVs by inspection of either a diagram of the model or the model equations. Two examples are provided that illustrate the use of miivfind to identify MIIVs and some of the advantages of a MIIV estimator as compared with a maximum likelihood estimator. By assisting in the process of finding MIIVs, miivfind facilitates the use of an alternative class of estimators, instrumental-variable estimators, to the standard maximum-likelihood and asymptotic-distribution free estimators available for structural equation models.
Indirect Treatment Comparison
Authors: Miladinovic Branko , Chaimani Anna , Hozo Iztok , Djulbegovic Benjamin
Published: November 2018

This article presents a command, indirect, for the estimation of effects of multiple treatments in the absence of randomized controlled trials for direct comparisons of interventions.
Reports and other PDF Documents
Authors: Cámara Rafael J. A.
Published: November 2018

Stata users often need to combine text, tables, and figures. The author's command, lpdf, generates reports and other PDF documents. lpdf compiles text stored in global macros, tables stored as dataset tables or LATEX table input files, and figures stored as Stata graphs or PDF figure files. LATEX must be installed, but familiarity with LATEX is not necessary. lpdf performs every step through Stata and with Stata syntax. It generates documents in report or article style and portrait or landscape orientation. The default author name, document title, and date can be modified. Further format options include the font and margin sizes. For each table and figure, the width and layout can be adapted. Stata users with LATEX skills may benefit from additional possibilities. The lpdf ado-file includes two other useful commands called latexize and latext. latexize processes the content of string variables to properly type special characters and symbols in LATEX input files. latext modifies text stored in global macros in the same way.
Self-Consistent Density Estimation
Authors: Luedicke Joerg , Bernacchia Alberto
Published: November 2018

Estimating a continuous density function from a finite set of data points is an important tool in many scientific disciplines. Popular nonparametric density estimators include histograms and kernel density methods. These methods require the researcher to control the degree of smoothing inherent in an estimated function. In a recent approach, a new method for nonparametric density estimation was proposed that finds the estimate self-consistently, that is without requiring the researcher to choose a smoothing parameter a priori. In this article, we outline the basic ideas of the self-consistent density estimator, and we present a Stata implementation of the method. In addition, we present results of Monte Carlo simulations that show that the self-consistent estimator performs better than other methods, especially for larger data samples.
Simulated Multivariate Random-Effects Probit Models for Unbalanced Panels
Authors: Plum Alexander
Published: November 2018

This article develops a method for implementing a simulated multivariate random-effects probit model for unbalanced panels (with gaps) and illustrates the model by using artificial data. Halton draws generated by mdraws are used to simulate multivariate normal probabilities with the mvnp() egen function. The estimator can be easily adjusted, for example, to allow for autocorrelated errors. The advantages of this simulated estimation, when compared with existing commands such as redpace, are high accuracy and improved stability.
Regression Models for Count Data Based on the Negative Binomial(p) Distribution
Authors: Hardin James W. , Hilbe Joseph M.
Published: November 2018

We present new Stata commands for estimating several regression models suitable for analyzing overdispersed count outcomes. The nbregp command nests the dispersion(constant) and dispersion(mean) versions of Stata's nbreg command in a model for negative binomial( p) regression. The zignbreg command extends Stata's gnbreg command for zero inflation, and the zinbregp command fits a negative binomial( p) regression model with zero inflation. The new commands for zero-inflated models allow specification of links within the glm command's collection for the Bernoulli model of zero inflation. These commands will optionally calculate a Vuong test, which compares the zero-inflated model with the nonzero-inflated model.
Density-Based Empirical Likelihood Procedures for Testing Symmetry of Data Distributions and K-Sample Comparisons
Authors: Vexler Albert , Tanajian Hovig , Hutson Alan D.
Published: November 2018

In practice, parametric likelihood-ratio techniques are powerful statistical tools. In this article, we propose and examine novel and simple distribution-free test statistics that efficiently approximate parametric likelihood ratios to analyze and compare distributions of K groups of observations. Using the density-based empirical likelihood methodology, we develop a Stata package that applies to a test for symmetry of data distributions and compares K-sample distributions. Recognizing that recent statistical software packages do not sufficiently address K-sample nonparametric comparisons of data distributions, we propose a new Stata command, vxdbel, to execute exact density-based empirical likelihood-ratio tests using K samples. To calculate p-values of the proposed tests, we use the following methods: 1) a classical technique based on Monte Carlo p-value evaluations; 2) an interpolation technique based on tabulated critical values; and 3) a new hybrid technique that combines methods 1 and 2. The third, cutting-edge method is shown to be very efficient in the context of exact-test p-value computations. This Bayesian-type method considers tabulated critical values as prior information and Monte Carlo generations of test statistic values as data used to depict the likelihood function. In this case, a nonparametric Bayesian method is proposed to compute critical values of exact tests.
A Menu-Driven Facility for Power and Detectable-Difference Calculations in Stepped-Wedge Cluster-Randomized Trials
Authors: Hemming Karla , Girling Alan
Published: November 2018

This article introduces the Stata menu-driven program steppedwedge, which calculates detectable differences and power for stepped-wedge randomized trials. The command permits continuous, binary, and rate outcomes (with normal approximations) for comparisons using two-sided tests. The command allows specification of the number of clusters randomized at each step, the number of steps and the average cluster (cell) size, or an incomplete design in which the user spec-ifies the design pattern (a matrix with one row per cluster, one column per time point, and entries indicating exposure and observable data). Cluster heterogeneity can be parameterized using either the intracluster correlation or the coefficient of variation (of the outcome). The command is illustrated via examples.
Stata Command for Calculating Adverse Event and Efficacy Stopping Boundaries for Phase II Single-Arm Trials
Authors: Fellman Bryan M.
Published: November 2018

Many programs and functions in statistical packages focus on the final stage of clinical trials, that is, the data analysis. In this article, I aim to assist in the early stages of clinical trials, specifically, the design of phase II single-arm trials. I present the new command stopbound, which calculates stopping boundaries and operating characteristics based on monitoring an adverse event, efficacy, or an adverse event and efficacy.
A Command for Significance and Power to Test for the Existence of a Unique Most Probable Category
Authors: Fellman Bryan M. , Ensor Joe
Published: November 2018

The analysis of multinomial data often includes the following question of interest: Is a particular category the most populous (that is, does it have the largest probability)? Berry (2001, Journal of Statistical Planning and Inference 99: 175–182) developed a likelihood-ratio test for assessing the evidence for the existence of a unique most probable category. Nettleton (2009, Journal of the American Statistical Association 104: 1052–1059) developed a likelihood-ratio test for testing whether a particular category was most probable, showed that the test was an example of an intersection-union test, and proposed other intersection-union tests for testing whether a particular category was most probable. He extended his likelihood-ratio test to the existence of a unique most probable category and showed that his test was equivalent to the test developed by Berry (2001, Journal of Statistical Planning and Inference 99: 175–182). Nettleton (2009, Journal of the American Statistical Association 104: 1052–1059) showed that the likelihood ratio for identifying a unique most probable cell could be viewed as a union-intersection test. The purpose of this article is to survey different methods and present a command, cellsupremacy, for the analysis of multinomial data as it pertains to identifying the significantly most probable category; the article also presents a command for sample-size calculations and power analyses, power cellsupremacy, that is useful for planning multinomial data studies.
Modeling Count Data with Generalized Distributions
Authors: Harris Tammy , Hilbe Joseph M. , Hardin James W.
Published: November 2018

We present motivation and new commands for modeling count data. While our focus is to present new commands for estimating count data, we also discuss generalized binomial regression and present the zero-inflated versions of each model.
Csvconvert: A Simple Command to Gather Comma-Separated Value Files into Stata
Authors: Gaggero Alberto A.
Published: November 2018

This command meets the need of a researcher who holds multiple data files in comma-separated value format differing by a period variable (for example, year or quarter) or by a cross-sectional variable (for example, country or firm) and must combine them into one Stata-format file.
Panel Cointegration Analysis with Xtpedroni
Authors: Neal Timothy
Published: November 2018

In this article, I introduce the new command xtpedroni, which implements the Pedroni (1999, Oxford Bulletin of Economics and Statistics 61: 653–670; 2004, Econometric Theory 20: 597–625) panel cointegration test and the Pedroni (2001, Review of Economics and Statistics 83: 727–731) group-mean panel-dynamic ordinary least-squares estimator. For nonstationary heterogeneous panels that are long (large T) and wide (large N), xtpedroni tests for cointegration among one or more regressors by using seven test statistics under the null of no cointegration, and it also estimates the cointegrating equation for each individual as well as the group mean of the panel. The test can include common time dummies and unbalanced panels.
Stata and Dropbox
Authors: Hicks Raymond
Published: November 2018

Dropbox makes scholarly collaboration much easier because it allows scholars to share files across different computers. However, because the Dropbox directories have different pathnames for different users, sharing do-files can be complicated. In this article, I offer some tips on how to navigate pathnames in do-files when using Dropbox, and I present a command that automatically finds and changes to a user's Dropbox directory.
Dhreg, Xtdhreg, and Bootdhreg: Commands to Implement Double-Hurdle Regression
Authors: Engel Christoph , Moffatt Peter G.
Published: November 2018

The dhreg command implements maximum likelihood estimation of the double-hurdle model for continuously distributed outcomes. The command includes the option to fit a p-tobit model, that is, a model that estimates only an intercept for the hurdle equation. The bootdhreg command (the bootstrap version of dhreg) may be convenient if the data-generating process is more complicated or if heteroskedasticity is suspected. The xtdhreg command is a random-effects version of dhreg applicable to panel data. However, this estimator differs from standard random-effects estimators in the sense that the outcome of the first hurdle applies to the complete set of observations for a given subject instead of applying at the level of individual observations. Command options include estimation of a correlation parameter capturing dependence between the two hurdles.
Txttool: Utilities for Text Analysis in Stata
Authors: Williams Unislawa , Williams Sean P.
Published: November 2018

This article describes txttool, a command that provides a set of tools for managing free-form text. The command integrates several built-in Stata functions with new text capabilities. These latter functions include a utility to create a bag-of-words representation of text and an implementation of Porter's (1980, Program: Electronic library and information systems 14: 130–137) word-stemming algorithm. Collectively, these utilities provide a text-processing suite for text mining and other text-based applications in Stata.
Analysis of Partially Observed Clustered Data using Generalized Estimating Equations and Multiple Imputation
Authors: Aloisio Kathryn M. , Micali Nadia , Swanson Sonja A. , Field Alison , Horton Nicholas J.
Published: November 2018

Clustered data arise in many settings, particularly within the social and biomedical sciences. For example, multiple-source reports are commonly collected in child and adolescent psychiatric epidemiologic studies where researchers use various informants (for instance, parents and adolescents) to provide a holistic view of a subject's symptoms. Fitzmaurice et al. (1995, American Journal of Epidemiology 142: 1194–1203) have described estimation of multiple-source models using a standard generalized estimating equation (GEE) framework. However, these studies often have missing data because additional stages of consent and assent are required. The usual GEE is unbiased when data are missing completely at random in the context of Little and Rubin (2002, Statistical Analysis with Missing Data [Wiley]). This is a strong assumption that may not be tenable. Other options, such as the weighted GEE, are computationally challenging when missingness is nonmonotone. Multiple imputation is an attractive method to fit incomplete data models while requiring only the less restrictive missing-at-random assumption. Previously, estimation of partially observed clustered data was computationally challenging. However, recent developments in Stata have facilitated using them in practice. We demonstrate how to use multiple imputation in conjunction with a GEE to investigate the prevalence of eating disorder symptoms in adolescents as reported by parents and adolescents and to determine the factors associated with concordance and prevalence. The methods are motivated by the Avon Longitudinal Study of Parents and their Children, a cohort study that enrolled more than 14,000 pregnant mothers in 1991–92 and has followed the health and development of their children at regular intervals. While point estimates for the missing-at-random model were fairly similar to those for the GEE under missing completely at random, the missing-at-random model had smaller standard errors and required less stringent assumptions regarding missingness.
General-to-Specific Modeling in Stata
Authors: Clarke Damian
Published: November 2018

Empirical researchers are frequently confronted with issues regarding which explanatory variables to include in their models. This article describes the application of a well-known model-selection algorithm to Stata: general-to-specific (GETS) modeling. This process provides a prescriptive and defendable way of selecting a few relevant variables from a large list of potentially important variables when fitting a regression model. Several empirical issues in GETS modeling are then discussed, specifically, how such an algorithm can be applied to estimations based upon cross-sectional, time-series, and panel data. A command is presented, written in Stata and Mata, that implements this algorithm for various data types in a flexible way. This command is based on Stata's regress or xtreg command, so it is suitable for researchers in the broad range of fields where regression analysis is used. Finally, the genspec command is illustrated using data from applied studies of GETS modeling with Monte Carlo simulation. It is shown to perform as empirically predicted and to have good size and power (or gauge and potency) properties under simulation.
Robust Data-Driven Inference in the Regression-Discontinuity Design
Authors: Calonico Sebastian , Cattaneo Matias D. , Titiunik Rocío
Published: November 2018

In this article, we introduce three commands to conduct robust data-driven statistical inference in regression-discontinuity (RD) designs. First, we present rdrobust, a command that implements the robust bias-corrected confidence intervals proposed in Calonico, Cattaneo, and Titiunik (2014d, Econometrica 82: 2295–2326) for average treatment effects at the cutoff in sharp RD, sharp kink RD, fuzzy RD, and fuzzy kink RD designs. This command also implements other conventional nonparametric RD treatment-effect point estimators and confidence intervals. Second, we describe the companion command rdbwselect, which implements several bandwidth selectors proposed in the RD literature. Following the results in Calonico, Cattaneo, and Titiunik (2014a, Working paper, University of Michigan), we also introduce rdplot, a command that implements several data-driven choices of the number of bins in evenly spaced and quantile-spaced partitions that are used to construct the RD plots usually encountered in empirical applications. A companion R package is described in Calonico, Cattaneo, and Titiunik (2014b, Working paper, University of Michigan).
Time-Efficient Algorithms for Robust Estimators of Location, Scale, Symmetry, and Tail heaviness
Authors: Gelade Wouter , Verardi Vincenzo , Vermandele Catherine
Published: November 2018

The analysis of the empirical distribution of univariate data often includes the computation of location, scale, skewness, and tail-heaviness measures, which are estimates of specific parameters of the underlying population distribution. Several measures are available, but they differ by Gaussian efficiency, robustness regarding outliers, and meaning in the case of asymmetric distributions. In this article, we briefly compare, for each type of parameter (location, scale, skewness, and tail heaviness), the “classical” estimator based on (centered) moments of the empirical distribution, an estimator based on specific quantiles of the distribution, and an estimator based on pairwise comparisons of the observations. This last one always performs better than the other estimators, particularly in terms of robustness, but it requires a heavy computation time of an order of n2. Fortunately, as explained in Croux and Rousseeuw (1992, Computational Statistics 1: 411–428), the algorithm of Johnson and Mizoguchi (1978, SIAM Journal of Scientific Computing 7: 147–153) allows one to substantially reduce the computation time to an order of n log n and, hence, allows the use of robust estimators based on pairwise comparisons, even in very large datasets. This has motivated us to program this algorithm for Stata. In this article, we describe the algorithm and the associated commands. We also illustrate the computation of these robust estimators by involving them in a normality test of Jarque–Bera form (Jarque and Bera 1980, Economics Letters 6: 255–259; Brys, Hubert, and Struyf, 2008, Computational Statistics 23: 429–442) using real data.
Bayesian Optimal Interval Design for Phase I Oncology Clinical Trials
Authors: Fellman Bryan M. , Yuan Ying
Published: November 2018

The Bayesian optimal interval (BOIN) design is a novel phase I trial design for finding the maximum tolerated dose (MTD). With the BOIN design, phase I trials are conducted as a sequence of decision-making steps for assigning an appropriate dose for each enrolled patient. The design optimizes the assignment of doses to patients by minimizing incorrect decisions of dose escalation or deescalation; that is, it decreases the chance of erroneously escalating or de-escalating the dose when the current dose is higher or lower than the MTD. This feature of the BOIN design strongly ensures adherence to ethical standards. The most prominent advantage of the BOIN design is that it simultaneously achieves design simplicity and superior performance in comparison with similar methods. The BOIN design can be implemented in a simple way that is similar to the 3 + 3 design, but it yields substantially better operating characteristics. Compared with the well-known continual reassessment method, the BOIN design yields average performance when selecting the MTD, but it has a substantially lower risk of assigning patients to subtherapeutic or overly toxic doses. In this article, we present a command (optinterval) for implementing the BOIN design in a phase I clinical trial setting.
A Robust Test for Weak Instruments in Stata
Authors: Pflueger Carolin E. , Wang Su
Published: November 2018

We introduce a routine, weakivtest, that implements the test for weak instruments by Montiel Olea and Pflueger (2013, Journal of Business and Economic Statistics 31: 358–369). weakivtest allows for errors that are not conditionally homoskedastic and serially uncorrelated. It extends the Stock and Yogo (2005, Testing for weak instruments in linear IV regression. In Identification and Inference for Econometric Models: Essays in Honor of Thomas Rothenberg, ed. D. W. K. Andrews and J. J. Stock, 80–108. [Cambridge University Press]) weak-instrument tests available in ivreg2 and in the ivregress postestimation command estat firststage.weakivtest tests the null hypothesis that instruments are weak or that the estimator's Nagar (1959, Econometrica 27: 575–595) bias is large relative to a benchmark for both two-stage least-squares estimation and limited-information maximum likelihood with one endogenous regressor. The routine can accommodate Eicker–Huber–White heteroskedasticity robust estimates, Newey and West (1987, Econometrica 55: 703–708) heteroskedasticity- and autocorrelation-consistent estimates, and clustered variance estimates.
Regression Models for Count Data from Truncated Distributions
Authors: Hardin James W. , Hilbe Joseph M.
Published: November 2018

We present new commands for analyzing count-data regression models for truncated distributions. The trncregress command allows specification of a regression model for the mean of the truncated distribution through options. In addition to support for truncated Poisson and negative binomial, trncregress fits models based on truncated versions of distributions including generalized Poisson, Poisson-inverse Gaussian, three-parameter negative binomial power, three-parameter Waring negative binomial, and three-parameter Famoye negative binomial.
Tools for Checking Calibration of a Cox Model in External Validation: Prediction of Population-Averaged Survival Curves Based on Risk Groups
Authors: Royston Patrick
Published: November 2018

Royston (2014, Stata Journal 14: 738–755) explained how a popular application of the Cox proportional hazards model “is to develop a multivariable prediction model, often a prognostic model to predict the future 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 one 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”. In this article, I suggest an approach to assess calibration by comparing observed (Kaplan–Meier) and predicted survival probabilities in several prognostic groups derived by placing cutpoints on the prognostic index. I distinguish between full validation, where all relevant quantities are estimated on the derivation dataset and predicted on the validation dataset, and partial validation, where the prognostic index and prognostic groups are derived from published information and the baseline distribution function is estimated in the validation dataset. Partial validation is more feasible in practice because it is uncommon to have access to individual patient values in both datasets. I exemplify the method by detailed analysis of two datasets in the disease primary biliary cirrhosis; the datasets comprise a derivation and a validation dataset. I describe a new ado-file, stcoxgrp, that performs the necessary calculations. Results for stcoxgrp are displayed graphically, which makes it easier for users to picture calibration (or lack thereof) according to follow-up time.
Generating Nonnegatively Correlated Binary Random Variates
Authors: Chen Minxing
Published: November 2018

In this article, I discuss the methods for generating nonnegatively correlated binary random variates. I provide a new command, rbinary, with examples showing how the command can be used.
A Menu-driven Facility for Sample-size Calculation in Multiarm, Multistage Randomized Controlled Trials with Time-to-event Outcomes: Update
Authors: Bratton Daniel J. , Choodari-Oskooei Babak , Royston Patrick
Published: November 2018

Barthel, Royston, and Parmar (2009, Stata Journal 9: 505–523) presented a menu-driven Stata program for calculating sample size and other design characteristics for a class of multiarm, multistage trials with time-to-event outcomes. In this article, we present several new features for the package. First, we allow hazard ratios greater than 1 to be targeted under the alternative hypothesis to make the design more widely applicable to other outcomes and disease areas. Second, we introduce new subroutines that use simulation to more accurately estimate the correlation between treatment effects at different stages and that calculate the familywise error rate, and we apply them to an example using the original design of the multiarm, multistage trial in prostate cancer. Finally, we present a new design of the dialog menu for nstage that improves its usability and incorporates options for calling the new subroutines.
Bounding Treatment Effects: A Command for the Partial Identification of the Average Treatment Effect with Endogenous and Misreported Treatment Assignment
Authors: McCarthy Ian , Millimet Daniel L. , Roy Manan
Published: November 2018

We present a new command, tebounds, that implements a variety of techniques to bound the average treatment effect of a binary treatment on a binary outcome in light of endogenous and misreported treatment assignment. To tighten the worst case bounds, the monotone treatment selection, monotone treatment response, and monotone instrumental-variable assumptions of Manski and Pepper (2000, Econometrica 68: 997–1010), Kreider and Pepper (2007, Journal of the American Statistical Association 102: 432–441), Kreider et al. (2012, Journal of the American Statistical Association 107: 958–975), and Gundersen, Kreider, and Pepper (2012, Journal of Econometrics 166: 79–91) may be imposed. Imbens–Manski confidence intervals are provided.
Conducting Interrupted Time-series Analysis for Single- and Multiple-group Comparisons
Authors: Linden Ariel
Published: November 2018

In this article, I introduce the itsa command, which performs interrupted time-series analysis for single- and multiple-group comparisons. In an interrupted time-series analysis, an outcome variable is observed over multiple, equally spaced time periods before and after the introduction of an intervention that is expected to interrupt its level or trend. The itsa command estimates the effect of an intervention on an outcome variable either for a single treatment group or when compared with one or more control groups. Additionally, its options allow the user to control for autocorrelated disturbances and to estimate treatment effects over multiple periods.
Generalized Maximum Entropy Estimation of Discrete Choice Models
Authors: Corral Paul , Terbish Mungo
Published: November 2018

In this article, we describe the gmentropylogit command, which implements the generalized maximum entropy estimation methodology for discrete choice models. This information theoretic procedure is preferred over its maximum likelihood counterparts because it is more efficient, avoids strong parametric assumptions, works well when the sample size is small, performs well when the covariates are highly correlated, and functions well when the matrix is ill conditioned. Here we introduce the generalized maximum entropy procedure and provide an example using the gmentropylogit command.
A General-purpose Nomogram Generator for Predictive Logistic Regression Models
Authors: Zlotnik Alexander , Abraira Víctor
Published: November 2018

Multivariate logistic regression is a statistical method commonly used in several fields to build predictive models. A nomogram is a tool that provides graphical depictions of all variables in the model and enables the user to easily compute output probabilities. Our objective was to build a flexible and easy-to-use nomogram generator in Stata. The script works after arbitrary logit or logistic commands.
Record Linkage Using Stata: Preprocessing, Linking, and Reviewing Utilities
Authors: Wasi Nada , Flaaen Aaron
Published: November 2018

In this article, we describe Stata utilities that facilitate probabilistic record linkage—the technique typically used for merging two datasets with no common record identifier. While the preprocessing tools are developed specifically for linking two company databases, the other tools can be used for many different types of linkage. Specifically, the stnd_compname and stnd_address commands parse and standardize company names and addresses to improve the match quality when linking. The reclink2 command is a generalized version of Blasnik's reclink (2010, Statistical Software Components S456876, Department of Economics, Boston College) that allows for many-to-one matching. Finally, clrevmatch is an interactive tool that allows the user to review matched results in an efficient and seamless manner. Rather than exporting results to another file format (for example, Excel), inputting clerical reviews, and importing back into Stata, one can use the clrevmatch tool to conduct all of these steps within Stata. This helps improve the speed and flexibility of matching, which often involves multiple runs.
Estimating Treatment Effects for Ordered Outcomes Using Maximum Simulated Likelihood
Authors: Gregory Christian A.
Published: November 2018

I present four new commands to estimate the effect of a binary endogenous treatment on an ordered outcome. Such models conventionally rely upon joint normality of the unobservables in treatment and outcome processes, as do treatoprobit and switchoprobit. In this article, I highlight the capabilities of treatoprobitsim and switchoprobitsim, which both use a latent-factor structure to model the joint distribution of the treatment and outcome and allow the researcher to relax the assumption of joint normality.
Bandwidth Selection in Kernel Distribution Function Estimation
Authors: López-de-Ullibarri Ignacio
Published: November 2018

I present a new command, kcdf, for bandwidth selection in kernel estimation of the cumulative distribution function. I briefly review plug-in and cross-validation bandwidth selectors, both of which are implemented in kcdf. I then describe the command syntax and illustrate its use with an application to artificial data.
Didq: A Command for Treatment-effect Estimation under Alternative Assumptions
Authors: Mora Ricardo , Reggio Iliana
Published: November 2018

When several pretreatment periods are available, identification of the treatment effect in a difference-in-differences framework requires an assumption relating dynamics for controls and treated in absence of treatment. Mora and Reggio (2012, Working Paper 12-33, Universidad Carlos III de Madrid) define a family of alternative identifying assumptions and propose a model that, contrary to the usual econometric specifications, allows one to identify the treatment effect for any given assumption in the family. In this article, we introduce a command, didq, that implements the model presented in Mora and Reggio, reports the estimated effect under alternative assumptions, and performs tests for the equivalence of the estimates. We also explain how to use the command to obtain the standard difference-in-differences estimator with or without polynomial trends.
Mqtime: A Stata Tool for Calculating Travel Time and Distance Using Mapquest web Services
Authors: Voorheis John
Published: November 2018

In this article, I describe mqtime, a new Stata library that provides functionality to perform a variety of mapping tasks, including calculating travel time, distance (driving, biking, or walking), and estimated fuel use. mqtime uses an overlooked free and open-source mapping service provided by MapQuest. This service has significantly more attractive terms of use than widely used alternatives (for example, Google Maps), which limit use to a few thousand queries per day. Hence, mqtime makes analysis with even very large datasets practical. I also provide a convenient function for geocoding character addresses to geographic coordinates.
Visualizing Assumptions and Results in Network Meta-analysis: The Network Graphs Package
Authors: Chaimani Anna , Salanti Georgia
Published: November 2018

Network meta-analysis has been established in recent years as a particularly useful evidence synthesis tool. However, it is still challenging to develop understandable and concise ways to present data, assumptions, and results from network meta-analysis to inform decision making and evaluate the credibility of the results. In this article, we provide a suite of commands with graphical tools to facilitate the understanding of data, the evaluation of assumptions, and the interpretation of findings from network meta-analysis.
ctreatreg: Command for Fitting Dose–response Models under Exogenous and Endogenous Treatment
Authors: Cerulli Giovanni
Published: November 2018

In this article, I present ctreatreg, a command for estimating a dose–response function when i) treatment is continuous, ii) individuals may react het-erogeneously to observable confounders, and iii) the selection into treatment may be endogenous. I implement two estimation procedures: ordinary least squares under conditional mean independence and instrumental variables under selection endogeneity. Finally, I present a Monte Carlo experiment to test the reliability of the proposed command.
Best Subsets Variable Selection in Nonnormal Regression Models
Authors: Lindsey Charles , Sheather Simon
Published: November 2018

We present a new program, gvselect, that helps users perform variable selection in regression. Best subsets variable selection is performed and provides the user with the best combinations of predictors for each level of model complexity. The leaps-and-bounds (Furnival and Wilson, 1974, Technometrics 16: 499–511) algorithm is applied using the log likelihoods of candidate models. This allows the user to perform variable selection on a wide variety of normal and non-normal regression models. Our method is described in Lawless and Singhal (1978, Biometrics 34: 318–327).
Testing for Spectral Granger Causality
Authors: Tastan Hüseyin
Published: November 2018

In this article, I introduce a command (bcgcausality) to implement Breitung and Candelon's (2006, Journal of Econometrics, 132: 363–378) Granger causality test in the frequency domain.