This page contains only historical information and is not about the current
release of Stata.
Please see our Stata 11 page
for information on the current version of Stata.
Programming
-
First, a warning for time-series programmers: Stata’s new date/time
values, which contain the number of milliseconds since 01jan1960 00:00:00,
result in large numbers. 21apr2007 12:14:07.123 corresponds to
1,492,776,847,123. Date/time values must be stored as doubles.
Programmers should use scalars to store these values whenever possible. If
you must use a macro, exercise caution that the value is not rounded. It
would not do at all for 1,492,776,847,123 to be recorded as
“1.493e+12” (which would be 24apr2007 02:13:20). If you
must use macros, our recommendations are
-
If a date/time value is stored in one macro and you need it in
another, code
local new `old'
-
If a date/time value is the result of an expression, and you must
store it as a macro, code
local new = string(exp, "\%21x")
or
local new : display %21x (exp)
Now we will continue with What’s new.
-
Stata for Windows now supports Automation, formerly known as OLE
Automation, which means that programmers can control Stata from other
applications and retrieve results. See [P]
Automation.
-
New command confirm
{numeric | string |
date} format verifies
that the format is of the specified type; see [P]
confirm.
-
New function
fmtwidth(s)
returns the display width of a %fmt string, including date
formats; see Programming functions in [D]
functions.
-
Expression limits have been increased in Stata/MP, Stata/SE, and Stata/IC.
The limit on the number of dyadic operators has increased from 500 to 800,
and the limit on the number of numeric literals has increased from 150 to
300. See help limits.
-
Intercooled Stata has been renamed to Stata/IC. c(flavor)
now contains IC rather than Intercooled if
version≥10. Backward-compatibility old global macro
$S_FLAVOR continues to contain Intercooled. See [P]
creturn
and [P] macro.
-
c() now contains values associated with Stata/MP:
c(MP) (1 or 0 depending on whether you are
running Stata/MP), c(processors) (the number of
processors being used), c(processors_mach)
(the number of processors on the computer),
c(processors_lic) (the maximum number of
processors the license will allow you to use),
c(processors_max) (the maximum number of
processors that could be used on this computer with this license).
-
New command include is a variation on
do and
run.
include executes the commands stored in a file
just as if they were entered from the keyboard or the current do-file. It
is most often used in advanced Mata situations to create the equivalent of
#include files. See [P]
include.
-
New commands signestimationsample and
checkestimationsample are useful in writing
estimation/postestimation commands that need to identify the estimation
sample; see [P]
signestimationsample.
-
New command _datasignature is the building block
for Stata’s
datasignature command and the programming commands
signestimationsample and
checkestimationsample. In advanced situations,
you may wish to call it directly. See [P]
_datasignature.
-
New extended macro function :copy copies one
macro to another and is faster when the macro being copied is long. That
is, coding
local new : copy local old
is faster than
local new `old'
See [P] macro.
-
New command timer times sections of code;
see [P] timer.
-
Existing command matrix accum is now faster when some
observations contain zeros; see [P]
matrix accum.
-
Existing command ml display has new option
showeqns that requests that equation names be
displayed in the coefficient table; see [R]
ml.
-
Existing command mkmat has new options
rownames(), roweq(),
rowprefix(), obs, and
nchar() that specify the row names of the
created matrix; see [P]
matrix mkmat.
-
Existing command
_rmdcoll’s
nocollin option has been renamed
to normcoll. nocollin
will continue to work as a synonym for normcoll.
-
Existing command
describe’s option simple no longer
saves the names of the variables in r(varlist);
you must specify option varlist if you want
that. Also, existing command describe
using filename now
allows options simple and
varlist.
-
New extended macro function adosubdir returns the
subdirectory in which Stata would search for a file along the ado-path.
Determining the subdirectory in which Stata stores files is now a function
of the file’s extension. Command
adosubdir returns the subdirectory in which to look. See [P]
macro.
-
Existing command syntax { [
optionname(real ...) ]
} now returns the number specified in
%18.0g format if
version is
set to 10.0 or higher. For version less than 10,
the number is returned in %9.0g format. See [P]
syntax.
-
New functions _byn1() and _byn2(),
available within a byable(recall) program, return
the beginning and ending observation numbers of the by-group currently
being executed; see [P]
byable.
-
Existing command program drop may now specify
program drop _allado to drop programs that were
automatically loaded from ado-files; see [P]
program.
-
Concerning SMCL,
-
Directive {synoptset} has new optional
argument notes that specifies that some of
the table entries will have footnotes and results in a larger
indentation of the first column.
-
Existing directive {p} now has an optional
fourth argument specifying the paragraph’s width.
See [P] smcl.
-
For classes, you can now define an oncopy
member program to perform operations when a copy of an object is being
created. See [P]
class.
-
For programmable menus, the maximum number of menu items that can
be added to Stata has increased to 1,250 from 1,000; see
help
window programming.
-
Concerning programmable dialogs,
-
Child dialogs can now be created.
-
New control TEXTBOX allows displaying
multiline text.
-
In the dialog programming language, (1)
if now allows
else
and (2) new command close
closes the dialog programmatically.
-
Messages can be passed to dialogs when they are launched; see
help db.
-
Dialogs can now be designated as modal, meaning that this dialog must
be dealt with by the user before new dialogs (other than children) can
be launched.
-
Several controls have new options and new member programs. For
instance, FILE and
LISTBOX now have option
multiselect, which lets the user pick more
than one item.
See
help dialog programming.
-
Stata’s help files are now named *.sthlp
rather than *.hlp, meaning that user-written help
files can be sent via email more easily. Many email filters flag
.hlp files as potential virus carriers because Stata was not the only
one to use the .hlp suffix. You need not rename your old help files.
See [R] help.
-
Two new C functions have been exposed from Stata for use by plugins:
sstore() and sdata().
sstore() stores string data in the Stata dataset
and sdata() reads them. See
http://www.stata.com/plugins/.
Back to highlights
|
|