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.
StataNow updates forthcoming. In the meantime, enjoy all the new features
of Stata 19 listed below.
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.
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.
The teffects aipw command for estimating treatment effects via augmented inverse-probability weighting can now provide estimates of the ATETs and can adjust results for sampling weights.
The didregress and xtdidregress commands for difference-in-differences
estimation have an improved algorithm to compute confidence intervals
via the wild bootstrap.
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.
footer displays variable names as a footer.
relative displays relative observation numbers when a subset of
observations is listed.
The nl command for nonlinear
least-squares estimaton is now more powerful, with a substitutable
expression parser that allows you to define more complicated expressions
for linear and nonlinear functions of parameters. Also, it now uses
Mata's moptimize()
Gauss–Newton algorithm and Mata's deriv()
function for computing numerical derivatives.
The generalized method of moments command gmm
is now much faster with the xtinstruments() option for specifying panel-style
instruments and numerical derivatives. The speed is much improved when
the number of panels is large.
The areg command has the new
dfabsorb option to adjust degrees of
freedom for pairwise collinearity among absorbed variables.
The ivregress 2sls
command now computes regression coefficients and
their standard errors by using the Mata orthogonal triangularization
routine hqrdp, which is more numerically stable than the previous routine.
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.
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.
The areg command has the
new dfabsorb option to adjust
degrees of freedom for pairwise collinearity among absorbed variables.
The ivregress 2sls command
now computes regression coefficients and their standard errors using the
Mata orthogonal triangularization routine hqrdp, which is more numerically
stable than the previous routine.
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 solution
X 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 xtreg, fe
command has the new dfabsorb option to adjust
degrees of freedom for pairwise collinearity among absorbed variables.
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.
power and
ciwidth have
new more descriptive labels for table columns that are ratios of two other columns.
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.
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.
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.
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.
×
We use cookies
We use cookies to ensure that we give you the best experience on our website—to enhance site navigation, to analyze usage, and to assist in our marketing efforts. By continuing to use our site, you consent to the storing of cookies on your device and agree to delivery of content, including web fonts and JavaScript, from third party web services.
Cookie Settings
Privacy policy
Last updated: 16 November 2022
StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information.
These cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
Advertising and performance cookies
This website uses cookies to provide you with a better user experience. A cookie is a small piece of data our website stores on a site visitor's hard drive and accesses each time you visit so we can improve your access to our site, better understand how you use our site, and serve you content that may be of interest to you. For instance, we store a cookie when you log in to our shopping cart so that we can maintain your shopping cart should you not complete checkout. These cookies do not directly store your personal information, but they do support the ability to uniquely identify your internet browser and device.
Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.