bluuebunny/crossref_metadata_2025 huggingface dataset:
Controlling for Time-dependent Confounding using Marginal Structural Models
Authors: Fewell Zoe , Hernán Miguel A. , Wolfe Frederick , Tilling Kate , Choi Hyon , Sterne Jonathan A. C.
Published: November 2018

Longitudinal studies in which exposures, confounders, and outcomes are measured repeatedly over time have the potential to allow causal inferences about the effects of exposure on outcome. There is particular interest in estimating the causal effects of medical treatments (or other interventions) in circumstances in which a randomized controlled trial is difficult or impossible. However, standard methods for estimating exposure effects in longitudinal studies are biased in the presence of time-dependent confounders affected by prior treatment.

This article describes the use of marginal structural models (described by Robins, Hernán, and Brumback [2000]) to estimate exposure or treatment effects in the presence of time-dependent confounders affected by prior treatment. The method is based on deriving inverse-probability-of-treatment weights, which are then used in a pooled logistic regression model to estimate the causal effect of treatment on outcome. We demonstrate the use of marginal structural models to estimate the effect of methotrexate on mortality in persons suffering from rheumatoid arthritis.
Speaking Stata: Graphing Model Diagnostics
Authors: Cox Nicholas J.
Published: November 2018

Plotting diagnostic information calculated from residuals and fitted values is a long-standard method for assessing models and seeking ways of improving them. This column focuses on the statistical mainstream defined by regression models for continuous responses, treated in a broad sense to include (for example) generalized linear models. After some comments on the history of such ideas (and even their anthropology and psychology), the commands available in official Stata are reviewed, and a modeldiag package is introduced. A detailed example on fuelwood yield from fallow areas in Nigeria illustrates a variety of general points and specific tips.
A Conversation with William Gould
Authors: Newton H. Joseph
Published: November 2018

William Gould is President of StataCorp. He was born in Burbank, California, on January 21, 1952. He received a B.A. in economics from UCLA in 1974 and a C. Phil. in economics from UCLA in 1977, after initially majoring in physics and then engineering. He studied economics in the Ph.D. program at UCLA and was simultaneously a Research Fellow at The Rand Corporation. He did not turn in his dissertation in labor economics before becoming a Senior Research Associate at the National Bureau of Economic Research in Stanford, California, in 1977. In 1979, he become a Senior Economist at Unicon Research Corporation in Los Angeles, a company that he helped to found. He cofounded and served as Vice-President of Computing Resource Center in 1982, the company that went on to develop Stata. Bill became President of CRC in 1990 and, in 1993, CRC was renamed StataCorp.
Tabulation of Multiple Responses
Authors: Jann Ben
Published: November 2018

Although multiple-response questions are quite common in survey research, Stata's official release does not provide much capability for an effective analysis of multiple-response variables. For example, in a study on drug addiction an interview question might be, “Which substances did you consume during the last four weeks?” The respondents just list all the drugs they took, if any; e.g., an answer could be “cannabis, cocaine, heroin” or “ecstasy, cannabis” or “none”, etc. Usually, the responses to such questions are stored as a set of variables and, therefore, cannot be easily tabulated. I will address this issue here and present a new module to compute one- and two-way tables of multiple responses. The module supports several types of data structure, provides significance tests, and offers various options to control the computation and display of the results. In addition, tools to create graphs of multiple-response distributions are presented.
Value Label Utilities: Labeldup and Labelrename
Authors: Weesie Jeroen
Published: November 2018

I describe two utilities dealing with value labels. labeldup reports and optionally removes duplicate value labels. labelrename renames a value label. Both utilities, of course, preserve the links between variables and value labels and support multilingual datasets.
Stata in Space: Econometric Analysis of Spatially Explicit Raster Data
Authors: Müller Daniel
Published: November 2018

Realizing the importance of location, economists are increasingly adopting spatial analytical and spatial econometric perspectives to study questions such as the geographical targeting of policy interventions, regional agglomeration effects, the diffusion of technologies across space, or causes and consequences of land-cover change. Explicitly accounting for location in econometric estimations can be of great benefit for researchers working at the interface of economics or environmental sciences and geography.

The objective of this article is to demonstrate how spatially explicit raster data derived from standard geographical information system (GIS) software can be used within Stata. Three programs implemented as ado-files are presented. These import geographic raster data into Stata (ras2dta), draw systematic spatial samples within Stata (spatsam), and export data and estimation results in a form usable by standard GIS software (dta2ras). A numerical example is presented to estimate the determinants of forest cover with a spatially explicit logit model, calculate predicted probabilities, and map the predictions with GIS software.
Teaching Statistics to Physicians using Stata
Authors: Hailpern Susan M.
Published: November 2018

The Clinical Research Training Program (CRTP) at the Albert Einstein College of Medicine at Yeshiva University is a two-year program for physicians leading to a Master of Science degree in Clinical Research Methods. Beginning in July 2004, the program began teaching data analysis using Stata 8 in order to better meet the advanced statistical needs of the students. This paper details the structure and content of the course, how Stata was introduced, and the problems we encountered. Student comments and suggestions on future enhancements to Stata are included. Although challenging, our first semester teaching Stata was a success: the students all learned Stata and, more importantly, continued to use it for the analysis of their own research data after the course was complete.
Making Regression Tables from Stored Estimates
Authors: Jann Ben
Published: November 2018

Organizing and archiving statistical results and processing a subset of those results for publication are important and often underestimated issues in conducting statistical analyses. Because automation of these tasks is often poor, processing results produced by statistical packages is quite laborious and vulnerable to error. I will therefore present a new package called estout that facilitates and automates some of these tasks. This new command can be used to produce regression tables for use with spreadsheets, LATEX, HTML, or word processors. For example, the results for multiple models can be organized in spreadsheets and can thus be archived in an orderly manner. Alternatively, the results can be directly saved as a publication-ready table for inclusion in, for example, a LATEX document. estout is implemented as a wrapper for estimates table but has many additional features, such as support for mfx. However, despite its flexibility, estout is-I believe-still very straightforward and easy to use. Furthermore, estout can be customized via so-called defaults files. A tool to make available supplementary statistics called estadd is also provided.
A Simple Approach to Fit the Beta-binomial Model
Authors: Guimarães Paulo
Published: November 2018

In this paper, I show how to estimate the parameters of the beta-binomial distribution and its multivariate generalization, the Dirichlet-multinomial distribution. This approach involves no additional programming, as it relies on an existing Stata command used for overdispersed count panel data. Including covariates to allow for regression models based in these distributions is straightforward.
A Multivariable Scatterplot Smoother
Authors: Royston Patrick , Cox Nicholas J.
Published: November 2018

We present an extension of Sasieni, Royston, and Cox's bivariate smoother running to the multivariable context. The software aims to provide a picture of the relation between a response variable and each of several continuous predictors simultaneously. This may be a valuable tool in exploratory data analysis, before constructing a more formal multiple regression model.
Speaking Stata: The Protean Quantile Plot
Authors: Cox Nicholas J.
Published: November 2018

Quantile plots showing by default ordered values versus cumulative probabilities are both well known and also often neglected, considering their major advantages. Their flexibility and power is emphasized by using the qplot program to show several variants on the standard form, making full use of options for reverse, ranked, and transformed scales and for superimposing and juxtaposing quantile traces. Examples are drawn from the analysis of species abundance data in ecology. A revised version of qplot is formally released with this column. Distribution plots in which the axes are interchanged are also discussed briefly, in conjunction with a revised version of distplot, also released now.
Estimation and Inference in Dynamic Unbalanced Panel-data Models with a Small Number of Individuals
Authors: Bruno Giovanni S. F.
Published: November 2018

This article describes a new Stata routine, xtlsdvc, that computes bias-corrected least-squares dummy variable (LSDV) estimators and their bootstrap variance–covariance matrix for dynamic (possibly) unbalanced panel-data models with strictly exogenous regressors. A Monte Carlo analysis is carried out to evaluate the finite-sample performance of the bias-corrected LSDV estimators in comparison to the original LSDV estimator and three popular N-consistent estimators: Arellano–Bond, Anderson–Hsiao and Blundell–Bond. Results strongly support the bias-corrected LSDV estimators according to bias and root mean squared error criteria when the number of individuals is small.
Buckley–James Method for Analyzing Censored Data, with an Application to a Cardiovascular Disease and an HIV/AIDS Study
Authors: Cui James
Published: November 2018

The Buckley–James method and the Cox proportional hazards model were proposed in the 1970s. Both methods can be used to analyze survival-type data, although the former focuses on calculation of the expected value of the survival time and the latter on the relative risk of explanatory variables on the failure event. In cardiovascular disease epidemiological studies, it is essential to correct the effect of taking antihypertensive medicine, which means we need to calculate the expected blood pressure for people who take the medicine. I developed a Stata program to calculate the Buckley–James estimate. I will describe how to use this program to calculate the expected value of a censored outcome and illustrate the method through an example from a cardiovascular disease and an HIV/AIDS study.
Suggestions on Stata Programming Style
Authors: Cox Nicholas J.
Published: November 2018

Various suggestions are made on Stata programming style, under the headings of presentation, helpful Stata features, respect for datasets, speed and efficiency, reminders, and style in the large.
Mata Matters: Using Views onto the Data
Authors: Gould William
Published: November 2018

Mata is Stata's matrix language. In the Mata Matters column, we show how Mata can be used interactively to solve problems and as a programming language to add new features to Stata. In this issue's column, we explore view matrices, matrices that are views of the underlying Stata dataset rather than copies of it.
Automatic Generation of Documents
Authors: Gini Rosa , Pasquini Jacopo
Published: November 2018

This paper describes a natural interaction between Stata and markup languages. Stata's programming and analysis features, together with the flexibility in output formatting of the markup languages, allow generation and/or update of whole documents (e.g., reports, presentations on screen or web). We give examples for both LATEX and HTML.
Explained Variation for Survival Models
Authors: Royston Patrick
Published: November 2018

This article introduces a new measure of explained variation for use with censored survival data. It is a modified version of a measure previously described by John O'Quigley and colleagues, itself a modification of Nagelkerke's earlier proposal for a general index of determination. I describe Stata programs str2ph, which implements the new measure, and str2d, which implements a measure proposed in 2004 by Royston and Sauerbrei. I provide examples with real data.
Speaking Stata: Time of Day
Authors: Cox Nicholas J.
Published: November 2018

Many problems in statistical analysis include time-of-day variables, but Stata offers limited support for time-of-day calculations. Support is needed for dates with times, times alone, and durations or timings. This article presents two new programs as general utilities to convert back and forth between string and numeric representations.
A Mata Geweke–Hajivassiliou–Keane Multivariate Normal Simulator
Authors: Gates Richard
Published: November 2018

An accurate and efficient numerical approximation of the multivariate normal (MVN) distribution function is necessary for obtaining maximum likelihood estimates for models involving the MVN distribution. Numerical integration through simulation (Monte Carlo) or number-theoretic (quasi-Monte Carlo) techniques is one way to accomplish this task. One popular simulation technique is the Geweke–Hajivassiliou–Keane MVN simulator. This paper reviews this technique and introduces a Mata function that implements it. It also computes analytical first-order derivatives of the simulated probability with respect to the variables and the variance–covariance parameters.
Maximum Simulated Likelihood Estimation of a Negative Binomial Regression Model with Multinomial Endogenous Treatment
Authors: Deb Partha , Trivedi Pravin K.
Published: November 2018

We describe specification and estimation of a multinomial treatment effects negative binomial regression model. A latent factor structure is used to accommodate selection into treatment, and a simulated likelihood method is used for estimation. We describe its implementation via the mtreatnb command.
Maximum Simulated Likelihood Estimation of Random-Effects Dynamic Probit Models with Autocorrelated Errors
Authors: Stewart Mark
Published: November 2018

This paper investigates using maximum simulated likelihood (MSL) estimation for random-effects dynamic probit models with autocorrelated errors. It presents and illustrates a new Stata command, redpace, for this estimator. The paper also compares using pseudorandom numbers and Halton sequences of quasirandom numbers for MSL estimation of these models.
Confidence Intervals for Rank Statistics: Somers’ D and Extensions
Authors: Newson Roger
Published: November 2018

Somers’ D is an asymmetric measure of association between two variables, which plays a central role as a parameter behind rank or nonparametric statistical methods. Given predictor variable X and outcome variable Y, we may estimate D YX as a measure of the effect of X on Y, or we may estimate DXY as a performance indicator of X as a predictor of Y. The somersd package allows the estimation of Somers’ D and Kendall's τ A with confidence limits as well as p-values. The Stata 9 version of somersd can estimate extended versions of Somers’ D not previously available, including the Gini index, the parameter tested by the sign test, and extensions to left- or right-censored data. It can also estimate stratified versions of Somers’ D, restricted to pairs in the same stratum. Therefore, it is possible to define strata by grouping values of a confounder, or of a propensity score based on multiple confounders, and to estimate versions of Somers’ D that measure the association between the outcome and the predictor, adjusted for the confounders. The Stata 9 version of somersd uses the Mata language for improved computational efficiency with large datasets.
Confidence Intervals for Rank Statistics: Percentile Slopes, Differences, and Ratios
Authors: Newson Roger
Published: November 2018

I present a program, censlope, for calculating confidence intervals for generalized Theil–Sen median (and other percentile) slopes (and per-unit ratios) of Y with respect to X. The confidence intervals are robust to the possibility that the conditional population distributions of Y, given different values of X, differ in ways other than location, such as having unequal variances. censlope uses the program somersd and is part of the somersd package. censlope can therefore estimate confounder-adjusted percentile slopes, limited to comparisons within strata defined by values of confounders, or by values of a propensity score representing multiple confounders. Iterative numerical methods have been implemented in the Mata language, enabling efficient calculation of percentile slopes and their confidence limits in large samples. I give example analyses from the auto dataset and from the Avon Longitudinal Study of Pregnancy and Childhood (ALSPAC).
Calculating Murphy–Topel Variance Estimates in Stata: A Simplified Procedure
Authors: Hole Arne Risa
Published: November 2018

Building on the work by Hardin ( Stata Journal 2: 253–266), this note shows how the calculation of the Murphy–Topel variance estimator for two-step models can be simplified in Stata by using the scores option of predict.
Mata Matters: Precision
Authors: Gould William
Published: November 2018

Mata is Stata's matrix language. The Mata Matters column shows how Mata can be used interactively to solve problems and as a programming language to add new features to Stata. In this quarter's column, we look at the programming implications of the floating-point, base-2 encoding that modern computers use.
A Survey on Survey Statistics: What is Done and Can be Done in Stata
Authors: Kreuter Frauke , Valliant Richard
Published: November 2018

This article will survey issues in analyzing complex survey data and describe some of the capabilities of Stata for such analyses. We will briefly review key elements of survey design and explain the effects of different design features on bias and variance. We compare different methods of variance estimation for stratified and clustered samples and discuss the handling of survey weights. We will also give examples for the practical importance of Stata's survey capabilities.
Review of An Introduction to Modern Econometrics Using Stata by Baum
Authors: Nichols Austin
Published: November 2018

This article reviews An Introduction to Modern Econometrics Using Stata by Christopher F. Baum.
Estimation of Nonstationary Heterogeneous Panels
Authors: Blackburne Edward F. , Frank Mark W.
Published: November 2018

We introduce a new Stata command, xtpmg, for estimating nonstationary heterogeneous panels in which the number of groups and number of time-series observations are both large. Based on recent advances in the nonstationary panel literature, xtpmg provides three alternative estimators: a traditional fixed-effects estimator, the mean-group estimator of Pesaran and Smith (Estimating long-run relationships from dynamic heterogeneous panels, Journal of Econometrics 68: 79–113), and the pooled mean-group estimator of Pesaran, Shin, and Smith (Estimating long-run relationships in dynamic heterogeneous panels, DAE Working Papers Amalgamated Series 9721; Pooled mean group estimation of dynamic heterogeneous panels, Journal of the American Statistical Association 94: 621–634).
Predict and Adjust with Logistic Regression
Authors: Buis Maarten L.
Published: November 2018

Within Stata there are two ways of getting average predicted values for different groups after an estimation command: adjust and predict. After OLS regression (regress), these two ways give the same answer. However, after logistic regression, the average predicted probabilities differ. This article discusses where that difference comes from and the consequent subtle difference in interpretation.
A Tool for Deterministic and Probabilistic Sensitivity Analysis of Epidemiologic Studies
Authors: Orsini Nicola , Bellocco Rino , Bottai Matteo , Wolk Alicja , Greenland Sander
Published: November 2018

Classification errors, selection bias, and uncontrolled confounders are likely to be present in most epidemiologic studies, but the uncertainty introduced by these types of biases is seldom quantified. The authors present a simple yet easy-to-use Stata command to adjust the relative risk for exposure misclassification, selection bias, and an unmeasured confounder. This command implements both deterministic and probabilistic sensitivity analysis. It allows the user to specify a variety of probability distributions for the bias parameters, which are used to simulate distributions for the bias-adjusted exposure–disease relative risk. We illustrate the command by applying it to a case–control study of occupational resin exposure and lung-cancer deaths. By using plausible probability distributions for the bias parameters, investigators can report results that incorporate their uncertainties regarding systematic errors and thus avoid overstating their certainty about the effect under study. These results can supplement conventional results and can help pinpoint major sources of conflict in study interpretations.
A New Framework for Managing and Analyzing Multiply Imputed Data in Stata
Authors: Carlin John B. , Galati John C. , Royston Patrick
Published: November 2018

A new set of tools is described for performing analyses of an ensemble of datasets that includes multiple copies of the original data with imputations of missing values, as required for the method of multiple imputation. The tools replace those originally developed by the authors. They are based on a simple data management paradigm in which the imputed datasets are all stored along with the original data in a single dataset with a vertically stacked format, as proposed by Royston in his ice and micombine commands. Stacking into a single dataset simplifies the management of the imputed datasets compared with storing them individually. Analysis and manipulation of the stacked datasets is performed with a new prefix command, mim, which can accommodate data imputed by any method as long as a few simple rules are followed in creating the imputed data. mim can validly fit most of the regression models available in Stata to multiply imputed datasets, giving parameter estimates and confidence intervals computed according to Rubin's results for multiple imputation inference. Particular attention is paid to limiting the available postestimation commands to those that are known to be valid within the multiple imputation context. However, the user has flexibility to override these defaults. Features of these new tools are illustrated using two previously published examples.
Tests for Unbalanced Error-Components Models under Local Misspecification
Authors: Sosa-Escudero Walter , Bera Anil K.
Published: November 2018

This paper derives unbalanced versions of the test statistics for first-order serial correlation and random individual effects summarized in Sosa-Escudero and Bera (2001, Stata Technical Bulletin Reprints, vol. 10, pp. 307–311), and updates their xttest1 routine. The derived test statistics should be useful for applied researchers faced with the increasing availability of panel information where not every individual or country is observed for the full time span. The test statistics proposed here are based on ordinary least-squares residuals and hence are computationally very simple.
Fuzzy: A Program for Performing Qualitative Comparative Analyses (QCA) in Stata
Authors: Longest Kyle C. , Vaisey Stephen
Published: November 2018

Qualitative comparative analysis (QCA) is an increasingly popular analytic strategy, with applications to numerous empirical fields. This article briefly discusses the substantive motivation and technical details of qca, as well as fuzzy-set qca, followed by an in-depth discussion of how the new program fuzzy performs these techniques in Stata. An empirical example is presented that demonstrates the full suite of tools contained within fuzzy, including creating configurations, performing a series of statistical tests of the configurations, and reducing the identified configurations.
Speaking Stata: Spineplots and their Kin
Authors: Cox Nicholas J.
Published: November 2018

The term spineplot has been applied over the last decade or so to a type of bar chart used particularly for showing frequencies, proportions, or percentages of two cross-classified categorical variables. The principle is that the areas of rectangular tiles are proportional to the frequencies in the cells of a contingency table. Often both coarse and fine structure are easy to see, including departures from independence. The main idea has, in fact, been rediscovered repeatedly over at least the last 130 years. In its most general form, it has been widely publicized under the name mosaic plots. This column introduces, discusses, and exemplifies a Stata implementation of spineplots. It is noted that a restriction to two variables is more apparent than real, as either axis of a spineplot can show a composite variable defined by cross combinations of two or more variables.
Review of Applied Health Economics by Jones, Rice, Bago d'Uva, and Balia
Authors: Jenkins Stephen P.
Published: November 2018

This article reviews Applied Health Economics by Jones, Rice, Bago d'Uva, and Balia.
Review of Event History Analysis with Stata by Blossfeld, Golsch, and Rohwer
Authors: Kalter Frank
Published: November 2018

This article reviews Event History Analysis with Stata by Blossfeld, Golsch, and Rohwer.
Multinomial Goodness-of-Fit: Large-Sample Tests with Survey Design Correction and Exact Tests for Small Samples
Authors: Jann Ben
Published: November 2018

I introduce the new mgof command to compute distributional tests for discrete (categorical, multinomial) variables. The command supports large-sample tests for complex survey designs and exact tests for small samples as well as classic large-sample X2-approximation tests based on Pearson's X2, the likelihood ratio, or any other statistic from the power-divergence family (Cressie and Read, 1984, Journal of the Royal Statistical Society, Series B (Methodological) 46: 440–464). The complex survey correction is based on the approach by Rao and Scott (1981, Journal of the American Statistical Association 76: 221–230) and parallels the survey design correction used for independence tests in svy: tabulate. mgof computes the exact tests by using Monte Carlo methods or exhaustive enumeration. mgof also provides an exact one-sample Kolmogorov–Smirnov test for discrete data.
The Stata Command Felsdvreg to Fit a Linear Model with Two High-Dimensional Fixed Effects
Authors: Cornelissen Thomas
Published: November 2018

This article proposes a memory-saving decomposition of the design matrix to facilitate the estimation of a linear model with two high-dimensional fixed effects. A common way to fit such a model is to take into account one of the effects by including dummy variables and to sweep out the other effect by the within transformation (fixed-effects transformation). If the number of panel units is high, creating and storing the dummy variables can involve prohibitively large computer-memory requirements. The memory-saving procedure to set up the moment matrices for estimation presented in this article can reduce the memory requirements considerably. The companion Stata ado-file felsdvreg implements the estimation method, takes care of identification issues, and provides useful summary statistics.
Speaking Stata: Between Tables and Graphs
Authors: Cox Nicholas J.
Published: November 2018

Table-like graphs can be interesting, useful, and even mildly innovative. This column outlines some Stata techniques for producing such graphs. graph dot is likely to be the most under-appreciated command among all existing commands. Using by() with various choices is a good way to mimic a categorical axis in many graph commands. When graph bar or graph dot is not flexible enough to do what you want, moving to the more flexible twoway is usually advisable. labmask and seqvar are introduced as new commands useful for preparing axis labels and axis positions for categorical variables. Applications of these ideas to, e.g., confidence interval plots lies ahead.
A Stata Package for the Estimation of the Dose-response Function through Adjustment for the Generalized Propensity Score
Authors: Bia Michela , Mattei Alessandra
Published: November 2018

In this article, we briefly review the role of the propensity score in estimating dose–response functions as described in Hirano and Imbens (2004, Applied Bayesian Modeling and Causal Inference from Incomplete-Data Perspectives, 73–84). Then we present a set of Stata programs that estimate the propensity score in a setting with a continuous treatment, test the balancing property of the generalized propensity score, and estimate the dose–response function. We illustrate these programs by using a dataset collected by Imbens, Rubin, and Sacerdote.
Mata Matters: Macros
Authors: Gould William
Published: November 2018

Mata is Stata's matrix language. In the Mata Matters column, we show how Mata can be used interactively to solve problems and as a programming language to add new features to Stata. Macros are the subject of this column.
Meta-Regression in Stata
Authors: Harbord Roger M. , Higgins Julian P. T.
Published: November 2018

We present a revised version of the metareg command, which performs meta-analysis regression (meta-regression) on study-level summary data. The major revisions involve improvements to the estimation methods and the addition of an option to use a permutation test to estimate p-values, including an adjustment for multiple testing. We have also made additions to the output, added an option to produce a graph, and included support for the predict command. Stata 8.0 or above is required.
Review of Multilevel and Longitudinal Modeling Using Stata, Second Edition, by Sophia Rabe-Hesketh and Anders Skrondal
Authors: Horton Nicholas J.
Published: November 2018

This article reviews Multilevel and Longitudinal Modeling Using Stata, Second Edition, by Sophia Rabe-Hesketh and Anders Skrondal.
Estimation and Comparison of Receiver Operating Characteristic Curves
Authors: Pepe Margaret S. , Longton Gary , Janes Holly
Published: November 2018

The receiver operating characteristic (ROC) curve displays the capacity of a marker or diagnostic test to discriminate between two groups of subjects, cases versus controls. We present a comprehensive suite of Stata commands for performing ROC analysis. Nonparametric, semiparametric, and parametric estimators are calculated. Comparisons between curves are based on the area or partial area under the ROC curve. Alternatively, pointwise comparisons between ROC curves or inverse ROC curves can be made. We describe options to adjust these analyses for covariates and to perform ROC regression in a companion article. We use a unified framework by representing the ROC curve as the distribution of the marker in cases where we have standardized it to the control reference distribution.
Multivariate Random-effects Meta-analysis
Authors: White Ian R.
Published: November 2018

Multivariate meta-analysis combines estimates of several related parameters over several studies. These parameters can, for example, refer to multiple outcomes or comparisons between more than two groups. A new Stata command, mvmeta, performs maximum likelihood, restricted maximum likelihood, or method-of-moments estimation of random-effects multivariate meta-analysis models. A utility command, mvmeta_make, facilitates the preparation of summary datasets from more detailed data. The commands are illustrated with data from the Fibrinogen Studies Collaboration, a meta-analysis of observational studies; I estimate the shape of the association between a quantitative exposure and disease events by grouping the quantitative exposure into several categories.
Meta-analysis with Missing Data
Authors: White Ian R. , Higgins Julian P. T.
Published: November 2018

A new command, metamiss, performs meta-analysis with binary outcomes when some or all studies have missing data. Missing values can be imputed as successes, as failures, according to observed event rates, or by a combination of these according to reported reasons for the data being missing. Alternatively, the user can specify the value of, or a prior distribution for, the informative missingness odds ratio.
Review of the Workflow of Data Analysis Using Stata, by J. Scott Long
Authors: Acock Alan C.
Published: November 2018

This article reviews The Workflow of Data Analysis Using Stata, by J. Scott Long.
Two Techniques for Investigating Interactions between Treatment and Continuous Covariates in Clinical Trials
Authors: Royston Patrick , Sauerbrei Willi
Published: November 2018

There is increasing interest in the medical world in the possibility of tailoring treatment to the individual patient. Statistically, the relevant task is to identify interactions between covariates and treatments, such that the patient's value of a given covariate influences how strongly (or even whether) they are likely to respond to a treatment. The most valuable data are obtained in randomized controlled clinical trials of novel treatments in comparison with a control treatment. We describe two techniques to detect and model such interactions. The first technique, multivariable fractional polynomials interaction, is based on fractional polynomials methodology, and provides a method of testing for continuous-by-binary interactions and by modeling the treatment effect as a function of a continuous covariate. The second technique, subpopulation treatment-effect pattern plot, aims to do something similar but is focused on producing a nonparametric estimate of the treatment effect, expressed graphically. Stata programs for both of these techniques are described. Real data for brain and breast cancer are used as examples.
Multiple Imputation of Missing Values: New Features for Mim
Authors: Royston Patrick , Carlin John B. , White Ian R.
Published: November 2018

We present an update of mim, a program for managing multiply imputed datasets and performing inference (estimating parameters) using Rubin's rules for combining estimates from imputed datasets. The new features of particular importance are an option for estimating the Monte Carlo error (due to the sampling variability of the imputation process) in parameter estimates and in related quantities, and a general routine for combining any scalar estimate across imputations.
Implementing Horn's Parallel Analysis for Principal Component Analysis and Factor Analysis
Authors: Dinno Alexis
Published: November 2018

I present paran, an implementation of Horn's parallel analysis criteria for factor or component retention in common factor analysis or principal component analysis in Stata. The command permits classical parallel analysis and more recent extensions to it for the pca and factor commands. paran provides a needed extension to Stata's built-in factor- and component-retention criteria.
The Skillings–Mack Test (Friedman Test when There are Missing Data)
Authors: Chatfield Mark , Mander Adrian
Published: November 2018

The Skillings-Mack statistic (Skillings and Mack, 1981, Technometrics 23: 171–177) is a general Friedman-type statistic that can be used in almost any block design with an arbitrary missing-data structure. The missing data can be either missing by design, for example, an incomplete block design, or missing completely at random. The Skillings–Mack test is equivalent to the Friedman test when there are no missing data in a balanced complete block design, and the Skillings–Mack test is equivalent to the test suggested in Durbin (1951, British Journal of Psychology, Statistical Section 4: 85–90) for a balanced incomplete block design. The Friedman test was implemented in Stata by Goldstein (1991, Stata Technical Bulletin 3: 26–27) and further developed in Goldstein (2005, Stata Journal 5: 285). This article introduces the skilmack command, which performs the Skillings–Mack test.

The skilmack command is also useful when there are many ties or equal ranks (N.B. the Friedman statistic compared with the x2 distribution will give a conservative result), as well as for small samples; appropriate results can be obtained by simulating the distribution of the test statistic under the null hypothesis.
Implementing Weak-Instrument Robust Tests for a General Class of Instrumental-Variables Models
Authors: Finlay Keith , Magnusson Leandro M.
Published: November 2018

We present a minimum distance approach for conducting hypothesis testing in the presence of potentially weak instruments. Under this approach, we propose size-correct tests for limited dependent variable models with endogenous explanatory variables such as endogenous tobit and probit models. Additionally, we extend weak-instrument tests for the linear instrumental-variables model by allowing for variance–covariance estimation that is robust to arbitrary heteroskedasticity or intracluster dependence. We invert these tests to construct confidence intervals on the coefficient of the endogenous variable. We also provide a postestimation command for Stata, called rivtest, for computing the tests and estimating confidence intervals.
Implementation of a New Solution to the Multivariate Behrens-Fisher Problem
Authors: Žežula Ivan
Published: November 2018

Krishnamoorthy and Yu (2004, Statistics and Probability Letters 66: 161–169) published a new approximate solution to the multivariate Behrens–Fisher problem. It is a modification of Nel and Van der Merwe's (1986, Communications in Statistics, Theory and Methods 15: 3719–3735) test. The test is invariant and identical to Welch's test for one-dimensional data. In this article, I describe an implementation of the test in Stata. The hotelmnm command allows you to perform the test easily and returns computed values for possible further computations.
Mata Matters: File Processing
Authors: Gould William
Published: November 2018

Mata is Stata's matrix language. In the Mata Matters column, we show how Mata can be used interactively to solve problems and as a programming language to add new features to Stata. The subject of this column is using Mata to read into Stata datasets that are formatted difficultly, which involves Mata's file processing and string processing capabilities.
Using the World Development Indicators Database for Statistical Analysis in Stata
Authors: Jeanty P. Wilner
Published: November 2018

The World Bank's world development indicators (WDI) compilation is a rich and widely used database about the development of most economies in the world. However, after insheeting a WDI dataset, some data management is required prior to performing statistical analysis. In this article, I propose a new Stata command, wdireshape, for automating this data management. While reshaping a WDI dataset into structures amenable to panel data, seeming unrelated regression, or cross-sectional modeling, wdireshape renames the series and places the series descriptors into variable labels.
Tabulating SPost Results Using Estout and Esttab
Authors: Jann Ben , Long J. Scott
Published: November 2018

The SPost user package (Long and Freese, 2006, Regression Models for Categorical Dependent Variables Using Stata [Stata Press]) is a suite of postestimation commands to compute additional tests and effects representations for a variety of regression models. To facilitate and automate the task of tabulating results from SPost commands for inclusion in reports, publications, and presentations, we introduce tools to integrate SPost with the estout user package (Jann, 2005, Stata Journal 5: 288–308; 2007, Stata Journal 7: 227–244). The estadd command can retrieve results computed by the SPost commands brant, fitstat, listcoef, mlogtest, prchange, prvalue, and asprvalue. These results can then be tabulated by esttab or estout.
Resampling Variance Estimation for Complex Survey Data
Authors: Kolenikov Stanislav
Published: November 2018

In this article, I discuss the main approaches to resampling variance estimation in complex survey data: balanced repeated replication, the jackknife, and the bootstrap. Balanced repeated replication and the jackknife are implemented in the Stata svy suite. The bootstrap for complex survey data is implemented by the bsweights command. I describe this command and provide working examples.
Optimal Power Transformation via Inverse Response Plots
Authors: Lindsey Charles , Sheather Simon
Published: November 2018

We present a new Stata command, irp, that generates the inverse response plot (Cook and Weisberg, 1994, Biometrika 81: 731–737) of a response on its predictors. Using the inverse response plot, an appropriate scaled power transformation for the positive response variable can be found so that the transformed response mean is linear in the predictors. The optimal transformation is displayed in the plot, as are user-specified guesses. By using the graphical display, the user may determine whether an appropriate transformation exists as well as determine its value. We demonstrate the irp command using both a generated and a real example.
Using Stata with PHASE and Haploview: Commands for Importing and Exporting Data
Authors: Huber J. Charles
Published: November 2018

Modern genetics studies require the use of many specialty software programs for various aspects of the statistical analysis. PHASE is a program often used to reconstruct haplotypes from genotype data, and Haploview is a program often used to visualize and analyze single nucleotide polymorphism data. Three new commands are described for performing these three steps: 1) exporting genotype data stored in Stata to PHASE, 2) importing the resulting inferred haplotypes back into Stata, and 3) exporting the haplotype/single nucleotide polymorphism data from Stata to Haploview.
Projection of Power and Events in Clinical Trials with a Time-to-event Outcome
Authors: Royston Patrick , Barthel Friederike M.-S.
Published: November 2018

In 2005, Barthel, Royston, and Babiker presented a menu-driven Stata program under the generic name of ART (assessment of resources for trials) to calculate sample size and power for complex clinical trial designs with a time-to-event or binary outcome. In this article, we describe a Stata tool called ARTPEP, which is intended to project the power and events of a trial with a time-to-event outcome into the future given patient accrual figures so far and assumptions about event rates and other defining parameters. ARTPEP has been designed to work closely with the ART program and has an associated dialog box. We illustrate the use of ARTPEP with data from a phase III trial in esophageal cancer.
Estimation of Quantile Treatment Effects with Stata
Authors: Fröolich Markus , Melly Blaise
Published: November 2018

In this article, we discuss the implementation of various estimators proposed to estimate quantile treatment effects. We distinguish four cases involving conditional and unconditional quantile treatment effects with either exogenous or endogenous treatment variables. The introduced ivqte command covers four different estimators: the classical quantile regression estimator of Koenker and Bassett (1978, Econometrica 46: 33–50) extended to heteroskedasticity consistent standard errors; the instrumental-variable quantile regression estimator of Abadie, Angrist, and Imbens (2002, Econometrica 70: 91–117); the estimator for unconditional quantile treatment effects proposed by Firpo (2007, Econometrica 75: 259–276); and the instrumental-variable estimator for unconditional quantile treatment effects proposed by Frölich and Melly (2008, IZA discussion paper 3288). The implemented instrumental-variable procedures estimate the causal effects for the subpopulation of compliers and are only well suited for binary instruments. ivqte also provides analytical standard errors and various options for nonparametric estimation. As a by-product, the locreg command implements local linear and local logit estimators for mixed data (continuous, ordered discrete, unordered discrete, and binary regressors).
Speaking Stata: The Limits of Sample Skewness and Kurtosis
Authors: Cox Nicholas J.
Published: November 2018

Sample skewness and kurtosis are limited by functions of sample size. The limits, or approximations to them, have repeatedly been rediscovered over the last several decades, but nevertheless seem to remain only poorly known. The limits impart bias to estimation and, in extreme cases, imply that no sample could bear exact witness to its parent distribution. The main results are explained in a tutorial review, and it is shown how Stata and Mata may be used to confirm and explore their consequences.
Nonparametric Item Response Theory Using Stata
Authors: Hardouin Jean-Benoit , Bonnaud-Antignac Angélique , Sébille Véronique
Published: November 2018

Item response theory is a set of models and methods allowing for the analysis of binary or ordinal variables (items) that are influenced by a latent variable or latent trait—that is, a variable that cannot be measured directly. The theory was originally developed in educational assessment but has many other applications in clinical research, ecology, psychiatry, and economics.

The Mokken scales have been described by Mokken (1971, A Theory and Procedure of Scale Analysis [De Gruyter]). They are composed of items that satisfy the three fundamental assumptions of item response theory: unidimensionality, monotonicity, and local independence. They can be considered nonparametric models in item response theory. Traces of the items and Loevinger's H coefficients are particularly useful indexes for checking whether a set of items constitutes a Mokken scale.

However, these indexes are not available in general statistical packages. We introduce Stata commands to compute them. We also describe the options available and provide examples of output.
Estimating Adjusted Risk Ratios for Matched and Unmatched Data: An Update
Authors: Cummings Peter
Published: November 2018

The Stata 11 margins command makes it easier to estimate adjusted risk ratios, and the new robust variance option for xtpoisson, fe provides correct confidence intervals for adjusted risk ratios from matched-cohort data.
Generating Random Samples from User-defined Distributions
Authors: Lukacsy Katarina
Published: November 2018

Generating random samples in Stata is very straightforward if the distribution drawn from is uniform or normal. With any other distribution, an inverse method can be used; but even in this case, the user is limited to the built-in functions. For any other distribution functions, their inverse must be derived analytically or numerical methods must be used if analytical derivation of the inverse function is tedious or impossible. In this article, I introduce a command that generates a random sample from any user-specified distribution function using numeric methods that make this command very generic.
Logistic Quantile Regression in Stata
Authors: Orsini Nicola , Bottai Matteo
Published: November 2018

We present a set of Stata commands for the estimation, prediction, and graphical representation of logistic quantile regression described by Bottai, Cai, and McKeown (2010, Statistics in Medicine 29: 309–317). Logistic quantile regression models the quantiles of outcome variables that take on values within a bounded, known interval, such as proportions (or percentages) within 0 and 1, school grades between 0 and 100 points, and visual analog scales between 0 and 10 cm. We describe the syntax of the new commands and illustrate their use with data from a large cohort of Swedish men on lower urinary tract symptoms measured on the international prostate symptom score, a widely accepted score bounded between 0 and 35.