📄 whatsnew7to8.hlp
字号:
use whichever appeals to you.
{p 10 10 2}
New function {cmd:mi()} is a synonym for existing function
{cmd:missing()}; it returns 1 (true) if missing and false otherwise.
See help {help progfun}.
{p 6 10 2}
2. By the same token, do not type
{p 14 18 2}
{cmd:. list} ... {cmd:if} {it:var} {cmd:== .}
{p 10 10 2}
To list observations with missing values of {\it var}, type
{p 14 18 2}
{cmd:. list} ... {cmd:if} {it:var} {cmd:>= .}
{p 10 10 2}
or type
{p 14 18 2}
{cmd:. list} ... {cmd:if mi(}{it:var}{cmd:)}
{p 6 10 2}
3. Matrices can now contain missing values, both the standard one ({cmd:.})
and the extended ones ({cmd:.a}, {cmd:.b}, ..., {cmd:.z}).
{p 6 10 2}
4. The following new density functions are provided:
{p 10 14 2}
a. {cmd:tden(}{it:n}{cmd:,}{it:t}{cmd:)}, the density of Student's t
distribution.
{p 10 14 2}
b. {cmd:Fden(}{it:n_1}{cmd:,}{it:n_2}{cmd:,}{it:F}{cmd:)}, the density of
the F distribution.
{p 10 14 2}
c. {cmd:nFden(}{it:n_1}{cmd:,}{it:n_2}{cmd:,}{it:lambda}{cmd:,}{it:F}{cmd:)},
the noncentral F density.
{p 10 14 2}
d. {cmd:betaden(}{it:a}{cmd:,}{it:b}{cmd:,}{it:x}{cmd:)}, the 2-parameter
Beta density.
{p 10 14 2}
e. {cmd:nbetaden(}{it:a}{cmd:,}{it:b}{cmd:,}{it:g}{cmd:,}{it:x}{cmd:)},
the noncentral Beta density.
{p 10 14 2}
f. {cmd:gammaden(}{it:a}{cmd:,}{it:b}{cmd:,}{it:g}{cmd:,}{it:x}{cmd:)},
the 3-parameter Gamma density.
{p 10 10 2}
See help {help probfun}.
{p 6 10 2}
5. The following new cumulative density functions are provided:
{p 10 14 2}
a. {cmd:nFtail(}{it:n_1}{cmd:,}{it:n_2}{cmd:,}{it:lambda}{cmd:,}{it:f}{cmd:)},
the upper-tail of the noncentral F.
{p 10 14 2}
b. {cmd:nibeta(}{it:a}{cmd:,}{it:b}{cmd:,}{it:lambda}{cmd:,}{it:x}{cmd:)},
the cumulative noncentral ibeta probability.
{p 10 10 2}
See help {help probfun}.
{p 6 10 2}
6. The following new inverse cumulative density functions are provided:
{p 10 14 2}
a. {cmd:invnFtail(}{it:n_1}{cmd:,}{it:n_2}{cmd:,}{it:lambda}{cmd:,}{it:p}{cmd:)},
the noncentral F corresponding to upper-tail {it:p}.
{p 10 14 2}
b. {cmd:invibeta(}{it:a}{cmd:,}{it:b}{cmd:,}{it:p}{cmd:)}, the incomplete
beta value corresponding to {it:p}.
{p 10 14 2}
c. {cmd:invnibeta(}{it:a}{cmd:,}{it:b}{cmd:,}{it:lambda}{cmd:,}{it:p}{cmd:)},
the noncentral beta value corresponding to {it:p}.
{p 10 10 2}
In addition, existing function
{cmd:invbinomial(}{it:n}{cmd:,}{it:k}{cmd:,}{it:p}{cmd:)} has improved
accuracy. See help {help probfun}.
{p 6 10 2}
7. A suite of new functions provides partial derivatives of the cumulative
gamma distribution. The following new functions are provided:
{p 10 14 2}
a. {cmd:dgammapda(}{it:a}{cmd:,}{it:x}{cmd:)}, partial derivative of
{cmd:gammap(}{it:a}{cmd:,}{it:x}{cmd:)} with respect to {it:a}.
{p 10 14 2}
b. {cmd:dgammapdx(}{it:a}{cmd:,}{it:x}{cmd:)}, partial derivative of
{cmd:gammap(}{it:a}{cmd:,}{it:x}{cmd:)} with respect to {it:x}.
{p 10 14 2}
c. {cmd:dgammapdada(}{it:a}{cmd:,}{it:x}{cmd:)}, 2nd partial derivative
of {cmd:gammap(}{it:a}{cmd:,}{it:x}{cmd:)} with respect to {it:a}.
{p 10 14 2}
d. {cmd:dgammapdxdx(}{it:a}{cmd:,}{it:x}{cmd:)}, 2nd partial derivative
of {cmd:gammap(}{it:a}{cmd:,}{it:x}{cmd:)} with respect to {it:x}.
{p 10 14 2}
e. {cmd:dgammapdadx(}{it:a}{cmd:,}{it:x}{cmd:)}, 2nd partial derivative
of {cmd:gammap(}{it:a}{cmd:,}{it:x}{cmd:)} with respect to {it:a} and
{it:x}.
{p 10 10 2}
See help {help probfun}.
{p 6 10 2}
8. All density and distribution functions have been extended to return
nonmissing values over the entire real line; see help {help probfun}.
{p 6 10 2}
9. The following new string functions are provided:
{p 10 14 2}
a. {cmd:word(}{it:s}{cmd:,}{it:n}{cmd:)} returns the {it:n}th word in
{it:s}.
{p 10 14 2}
b. {cmd:wordcount(}{it:s}{cmd:)} returns the number of words in {it:s}.
{p 10 14 2}
c. {cmd:char(}{it:n}{cmd:)} returns the character corresponding to ASCII
code {it:n}.
{p 10 14 2}
d. {cmd:plural(}{it:n}{cmd:,}{it:s_1}{cmd:)} returns the plural of
{it:s_1} if {it:n} does not equal 1 or -1, and otherwise returns
{it:s_1}.
{p 10 14 2}
e. {cmd:plural(}{it:n}{cmd:,}{it:s_1}{cmd:,}{it:s_2}{cmd:)} returns the
plural of {it:s_1} if {it:n} does not equal 1 or -1, forming the
plural by adding or removing suffix {cmd:s_2}.
{p 10 14 2}
f. {cmd:proper(}{it:s}{cmd:)} capitalizes the first letter of a string
and any other letters immediately following characters that are not
letters; remaining letters are converted to lowercase.
{p 10 10 2}
See help {help strfun}.
{p 5 10 2}
10. The following new mathematical functions are provided:
{p 10 14 2}
a. {cmd:logit(}{it:x}{cmd:)}, the log of the odds ratio.
{p 10 14 2}
b. {cmd:invlogit(}{it:x}{cmd:)}, the inverse logit.
{p 10 14 2}
c. {cmd:cloglog(}{it:x}{cmd:)}, the complementary log-log.
{p 10 14 2}
d. {cmd:invcloglog(}{it:x}{cmd:)}, the inverse of the complementary
log-log.
{p 10 14 2}
e. {cmd:tanh(}{it:x}{cmd:)}, the hyperbolic tangent.
{p 10 14 2}
f. {cmd:atanh(}{it:x}{cmd:)}, the arc-hyperbolic tangent of {it:x}.
{p 10 14 2}
g. {cmd:floor(}{it:x}{cmd:)}, the integer {it:n} such that
{it:n} <= {it:x} < {it:n}+1.
{p 10 14 2}
h. {cmd:ceil(}{it:x}{cmd:)}, the integer {it:n} such that
{it:n} < {it:x} <= {it:n}+1.
{p 10 10 2}
In addition, the following existing mathematical functions have been
modified:
{p 10 14 2}
i. {cmd:round(}{it:x}{cmd:,}{it:y}{cmd:)} now allows the second argument
be optional and defaults it to 1, so {cmd:round(}{it:x}{cmd:)}
returns {it:x} rounded to the closest integer.
{p 10 14 2}
j. {cmd:lngamma(}{it:x}{cmd:)} and
{cmd:gammap(}{it:a}{cmd:,}{it:x}{cmd:)} now have improved accuracy.
{p 10 10 2}
See help {help mathfun}.
{p 5 10 2}
11. Existing function {cmd:uniform()} will now allow you to capture and reset
its seed. The seed value, in encrypted form, is now shown by
{cmd:query}. You can store its value by typing
{p 14 18 2}
{cmd:local seed = c(seed)}
{p 10 10 2}
Later, you can reset it by typing
{p 14 18 2}
{cmd:. set seed `seed'}
{p 10 10 2}
See help {help seed} and help {help random}.
{p 5 10 2}
12. The following new matrix functions are provided:
{p 10 14 2}
a. {cmd:issym(}{it:M}{cmd:)} returns 1 if matrix {it:M} is symmetric and
returns 0 otherwise; {cmd:issym()} may be used in any context.
{p 10 14 2}
b. {cmd:matmissing(}{it:M}{cmd:)} returns 1 if any elements of {it:M}
are missing and returns 0 otherwise; {cmd:matmissing()} may be used
in any context.
{p 10 14 2}
c. {cmd:vec(}{it:M}{cmd:)} returns the column vector formed by listing
the elements of {it:M}, starting with the first column and proceeding
column by column.
{p 10 14 2}
d. {cmd:hadamard(}{it:M}{cmd:,}{it:N}{cmd:)} returns a matrix whose
{it:i}, {it:j} element is
{it:M}[{it:i},{it:j}] * {it:N}[{it:i},{it:j}].
{p 10 14 2}
e. {cmd:matuniform(}{it:r}{cmd:,}{it:c}{cmd:)} returns the {it:r} by
{it:c} matrix containing uniformly distributed pseudo-random numbers
on the interval [0,1).
{p 10 10 2}
See help {help matfcns}.
{p 10 10 2}
In addition, the new command {cmd:matrix} {cmd:eigenvalues} returns the
complex eigenvalues of an {it:n} by {it:n} nonsymmetric matrix; see help
{help mateig}.
{p 5 10 2}
13. The following new programming functions have been added:
{p 10 14 2}
a. {cmd:clip(}{it:x}{cmd:,}{it:a}{cmd:,}{it:b}{cmd:)} returns {it:x} if
{it:a} <= {it:x} <= {it:b}, {it:a} if {it:x} <= {it:a}, {it:b} if
{it:x} >= {it:b}, and {it:missing} if $x$ is missing.
{p 10 14 2}
b. {cmd:chop(}{it:x}{cmd:,}{it:epsilon}{cmd:)} returns
{cmd:round(}{it:x}{cmd:)} if
|{it:x} - {cmd:round(}{it:x}{cmd:)}| < {it:epsilon}, otherwise
returns {it:x}.
{p 10 14 2}
c. {cmd:irecode(}{it:z}{cmd:,}{it:x_1}{cmd:,}{it:x_2}{cmd:,} ... {cmd:,}{it:x_n}{cmd:)}
returns the index of the range in which {it:z} falls.
{p 10 14 2}
d. {cmd:maxbyte()}, {cmd:maxint()}, {cmd:maxlong()},
{cmd:maxfloat()}, and {cmd:maxdouble()} return the maximum value
allowed by the storage type.
{p 10 14 2}
e. {cmd:minbyte()}, {cmd:minint()}, {cmd:minlong()},
{cmd:minfloat()}, and {cmd:mindouble()} return the minimum value
allowed by the storage type.
{p 10 14 2}
f. {cmd:epsfloat()} and {cmd:epsdouble()} return the precision
associated with the storage type.
{p 10 14 2}
g. {cmd:byteorder()} returns 1 if the computer stores numbers in
most-significant-byte-first format and 0 if in
least-significant-byte-first format.
{p 10 10 2}
The following programming functions have been modified or extended:
{p 10 14 2}
h. {cmd:missing(}{it:x}{cmd:)} now optionally allows multiple arguments
so that it becomes
{cmd:missing(}{it:x_1}{cmd:,}{it:x_2}{cmd:,} ... {cmd:,}{it:x_n}{cmd:)}.
The extended function returns 1 (true) if any of the {it:x_i} are
missing and returns 0 (false) otherwise.
{p 10 14 2}
i. {cmd:cond(}{it:x}{cmd:,}{it:a}{cmd:,}{it:b}{cmd:)} now optionally
allows a fourth argument so that it becomes
{cmd:cond(}{it:x}{cmd:,}{it:a}{cmd:,}{it:b}{cmd:,}{it:c}{cmd:)}.
{it:c} is returned if {it:x} evaluates to missing.
{p 10 10 2}
See help {help progfun}.
{title:What's new in display formats}
{p 6 10 2}
1. The {cmd:%g} format has been modified: {cmd:%}{it:#}{cmd:.0g} still means
the same as previously, but {cmd:%}{it:#}{cmd:.}{it:#}{cmd:g} has a new
meaning. For instance, {cmd:%9.5g} means to show approximately 5
significant digits. We say approximately because, given the number
123,456, {cmd:%9.5g} will show {cmd:123456} rather than {cmd:1.2346e+05},
as would strictly be required if only five digits are to be shown. Other
than that, it does what you would expect, and we think, in all cases, does
what you want.
{p 6 10 2}
2. {cmd:%}[{cmd:-}]{cmd:0}{it:#}{cmd:.}{it:#}{cmd:f} formats, note the
leading {cmd:0}, now specify that leading zeros are to be included in the
result. 1.2 in {cmd:%09.2f} format is {cmd:000001.20}.
{p 6 10 2}
3. Stata has a new {cmd:%21x} hexadecimal format that will mainly be of
interest to numerical analysts. In {cmd:%21x}, 123,456 looks like
{cmd:+1.e240000000000X+010}, which you read as the hexadecimal number
1.e24 multiplied by 2^10. The period in 1.e24 is the base-16 point.
The beauty of this format is that it reveals numbers exactly as the
binary computer thinks of it. For instance, the new format shows how
difficult numbers like 0.1 are for binary computers:
{cmd:+1.999999999999aX-004}.
{p 10 10 2}
You can use this hexadecimal way of writing numbers in expressions; Stata
will understand, for instance,
{p 14 18 2}
{cmd:. generate xover4 = x / 1.0x+2}
{p 10 10 2}
but it is unlikely you would want to do that. The notation will even by
understood by {help input}, {help infix}, and {help infile}. There is no
{cmd:%21x} input format, but wherever a number appears, Stata will
understand {it:#}{cmd:.}{it:##}..
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -