📄 whatsnew7to8.hlp
字号:
{p 5 10 2}
44. Existing commands {cmd:ci} and {cmd:summarize} have new option
{cmd:separator(}{it:#}{cmd:)} that specifies how frequently separation
lines should be inserted into the output; see help {help ci} and
{help summarize}.
{p 5 10 2}
45. Existing command {cmd:impute} has three new options, {cmd:regsample},
{cmd:all}, and {cmd:copyrest} that control the sample used for forming
the imputation and how out-of-sample values are treated; see help
{help impute}.
{p 5 10 2}
46. Existing command {cmd:collapse} now takes time-series operators; see help
{help collapse}.
{title:What's new in data management}
{p 6 10 2}
1. New command {cmd:odbc} allows Stata for Windows to act as an ODBC client,
meaning you can fetch data directly from ODBC sources; see help
{help odbc}.
{p 6 10 2}
2. Existing command {cmd:generate} has new, more convenient syntax.
Now you can type
{p 14 18 2}
{cmd:. generate a = 2 + 3}
{p 10 10 2}
or
{p 14 18 2}
{cmd:. generate b = "this" + "that"}
{p 10 10 2}
without specifying whether new variable {cmd:b} is numeric or string of a
particular length. If you wish, you can also type
{p 14 18 2}
{cmd:. generate str b = "this" + "that"}
{p 10 10 2}
which asserts that {cmd:b} is a string but leaves it to {cmd:generate} to
determine the length of the string. This is useful in programming
situations because it helps to prevent bugs. Of course, you can continue
to type
{p 14 18 2}
{cmd:. generate double a = _pi/2}
{p 10 10 2}
and
{p 14 18 2}
{cmd:. generate str8 b = "this" + "that"}
{p 10 10 2}
See help {help generate}.
{p 6 10 2}
3. Existing command {cmd:list} has been completely redone. Not only is
output far more readable -- and even pretty -- but programmers will want
to use {cmd:list} to format tables. See help {help list}.
{p 6 10 2}
4. Existing command {cmd:merge} has been improved:
{p 10 14 2}
a. New options {cmd:unique}, {cmd:uniqmaster}, and {cmd:uniqusing} ensure
that the merge goes as you intend. These options amount to assertions
that, if false, cause {cmd:merge} to stop. {cmd:unique} specifies
that there should not be repeated observations within match variables,
and that if you say "{cmd:merge} {it:id} {cmd:using} {it:myfile}",
there should be one observation per {it:id} value in the master data
(the data in memory) and one observation per {it:id} in the using
data. If observations are not unique, {cmd:merge} will complain.
{p 14 14 2}
Options {cmd:uniqmaster} and {cmd:uniqusing} make the same claim for
one or the other half of the merge; {cmd:uniq} is equivalent to
specifying {cmd:uniqmaster} and {cmd:uniqusing}.
{p 10 14 2}
b. {cmd:merge} no longer has a limit on the number of match (key)
variables.
{p 10 14 2}
c. {cmd:merge} has new option {cmd:keep(}{it:varlist}{cmd:)} that
specifies the variables to be kept from the using data.
{p 10 10 2}
See help {help merge}.
{p 6 10 2}
5. Existing command {cmd:append} has new option {cmd:keep(}{it:varlist}{cmd:)}
that specifies the variables to be kept from the using data; see help
{help append}.
{p 6 10 2}
6. New command {cmd:tsappend} appends observations in a time-series context.
{cmd:tsappend} uses the information set by {help tsset}, automatically
fills in the time variable, and fills in the panel variable if the panel
variable was set. See help {help tsappend}.
{p 6 10 2}
7. Existing command {cmd:describe using} will now allow you to specify a
{it:varlist}, so you can check whether a variable exists in a dataset
before merging or appending. Programmers will be interested in the new
{cmd:varlist} option, which will leave in {cmd:r()} the names of the
variables in the dataset. See help {help describe}.
{p 6 10 2}
8. New command {cmd:isid} verifies that a variable or set of variables
uniquely identify the observations and so are suitable for use with
{cmd:merge}; see help {help isid}.
{p 6 10 2}
9. Existing command {cmd:codebook} has new option {cmd:problems} to report
potential problems in the data; see help {help codebook}.
{p 5 10 2}
10. New command {cmd:labelbook} is like {cmd:codebook}, but for value labels.
In addition to providing documentation, the output includes a list of
potential problems.
{p 10 10 2}
New command {cmd:numlabel} prefixes numerical values onto value labels
and removes them. For example, the mapping 2 --> "Catholic"
becomes "2. Catholic" and vice versa.
{p 10 10 2}
See help {help labelbook} and {help numlabel}.
{p 5 10 2}
11. New command {cmd:duplicates} reports on, gives examples of, lists,
browses, tags, and/or drops duplicate observations; see help
{help duplicates}.
{p 5 10 2}
12. Existing command {cmd:recode} has three new features:
{p 10 14 2}
a. {cmd:recode} now allows a {it:varlist} rather than a {it:varname},
so several variables can be recoded at once.
{p 10 14 2}
b. {cmd:recode} has new option {cmd:generate()} to specify that the
transformed variables be stored under different names than the
originals.
{p 10 14 2}
c. {cmd:recode} has new option {cmd:prefix()}, an alternative to
{cmd:generate}, to specify that the transformed variables are to be
given their original names, but with a prefix.
{p 10 10 2}
See help {help recode}.
{p 5 10 2}
13. Existing command {cmd:sort} has new option {cmd:stable} that says, within
equal values of the sort keys, the observations are to appear in the same
order as they did originally. See help {help sort}.
{p 5 10 2}
14. New command {cmd:webuse} loads the specified dataset, obtaining it over
the web. By default, datasets are obtained from
{browse "http://www.stata-press.com/data/r8/"}, but you can reset that.
See help {help webuse}.
{p 10 10 2}
New command {cmd:sysuse} loads the specified dataset that was shipped
with Stata, plus any other datasets stored along the ado-path; see help
{help sysuse}.
{p 5 10 2}
15. Existing command {cmd:insheet} has a new {cmd:delimiter(}{it:char}{cmd:)}
option that allows you to specify an arbitrary character as the value
separator; see help {help insheet}.
{p 5 10 2}
16. Existing commands {cmd:infile} and {cmd:infix} no longer treat {cmd:^Z}
as the end of a file; see help {help infile1}, {help infile2} and
{help infix}.
{p 5 10 2}
17. Existing command {cmd:save} has features:
{p 10 14 2}
a. New option {cmd:orphans} specifies that all value labels, including
those not attached to any variables, are to be saved in the file.
{p 10 14 2}
b. New option {cmd:emptyok} specifies that the dataset is to be saved
even if it contains no variables and no observations.
{p 10 14 2}
c. Existing option {cmd:old} is removed. To save datasets in Stata 7
format, use the new {cmd:saveold} command; see help {help saveold}.
{p 10 10 2}
See help {help save}. By the way, Stata 8 now has a single {cmd:.dta}
dataset format used by both {help SpecialEdition:Stata/SE} and
Intercooled Stata, meaning that sharing data with colleagues is easy.
{p 5 10 2}
18. Existing command {cmd:outfile} has new features:
{p 10 14 2}
a. New options {cmd:rjs} and {cmd:fjs} specify how strings are to be
aligned in the output file. The default is left alignment. Option
{cmd:rjs} specifies right alignment. Option {cmd:fjs} specifies
alignment as specified by the variables' formats.
{p 10 14 2}
b. New option {cmd:runtogether} is for use by programmers; it specifies
that all string variables be run together without extra spaces in
between or quotes.
{p 10 10 2}
See help {help outfile}.
{p 5 10 2}
19. You may attach value labels to the new extended missing values ({cmd:.a},
{cmd:.b}, ..., {cmd:.z}); see help {help label}.
{p 5 10 2}
20. As a consequence of the 26 new missing value codes, the maximum value
that can be stored in a {cmd:byte}, {cmd:int}, and {cmd:long} is reduced
to 100, 32,740, and 2,147,483,620; see help {help datatypes}.
{p 5 10 2}
21. New command {cmd:split} splits the contents of a string variable into one
or more parts and is useful for separating words into multiple variables;
see help {help split}.
{p 5 10 2}
22. In the way of minor improvements are
{p 10 14 2}
a. Existing command {cmd:egen} now allows longer {it:numlists} in the
{cmd:values()} option for the {cmd:eqany()} and {cmd:neqany()}
functions; see help {help egen}.
{p 10 14 2}
b. Existing command {cmd:destring} now allows an abbreviated
{it:newvarlist} in the {cmd:generate()} option; see help
{help destring}.
{p 10 14 2}
c. Existing commands {cmd:icd9} and {cmd:icd9p} have been updated to use
the V18 and V19 codes; V16, V18, and V19 codes have been merged so
that {cmd:icd9} and {cmd:icd9p} work equally well with old and new
datasets; see help {help icd9}.
{p 10 14 2}
d. Existing command {cmd:egen} {cmd:mtr()} has been updated to include
the marginal tax rates for the years 2000 and 2001; see help
{help egen}.
{p 10 14 2}
e. Existing command {cmd:mvdecode}'s {cmd:mv()} option now allows a
{it:numlist}; see help {help mvencode}.
{p 10 14 2}
f. Existing command {cmd:mvencode} has a new, more versatile syntax to
accommodate extended missing values; see help {help mvencode}.
{p 10 14 2}
g. Existing command {cmd:xpose} has three new options: {cmd:format},
{cmd:format(%}{it:fmt}{cmd:)}, and {cmd:promote}. The {cmd:format}
option finds the largest numeric display format in the pretransposed
data and applies it to the transposed data. The
{cmd:format(%}{it:fmt}{cmd:)} option sets the transposed data to the
specified format. The {cmd:promote} option causes the transposed
data to have the most compact numeric data type that preserves the
original data accuracy. See help {help xpose}.
{p 10 14 2}
h. Existing command {cmd:notes} now allows the individual notes to
include SMCL directives; see help {help notes}.
{p 10 14 2}
i. Existing command {cmd:mkmat} has new {cmd:nomissing} option that
causes observations with missing values to be excluded (because
matrices can now contain missing values). {cmd:mkmat} has also been
made faster. See help {help mkmat}.
{p 10 14 2}
j. Existing command {cmd:ds} has three new options: {cmd:alpha},
{cmd:varwidth(}{it:#}{cmd:)}, and {cmd:skip(}{it:#}{cmd:)}.
{cmd:alpha} sorts the variables in alphabetic order.
{cmd:varwidth(}{it:#}{cmd:)} specifies the display width of the
variable names. {cmd:skip(}{it:#}{cmd:)} specifies the number of
spaces between variables. See help {help describe}.
{p 10 14 2}
k. Existing commands {cmd:label dir} now returns the names of the defined
value labels in {cmd:r(names)} and {cmd:label list} now returns the
minimum and maximum of the mapped values in {cmd:r(min)} and
{cmd:r(max)}; see help {help label}.
{title:What's new in expressions and functions}
{p 6 10 2}
1. First, a warning: Do not type
{p 14 18 2}
{cmd:. generate} {it:newvar} {cmd:=} ... {cmd:if} {it:oldvar} {cmd:!= .}
{p 14 18 2}
{cmd:. replace} {it:oldvar} {cmd:=} ... {cmd:if} {it:oldvar} {cmd:!= .}
{p 14 18 2}
{cmd:. list} ... {cmd:if} {it:var} {cmd:!= .}
{p 10 10 2}
Type
{p 14 18 2}
{cmd:. generate} {it:newvar} {cmd:=} ... {cmd:if} {it:oldvar} {cmd:< .}
{p 14 18 2}
{cmd:. replace} {it:oldvar} {cmd:=} ... {cmd:if} {it:oldvar} {cmd:< .}
{p 14 18 2}
{cmd:. list} ... {cmd:if} {it:var} {cmd:< .}
{p 10 10 2}
or type
{p 14 18 2}
{cmd:. generate} {it:newvar} {cmd:=} ... {cmd:if !mi(}{it:oldvar}{cmd:)}
{p 14 18 2}
{cmd:. replace} {it:oldvar} {cmd:=} ... {cmd:if !mi(}{it:oldvar}{cmd:)}
{p 14 18 2}
{cmd:. list} ... {cmd:if !mi(}{it:var}{cmd:)}
{p 10 10 2}
Stata has new missing values and the ordering is {it:all numbers} <
{cmd:.} < {cmd:.a} < {cmd:.b} < ... < {cmd:.z}. If you do not use the new
missing values, then your old habits will work, but better to be safe.
{p 10 10 2}
It is a hot topic of debate at StataCorp whether {it:varname}{cmd:<.} or
{cmd:!mi(}{it:varname}{cmd:)} is the preferred way of excluding missing
values, and therefore both constructs are deemed to be equally stylish;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -