Home  /  Products  /  Stata 19  /  New features in Stata 19

New features in Stata 19

We introduced many highlights of the Stata 19 release here. But Stata 19 includes much more. Here we list all the new features in Stata 19, organized by topic so that you can easily find your favorites. And we will continuously add even more features. Explore features made available at the initial release of Stata 19, features added in free updates, and features introduced as part of StataNow™. You can also view all Stata features.

    • Local average treatment effects (LATE) StataNow
    • Power analysis for logistic regression StataNow
    • VCE additions for linear models StataNow
    • Do-file Editor change history ribbon StataNow
      • The Do-file Editor can now display the types of changes made to a document as colored markers in the change history ribbon, located in the margin. Two marker colors identify that the lines that have been modified and reverted to original. To specify whether you want the change history ribbon to be visible, right-click in the Do-file Editor, select Preferences ..., and check/uncheck Change history in the General or Display tab.
    • Improved variable name truncation in the Data Editor StataNow
      • In the Data Editor grid, you can now select whether variable names will be truncated at the end (the default), in the middle, or 1, 2, 3, or 4 characters before the end. You can change the truncation behavior in the Data Editor's preference dialog.
    • Faster feasible generalized least squares estimation StataNow
      • The xtgls command for fitting linear panel data models via feasible generalized least squares is now faster when fitting models with a homoskedastic or heteroskedastic error structure and no cross-sectional correlation.
    • Bayesian variable selection for linear model
    • Bayesian bootstrap and replicate weights
    • Bayesian quantile regression
    • Bayesian asymmetric Laplace model
    • New priors for Bayesian analysis
      • The bayesmh command and bayes prefix now support the half-Cauchy prior. This heavy-tailed prior is useful for modeling nonnegative parameters that tend to have large values, such as variances and standard deviations.
      • The bayesmh command and bayes prefix now support the Rayleigh prior. This prior distribution is related to \(\chi^2\) and exponential distributions and thus can be used to model nonnegative parameters with skewed distributions. It is often used in physics and engineering to model parameters—for instance, wind speed—that correspond to a norm of a bivariate standard normal random vector.
    • Gibbs sampling for normal linear models with Laplace priors
      • The bayesmh command with a univariate normal likelihood and Laplace prior for regression coefficients or with a mean parameter of a normal prior and a Laplace hyperprior now supports Gibbs sampling via the gibbs suboption of the block() option.
    • The bayesmh command with user-defined evaluators has the following new features:
      • bayesmh now provides efficient estimation of random-effects parameters in evaluators by using the reffects subpotion of the block() option.
      • In addition, the evaluator() and llevaluator() options support the reparameters() suboption, which allows the values of random-effects parameters to be passed to the evaluator as temporary variables. These temporary variables are listed as arguments to the evaluators after the names of temporary scalars and matrices for model parameters specified in the parameters() suboption.
      • bayesmh now supports predictions in evaluators. You may implement predictions in your posterior or likelihood evaluators and still be able to use the bayespredict postestimation command after bayesmh.
      • Specifically, the evaluator() and llevaluator() options support the predict suboption, which indicates that the evaluator includes code for generating random samples for the outcome.
      • Evaluators in bayesmh are now expected to compute log-likelihood values over the observation sample and return them in a vector form instead of returning the scalar overall log-likelihood value.

    Additional updates

    • The hdidregress and xthdidregress commands now allow the usercohort option for specifying a known cohort variable rather than allowing these commands to determine cohorts based on the time and group variables.
    • The new gencohort command creates a cohort variable to be used with hdidregress and xthdidregress.
    • Multiple datasets: Modify a set of frames
    • The reshape command for converting data from wide to long form and vice versa now defaults to favoring speed instead of favoring memory.
    • The list command has three new options:
      1. sepbyexp(exp) draws a separator line whenever the value of expression exp changes. exp does not necessarily have to refer to the variables in the dataset.
      2. footer displays variable names as a footer.
      3. relative displays relative observation numbers when a subset of observations is listed.

    Additional updates

    • You can now easily copy value labels across frames. With the new fromframe() and toframe() options of label copy, you can copy a value label from one frame into another frame. The new frame putlabel command allows you to copy multiple value labels from the current frame into one or more other frames.
    • The new label rename command allows you to rename value labels.

    Additional updates

    • The dtable command for creating tables of descriptive statistics now allows you to report Kendall's rank correlation test.
    • Bar graph CIs, heat maps, and more
    • Colors by variable for more graphs
      • The colorvar() option is now available with additional two-way plots: line, connected, tsline, rline, rconnected, and tsrline. This means that you can vary color lines, markers, and more in these plots based on the values of a specified variable.
    • Autocompletion, templates, and more
    • Stata in French
    • Stata now shows the name of the current (working) frame in the title bar when multiple frames are present. This allows you to easily identify the frame in which any commands issued without a frame prefix will be executed.
    • Do-file Editor change history ribbon StataNow
      • The Do-file Editor can now display the types of changes made to a document as colored markers in the change history ribbon, located in the margin. Two marker colors identify that the lines that have been modified and reverted to original. To specify whether you want the change history ribbon to be visible, right-click in the Do-file Editor, select Preferences ..., and check/uncheck Change history in the General or Display tab.
    • Improved variable name truncation in the Data Editor StataNow
      • In the Data Editor grid, you can now select whether variable names will be truncated at the end (the default), in the middle, or 1, 2, 3, or 4 characters before the end. You can change the truncation behavior in the Data Editor's preference dialog.
    • Stata for Mac on Apple silicon now uses LAPACK/OpenBLAS for numerical computations.
    • The new _invmat() function finds the inverse of a square matrix (or the pseudoinverse if the matrix is not invertible).
    • The new _solvemat() function solves AX=B, and it allows you to specify the matrix type, such as lower triangular or symmetric and positive definite, and chooses the suitable solver correspondingly.
    • The deriv() function for numerical derivatives has the following improvements:
      • You can now use the Richardson extrapolation method to compute the numerical derivatives by specifying "richardson" in the deriv_init_technique() function.
      • You can now use deriv_init_tablesize() to specify the table size for computing numerical derivatives by using the Richardson extrapolation method.
    • The new lssolve() function solves AX=B for the minimum-norm solutionX by using the least-squares method.
    • The new lsesolve() function solves AX=c with equality constraints for the minimum-norm solution X using the least-squares method.
    • The new lsglmsolve() function finds the solution of a general Gauss–Markov linear model with equality constraints.
    • The new st_datalabel() function returns the label of the dataset currently loaded in Stata.
    • The new st_datalabel(string scalar name) function sets or resets the label of the dataset currently loaded in Stata.
    • The new st_vldir() function returns a string vector of names of all value labels.
    • The pkequiv command for performing bioequivalence tests has the following improvements:
      • Log-scale analysis of bioequivalence is now performed by default, following guidance from the US FDA and the European EMA.
      • Schuirmann's two one-sided tests are now performed by default.
      • The new reps() option controls the number of bootstrap replications.
      • Additional results are now stored. These include r(limit_table), a matrix of equivalence limits, confidence intervals, and estimates.
    • PyStata enhancements
      The PyStata features for integrating Python into Stata and integrating Stata into Python have the following improvements:
      • When running Stata code within an IPython kernel-based environment, such as Jupyter Notebook and console as well as Jupyter Lab and console, and within other environments that support the IPython kernel, such as Spyder IDE and PyCharm IDE, Stata’s variable names in the current working dataset, macro names, and results r(), e(), and s() can now be autocompleted as you type by pressing the Tab key.
      • A new %help line magic is now available; it allows you to view the help information of the specified Stata command or topic in the web browser.
      • You can now control whether to echo the Stata commands along with their output when executing them in the Python environment; and you can control whether to display Stata’s output simultaneously when the execution begins or to display the output after Stata finishes execution.
      • In the sfi module, new class BreakError is available; it allows for interrupting Python execution by using the Break key in Stata.
    • The Stata-Python API specification has the following new features in the Frame class:
      • The new getCWF() function returns the name of the current working frame in Stata.
      • The new getName() function returns the name of the frame.
      • The new getFrames() function returns the names of all frames in Stata.
    • The Stata-Java API specification has the following new features in the Frame class:
      • The new getCWF() function returns the name of the current working frame in Stata.
      • The new getName() function returns the name of the frame.
      • The new getFrames() function returns the names of all frames in Stata.
    • The matrix accum and matrix vecaccum commands now support samples with one observation.

    Additional updates

    • You can now specify whether notes under a table should wrap at the tables width when exporting to SMCL and plain text by using the new collect style smcl and collect style txt commands. Specialized commands for creating tables—table, dtable, etable, and lcstats—have a new option for specifying whether notes under the table should wrap at the table width.
    • Bayesian bootstrap and replicate weights
    • You can use the new rwgen command and new options for the bootstrap prefix to implement specialized bootstrap schemes.
      • rwgen generates standard replication and Bayesian bootstrap weights. The command provides two methods: rwgen bsample generates frequency weights by resampling observations, and rwgen bayes generates Bayesian bootstrap weights using the Dirichlet distribution. These weights can be used directly with the bootstrap prefix.
      • bootstrap has new fweights() and iweights() options for performing bootstrap replications using custom weights. fweights() allows users to specify frequency weight variables for resampling, and iweights() lets users provide importance weight variables. These options extend bootstrap's flexibility by allowing user-supplied weights instead of internal resampling, making it easier to implement specialized bootstrap schemes and enhance reproducibility.
    • The spmatrix create command for creating standard-format spatial weighting matrices is now substantially faster.
    • Interval-censored multiple-event Cox model
    • Enhancements to survival graphs
      • sts graph has two new options, altrisktable and altrisktable(), that provide an alternative at-risk table beneath the plot. This table reports the number at risk, the cumulative number lost, and the cumulative number of failures for each time point on the x axis or at user-specified time points. The new table also allows customization via suboptions. Several new suboptions, including show(), row(), and grouptitle(), are available for further customization.
      • estat gofplot has new options for customizing goodness-of-fit plots. The new plot#opts() and byplot#opts() options control the rendition of plots. After stmgintcox, the new events() and sepevents options produce event-specific cumulative hazard functions; the new event#opts() option controls the rendition of event-specific plots; and the new graph#opts() and by#opts() options control the look of the #th graph.
      • stcurve has new options for customizing graphs of survivor and related functions. The new plot#opts() and atplot#opts() options control the rendition of plots. After stmgintcox, the new events() and sepevents options produce event-specific functions; the new event#opts() option controls the rendition of event-specific plots, the new graph#opts() option controls the look of the #th graph, and the new byopts() option controls how subgraphs are combined and labeled.
    • SVAR models via instrumental variables
    • Instrumental-variables local-projection IRFs
    • The var command for fitting vector autoregressive (VAR) models now allows the vce(robust) option to estimate robust standard errors.
    • Cumulative structural impulse–response functions (IRFs) are now computed by irf create after ivsvar and ivlpirf. Cumulative structural IRFs sum individual IRFs and are useful for evaluating the total effect of a shock over time. You can graph these statistics with irf graph csirf and tabulate them with irf table csirf.

Download the updates

Make sure you have access to the new features released in updates. In Stata 19, type

. update all

in the Command window. Then type

. help whatsnew

to see a list of all the new features added since Stata 19 was released.

If you have StataNow, the above steps will also give you access to all StataNow features.

Ready to get started?

Experience powerful statistical tools, reproducible workflows, and a seamless user experience—all in one trusted platform.